Added a useful function for debugging: DebugBacktrace which provides a "light" version of PHP's built-in debug_backtrace().

SVN:trunk[1392]
This commit is contained in:
Denis Flaven
2011-07-31 08:57:04 +00:00
parent 5baa213e6a
commit ee3652acad

View File

@@ -504,5 +504,16 @@ class utils
}
}
}
static function DebugBacktrace($iLimit = 5)
{
$aFullTrace = debug_backtrace();
$aLightTrace = array();
for($i=1; ($i<=$iLimit && $i < count($aFullTrace)); $i++) // Skip the last function call... which is the call to this function !
{
$aLightTrace[$i] = $aFullTrace[$i]['function'].'(), called from line '.$aFullTrace[$i]['line'].' in '.$aFullTrace[$i]['file'];
}
echo "<p><pre>".print_r($aLightTrace, true)."</pre></p>\n";
}
}
?>