From 1ad19406e5458d102bb3cf2091d4a1c575b7955e Mon Sep 17 00:00:00 2001 From: Urban Müller Date: Fri, 20 May 2022 16:02:31 +0200 Subject: supprt ED() without args for stackdump --- auto_prepend.php | 4 ++-- 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']) ; -- cgit v1.2.3