diff options
Diffstat (limited to 'debug.class')
-rw-r--r-- | debug.class | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/debug.class b/debug.class index 956b0d0..fa6f314 100644 --- a/debug.class +++ b/debug.class @@ -98,17 +98,17 @@ function internal_error($text) /** * Function to return dump of all it's parameters, - * normally used through D(), ED(), EDX() in support.pinc + * normally used through D(), ED(), EDX() in functions.php * @param Varargs of mixed stuff to dump * @return String representation of dump */ -function dump() +function dump($args) { $stack = debug_backtrace(); - $line = $stack[2]['line']; - $file = $stack[2]['file']; + $line = $stack[1]['line']; + $file = $stack[1]['file']; - if (!$_SERVER['REMOTE_ADDR'] && !preg_match('/class/', $file)) + if (!$_SERVER['REMOTE_ADDR'] && (substr(file_get_contents($file), 0, 2) == "#!")) $line++; if (ereg('(csv|txt|gif|jpg)', $_SERVER['PHP_SELF']) || !ereg('Mozilla', $_SERVER['HTTP_USER_AGENT'])) @@ -134,12 +134,12 @@ function dump() $paramlist = preg_match('/(D|ED|EDC|EDX)\s*\(\s*([^)]+)/i', $src, $parts) ? $parts[2] : ""; $argnames = preg_split('/\s*,\s*/', $paramlist); - foreach (func_get_args() as $arg) + if ($parts[1] == "EDC") # First argument was stripped by EDC + array_shift($argnames); + + foreach ($args as $arg) { $var = array_shift($argnames); - if ($arg==='_ignoreme') - continue; - $item = gettype($arg) == 'resource' ? trim(print_r($arg, true)) : trim(var_export($arg, true)); # Replace PHP 5 var_export object representation by old style |