summaryrefslogtreecommitdiff
path: root/debug.class
diff options
context:
space:
mode:
authorUrban Müller2007-07-18 11:58:42 +0000
committerUrban Müller2007-07-18 11:58:42 +0000
commit8f61176da8e3f215cec70b3320c956d3e3ace73f (patch)
tree7cb66b951918fd67c9aa15078c46821912b01cf4 /debug.class
parent4c3b61356b9fe001c5637c30f6105a208f4dffc3 (diff)
downloaditools-8f61176da8e3f215cec70b3320c956d3e3ace73f.tar.gz
itools-8f61176da8e3f215cec70b3320c956d3e3ace73f.tar.bz2
itools-8f61176da8e3f215cec70b3320c956d3e3ace73f.zip
compatibility with auto-startup, some cleanups
Diffstat (limited to 'debug.class')
-rw-r--r--debug.class18
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