From fb31f42b294161a1f2686413f2cb710e5a1a609a Mon Sep 17 00:00:00 2001 From: Urban Müller Date: Tue, 8 Oct 2013 15:05:20 +0000 Subject: faster EDC(), ET() docs --- auto_prepend.php | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) (limited to 'auto_prepend.php') diff --git a/auto_prepend.php b/auto_prepend.php index b71acb7..ba62442 100644 --- a/auto_prepend.php +++ b/auto_prepend.php @@ -28,22 +28,26 @@ function ED() * Same as ED(), but if first argument is foo then $GLOBALS['debug_foo'] must be set for output * @return boolean indicating whether $GLOBALS['debug_foo'] was set */ -function EDC() +function EDC($var) { - $args = func_get_args(); - $var = array_shift($args); $GLOBALS['ULTRADEBUGVARS'][$var] = 1; - if (($result = $GLOBALS["debug_$var"]) && $args) + if (($result = $GLOBALS["debug_$var"])) { - if (ob_get_level() == 0 && $_SERVER['REMOTE_ADDR']) - ob_start(); # prevent later 'headers already sent' error - echo it_debug::dump($args); + $args = func_get_args(); + array_shift($args); # remove $var + + if ($args) + { + if (ob_get_level() == 0 && $_SERVER['REMOTE_ADDR']) + ob_start(); # prevent later 'headers already sent' error + echo it_debug::dump($args); + } + + if (!$result || $result === true) # Compatibility with old map relying on 0|1 + $result = intval($result); } - if (!$result || $result === true) # Compatibility with old map relying on 0|1 - $result = intval($result); - return $result; } @@ -62,9 +66,10 @@ function EDX() /** * Return a text in the selected language + * Replaces variables of the form {var} with quoted values from argument $values * @param $label Label of text to return - * @param $language Optional value array or language string - * @param $values Optional value array or language string + * @param $language Optional value array or language string (will be sent through Q()) + * @param $values Optional value array or language string (will be sent through Q()) * @return Localized text string */ function T($label, $language = null, $values = null) @@ -81,7 +86,7 @@ function T($label, $language = null, $values = null) * Return a text in the selected language * Replaces variables of the form {var} with value from argument $values * @param $label Label of text to return - * @param $values Associative array containing values to fill in + * @param $values Associative array containing values to fill in (no quoting) * @param $language Optional language to return text in. * @return Localized text string with variables replaced by their values */ -- cgit v1.2.3