3 |
// $Id$ |
// $Id$ |
4 |
// ------------------------------------------------------------------------- |
// ------------------------------------------------------------------------- |
5 |
// $Log$ |
// $Log$ |
6 |
|
// Revision 1.4 2003/02/09 17:30:27 joko |
7 |
|
// + minor update related to new log level constants |
8 |
|
// |
9 |
|
// Revision 1.3 2002/12/13 09:19:32 joko |
10 |
|
// + debugging |
11 |
|
// |
12 |
|
// Revision 1.2 2002/12/01 04:47:19 joko |
13 |
|
// + comments |
14 |
|
// |
15 |
// Revision 1.1 2002/11/12 05:42:30 joko |
// Revision 1.1 2002/11/12 05:42:30 joko |
16 |
// + initial checkin |
// + initial checkin |
17 |
// |
// |
18 |
// ------------------------------------------------------------------------- |
// ------------------------------------------------------------------------- |
19 |
|
|
20 |
|
|
21 |
|
// TODO: maybe use and/or enhance ErrorHandler from http://phpclasses.php-start.de/browse.html/package/345.html |
22 |
|
|
23 |
function error_handler($level, $message, $file, $line, $context) { |
function error_handler($level, $message, $file, $line, $context) { |
24 |
global $Application_Error; |
global $Application_Error; |
25 |
$Application_Error['this']->callErrorHandler($level, $message, $file, $line, $context); |
$Application_Error['this']->callErrorHandler($level, $message, $file, $line, $context); |
34 |
|
|
35 |
function activate($level = E_ALL) { |
function activate($level = E_ALL) { |
36 |
//return; |
//return; |
37 |
|
//print "1<br>"; |
38 |
|
//exit; |
39 |
global $Application_Error; |
global $Application_Error; |
40 |
|
//print "2<br>"; |
41 |
$Application_Error[this] = $this; |
$Application_Error[this] = $this; |
42 |
|
//print "3<br>"; |
43 |
//error_reporting($level); |
//error_reporting($level); |
44 |
error_reporting(E_ALL); |
error_reporting(E_ALL); |
45 |
|
//print "4<br>"; |
46 |
set_error_handler('error_handler'); |
set_error_handler('error_handler'); |
47 |
|
//print "5<br>"; |
48 |
} |
} |
49 |
|
|
50 |
function callErrorHandler($level, $message, $file, $line, $context) { |
function callErrorHandler($level, $message, $file, $line, $context) { |
88 |
if (isset($this->site)) { |
if (isset($this->site)) { |
89 |
|
|
90 |
// logging mechanism |
// logging mechanism |
91 |
$this->site->log($phperror, LOG_ERR); |
$this->site->log($phperror, PEAR_LOG_ERR); |
92 |
|
|
93 |
// redirection to "STDOUT", make html for output |
// redirection to "STDOUT", make html for output |
94 |
if ($this->site->config['mode']['PHPERRORS_LEVEL']) { |
if ($this->site->config['mode']['PHPERRORS_LEVEL']) { |