From 15a2f91e31e5a1e19e8204d73746684566990d44 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Fri, 13 Jan 2006 02:33:03 +0000 Subject: [PATCH] Change the backtrace workings --- kernel.php | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/kernel.php b/kernel.php index e8834dc..88a133e 100644 --- a/kernel.php +++ b/kernel.php @@ -673,12 +673,27 @@ class Shared_Object_Framework } $backtrace = debug_backtrace(); - unset($backtrace[0]); + array_shift($backtrace); + if (isset($backtrace[0]) AND $backtrace[0]['function'] == '_error_handler') + { + array_shift($backtrace); + } + + $trace = array(); + foreach ($backtrace AS $i => $step) + { + $file = $step['file'] . ':' . $step['line']; + $funct = (isset($step['class']) ? $step['class'] . '::' . $step['function'] : $step['function']); + $args = (is_array($step['args']) ? implode(', ', $step['args']) : ''); + + $trace[] = "#$i $funct($args) called at [$file]"; + } + $output = "\n
\n"; $output .= "\n\n\t\n"; $output .= "\n\n\t\n"; - $output .= (($stack AND $GLOBALS['isso:null-framework']->debug) ? "\n\n\t\n" : ''); + $output .= (($stack AND $GLOBALS['isso:null-framework']->debug) ? "\n\n\t\n" : ''); $output .= "\n
$prefix: $title
$message
Debug Stack:
" . print_r($backtrace, true) . "
Debug Stack:
" . implode("\n", $trace) . "
\n
\n"; if ($return) -- 2.43.5