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);
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 trigger_error(stripslashes($a_error_obj->getMessage()), E_USER_ERROR);
138 if ($this->DEBUG_ENV)
140 $message = $a_error_obj->getMessage();
144 $message =
"Under Construction";
149 if (!defined(
"ILIAS_MODULE"))
161 $_SESSION[
"failure"] = $a_error_obj->getMessage();
167 $dirname = dirname($_SERVER[
"PHP_SELF"]);
168 $ilurl = parse_url(ILIAS_HTTP_PATH);
169 $subdir = substr(strstr($dirname,$ilurl[
"path"]),strlen($ilurl[
"path"]));
174 $num_subdirs = substr_count($subdir,
"/");
176 for ($i=1;$i<=$num_subdirs;$i++)
185 if (substr(
$_SESSION[
"referer"],-4) ==
".php")
199 return $this->message;
203 $this->message = $a_message;
209 $this->message .=
"<br /> ";
211 $this->message .= $a_message;
230 $ilLog->write(
'PHP errror: '.$errstr.
'. FATAL error on line '.$errline.
' in file '.$errfile);
235 $ilLog->write(
'PHP warning: ['.$errno.
'] '.$errstr.
' on line '.$errline.
' in file '.$errfile);