summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 54d6aba)
raw | patch | inline | side by side (parent: 54d6aba)
author | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 2 Jun 2005 07:38:08 +0000 (07:38 +0000) | ||
committer | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 2 Jun 2005 07:38:08 +0000 (07:38 +0000) |
include/functions.inc | patch | blob | history |
diff --git a/include/functions.inc b/include/functions.inc
index b01d42a69fe6cb96a402479590f76140f8e82de4..42d2f2a3f72a4aece152bcc63ec0e1f4374d79e7 100644 (file)
--- a/include/functions.inc
+++ b/include/functions.inc
}
}
- /* Extract traceback data */
- $trace= debug_backtrace();
-
/* Create error header */
$error_collector.= "<table width=\"100%\" cellspacing=0 style='background-color:#402005;color:white;border:2px solid red'><tr><td colspan=3><h1 style='color:white'>"._("PHP error")." \"$errstr\"</h1></td></tr>";
- /* Generate trace history */
- for ($index= 1; $index<count($trace); $index++){
- $ct= $trace[$index];
- $loc= "";
- if (isset($ct['class'])){
- $loc.= _("class")." ".$ct['class'];
+ /* Extract traceback data - if available */
+ if (function_exists('debug_backtrace')){
+ $trace= debug_backtrace();
+
+ /* Generate trace history */
+ for ($index= 1; $index<count($trace); $index++){
+ $ct= $trace[$index];
+ $loc= "";
+ if (isset($ct['class'])){
+ $loc.= _("class")." ".$ct['class'];
+ if (isset($ct['function'])){
+ $loc.= " / ";
+ }
+ }
if (isset($ct['function'])){
- $loc.= " / ";
+ $loc.= _("function")." ".$ct['function'];
}
- }
- if (isset($ct['function'])){
- $loc.= _("function")." ".$ct['function'];
- }
- if (isset($ct['type'])){
- switch ($ct['type']){
- case "::":
- $type= _("static");
- break;
-
- case "->":
- $type= _("method");
- break;
+ if (isset($ct['type'])){
+ switch ($ct['type']){
+ case "::":
+ $type= _("static");
+ break;
+
+ case "->":
+ $type= _("method");
+ break;
+ }
+ } else {
+ $type= "-";
}
- } else {
- $type= "-";
- }
- $args= "";
- foreach ($ct['args'] as $arg){
- $args.= htmlentities("\"$arg\", ");
- }
- $args= preg_replace("/, $/", "", $args);
- if ($args == ""){
- $args= "-";
+ $args= "";
+ foreach ($ct['args'] as $arg){
+ $args.= htmlentities("\"$arg\", ");
+ }
+ $args= preg_replace("/, $/", "", $args);
+ if ($args == ""){
+ $args= "-";
+ }
+ $file= $ct['file'];
+ $line= $ct['line'];
+ $color= ($index&1)?'#404040':'606060';
+ $error_collector.= "<tr style='background-color:$color'><td style='padding-left:20px' width=\"30%\">"._("Trace")."[$index]: $loc</td>";
+ $error_collector.= "<td>"._("File").": $file ("._('Line')." $line)</td><td width=\"10%\">"._("Type").": $type</td></tr>";
+ $error_collector.= "<tr style='background-color:$color'><td colspan=3 style='padding-left:20px;'>"._("Arguments").": $args</td></tr>";
}
- $file= $ct['file'];
- $line= $ct['line'];
- $color= ($index&1)?'#404040':'606060';
- $error_collector.= "<tr style='background-color:$color'><td style='padding-left:20px' width=\"30%\">"._("Trace")."[$index]: $loc</td>";
- $error_collector.= "<td>"._("File").": $file ("._('Line')." $line)</td><td width=\"10%\">"._("Type").": $type</td></tr>";
- $error_collector.= "<tr style='background-color:$color'><td colspan=3 style='padding-left:20px;'>"._("Arguments").": $args</td></tr>";
}
/* Close error table */