summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUrban Müller2018-05-15 17:37:29 +0200
committerUrban Müller2018-05-15 17:37:29 +0200
commite59e4bb3e7c80aba50e7255021f04fe8c15031bb (patch)
tree78022841f95da8d6867b1ca0f915b80ef159e0c4
parent5689233970dc6476a33b2ce2981d2281758f70ad (diff)
downloaditools-e59e4bb3e7c80aba50e7255021f04fe8c15031bb.tar.gz
itools-e59e4bb3e7c80aba50e7255021f04fe8c15031bb.tar.bz2
itools-e59e4bb3e7c80aba50e7255021f04fe8c15031bb.zip
allow custom stack tarce for compaction
-rw-r--r--it_debug.class3
1 files changed, 2 insertions, 1 deletions
diff --git a/it_debug.class b/it_debug.class
index 89d31e7..b53a192 100644
--- a/it_debug.class
+++ b/it_debug.class
@@ -167,6 +167,7 @@ static function dump($args)
* @param $p['levels'] number of stack levels to return (default: 0 = all)
* @param $p['skiplevels'] number of stack levels to omit
* @param $p['skipfiles'] regular expression of filenames to omit
+ * @param $p['trace'] Stack trace to compact
*/
static function backtrace($p = array())
{
@@ -175,7 +176,7 @@ static function backtrace($p = array())
$p += array('levels' => 0, 'skiplevels'=> 0, 'skipfiles' => "###");
- foreach (array_slice(debug_backtrace(@constant('DEBUG_BACKTRACE_IGNORE_ARGS')), $p['skiplevels']) as $call)
+ foreach ($p['trace'] ?: array_slice(debug_backtrace(@constant('DEBUG_BACKTRACE_IGNORE_ARGS')), $p['skiplevels']) as $call)
{
if (($fn = $call['file']) && !it::match($p['skipfiles'], $call['file']))
{