cvs: pear /MDB2/tests testUtils.php
| From: | Lukas Smith | Date: | Wed, 25 Oct 2006 12:13:29 +0000 |
| Subject: | cvs: pear /MDB2/tests testUtils.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-42811@lists.php.net to get a copy of this message | ||
lsmith Wed Oct 25 12:13:29 2006 UTC
Modified files:
/pear/MDB2/tests testUtils.php
Log:
- better deal with non scalar arguments as 5.2.0 explodes otherwise
http://cvs.php.net/viewvc.cgi/pear/MDB2/tests/testUtils.php?r1=1.12&r2=1.13&diff_format=u
Index: pear/MDB2/tests/testUtils.php
diff -u pear/MDB2/tests/testUtils.php:1.12 pear/MDB2/tests/testUtils.php:1.13
--- pear/MDB2/tests/testUtils.php:1.12 Wed May 31 14:38:07 2006
+++ pear/MDB2/tests/testUtils.php Wed Oct 25 12:13:29 2006
@@ -34,7 +34,7 @@
/**
* Little helper function that gets a backtrace if available
*/
-function getBacktrace()
+function getBacktrace($errline = 0)
{
$message = '';
if (!function_exists('debug_backtrace')) {
@@ -59,7 +59,11 @@
$message.= $trace_item['function'];
if (!empty($trace_item['args']) &&
is_array($trace_item['args'])) {
- $message.= '('.@implode(', ',
$trace_item['args']).')';
+ $args = array();
+ foreach ($trace_item['args'] as $arg) {
+ $args[] = is_scalar($arg) ? $arg : (is_object($arg) ? get_class($arg) :
gettype($arg));
+ }
+ $message.= '('.implode(', ', $args).')';
} else {
$message.= '()';
}
@@ -107,7 +111,7 @@
break;
}
- $message.= getBacktrace();
+ $message.= getBacktrace($errline);
print_r($message);
}