diff options
author | Urban Müller | 2022-05-20 16:02:31 +0200 |
---|---|---|
committer | Urban Müller | 2022-05-20 16:02:31 +0200 |
commit | 1ad19406e5458d102bb3cf2091d4a1c575b7955e (patch) | |
tree | f68e055c348a21bdf0ffbb8f9d7f19ee00ffd4dc | |
parent | 4dc711e8029d67a75d4f0cc28304195eb4f9b673 (diff) | |
download | itools-1ad19406e5458d102bb3cf2091d4a1c575b7955e.tar.gz itools-1ad19406e5458d102bb3cf2091d4a1c575b7955e.tar.bz2 itools-1ad19406e5458d102bb3cf2091d4a1c575b7955e.zip |
supprt ED() without args for stackdump
-rw-r--r-- | auto_prepend.php | 4 | ||||
-rw-r--r-- | it_debug.class | 1 |
2 files changed, 3 insertions, 2 deletions
diff --git a/auto_prepend.php b/auto_prepend.php index 4c6a308..528769f 100644 --- a/auto_prepend.php +++ b/auto_prepend.php @@ -3,7 +3,7 @@ /****************** functions for class it_debug **********************/ /** - * Return string containing names and values of all arguments + * Return string containing names and values of all arguments or stack trace if no args */ function D(...$args) { @@ -11,7 +11,7 @@ function D(...$args) } /** - * Echo string containing names and values of all arguments + * Echo string containing names and values of all arguments or stack trace if no args */ function ED(...$args) { diff --git a/it_debug.class b/it_debug.class index bddd63b..a504be8 100644 --- a/it_debug.class +++ b/it_debug.class @@ -96,6 +96,7 @@ static function dump($args, $p = []) { $p += ['html' => !EDC('edplain') && (self::$force_html || $_SERVER['REMOTE_ADDR']), 'color' => true]; $htmlspecialchars = array("&" => "&", '<' => "<", '>' => ">"); + $args = count($args) ? $args : [it_debug::backtrace(['skiplevels' => 2])]; if ((preg_match('/csv|txt|gif|jpg/', $_SERVER['PHP_SELF']) || preg_grep('#text/(calendar|css|javascript|json|plain|rfc822|xml)|application/#', headers_list()) || $GLOBALS['debug_edplain']) && !$GLOBALS['debug_edhtml']) ; |