-$msg_colors = array(
- E_USER_ERROR => array('bg'=>'#ffcccc', 'txt'=>'#dd2200', 'bd'=>'#cc3300'),
- E_USER_WARNING => array('bg'=>'#ffcccc', 'txt'=>'#dd2200', 'bd'=>'#cc3300'),
- E_USER_NOTICE => array('bg'=>'#ccffcc', 'txt'=>'#007700', 'bd'=>'#33cc00'));
+function get_backtrace($html = false, $skip=0)
+{
+ $str = '';
+ if ($html) $str .= '<table border=0>';
+ $trace = debug_backtrace();
+
+ foreach($trace as $trn => $tr) {
+ if ($trn <= $skip) continue;
+ if ($html) $str .= '<tr><td>';
+ if (isset($tr['file']) && isset($tr['line']))
+ $str .= $tr['file'].':'.$tr['line'].': ';
+ if ($html) $str .= '</td><td>';
+ if (isset($tr['type'])) {
+ if($tr['type'] == '::') {
+ $str .= $tr['class'].'::';
+ } else if($tr['type'] == '->') {
+ $str .= '('.$tr['class'].' Object)'.'->';
+ }
+ }
+ $str .= $tr['function'].'(';
+
+ if(isset($tr['args']) && is_array($tr['args'])) {
+ $args = array();
+ foreach($tr['args'] as $n=>$a) {
+ if (is_object($tr['args'][$n]))
+ $args[$n] = "(".get_class($tr['args'][$n])." Object)";
+ elseif (is_array($tr['args'][$n]))
+ $args[$n] = "(Array[".count($tr['args'][$n])."])";
+ else
+ $args[$n] = "'".$tr['args'][$n]."'";
+ }
+ $str .= implode(',',$args);
+ }
+ $str .= ')</td>';
+ }
+
+ if ($html) $str .= '</tr></table>';
+ return $str;
+}