15 include_once
'PEAR.php';
56 $this->DEBUG_ENV =
true;
61 $this->error_obj =
false;
66 return $this->error_obj;
78 $this->error_obj =& $a_error_obj;
80 if (
$_SESSION[
"failure"] && substr($a_error_obj->getMessage(), 0, 22) !=
"Cannot find this block")
82 $m =
"Fatal Error: Called raise error two times.<br>".
83 "First error: ".$_SESSION[
"failure"].
'<br>'.
84 "Last Error:". $a_error_obj->getMessage();
86 $log->logError($a_error_obj->getCode(), $m);
87 session_unregister(
"failure");
91 if (substr($a_error_obj->getMessage(), 0, 22) ==
"Cannot find this block")
95 echo
"<b>DEVMODE</b><br><br>";
96 echo
"<b>Template Block not found.</b><br>";
97 echo
"You used a template block in your code that is not available.<br>";
98 echo
"Native Messge: <b>".$a_error_obj->getMessage().
"</b><br>";
99 if (is_array($a_error_obj->backtrace))
101 echo
"Backtrace:<br>";
102 foreach ($a_error_obj->backtrace as $b)
104 if ($b[
"function"] ==
"setCurrentBlock" &&
105 basename($b[
"file"]) !=
"class.ilTemplate.php")
109 echo
"File: ".$b[
"file"].
", ";
110 echo
"Line: ".$b[
"line"].
", ";
111 echo $b[
"function"].
"()<br>";
112 if ($b[
"function"] ==
"setCurrentBlock" &&
113 basename($b[
"file"]) !=
"class.ilTemplate.php")
124 if (is_object($log) and $log->enabled ==
true)
126 $log->logError($a_error_obj->getCode(),$a_error_obj->getMessage());
132 die (stripslashes($a_error_obj->getMessage()));
137 if ($this->DEBUG_ENV)
139 $message = $a_error_obj->getMessage();
143 $message =
"Under Construction";
148 if (!defined(
"ILIAS_MODULE"))
160 $_SESSION[
"failure"] = $a_error_obj->getMessage();
166 $dirname = dirname($_SERVER[
"PHP_SELF"]);
167 $ilurl = parse_url(ILIAS_HTTP_PATH);
168 $subdir = substr(strstr($dirname,$ilurl[
"path"]),strlen($ilurl[
"path"]));
173 $num_subdirs = substr_count($subdir,
"/");
175 for ($i=1;$i<=$num_subdirs;$i++)
184 if (substr(
$_SESSION[
"referer"],-4) ==
".php")
198 #$GLOBALS['ilLog']->logStack();
205 return $this->message;
209 $this->message = $a_message;
215 $this->message .=
"<br /> ";
217 $this->message .= $a_message;
236 $ilLog->write(
'PHP errror: '.$errstr.
'. FATAL error on line '.$errline.
' in file '.$errfile);
241 $ilLog->write(
'PHP warning: ['.$errno.
'] '.$errstr.
' on line '.$errline.
' in file '.$errfile);