| 119 |
} |
} |
| 120 |
|
|
| 121 |
|
|
| 122 |
|
/* This is the new error handler to store errors in the database |
| 123 |
|
class mosErrorHandler { |
| 124 |
|
var $types = array ( |
| 125 |
|
E_STRICT => 'Strict check', |
| 126 |
|
E_USER_WARNING => 'User Warning', |
| 127 |
|
E_USER_NOTICE => 'User Notice', |
| 128 |
|
E_WARNING => 'Warning', |
| 129 |
|
E_NOTICE => 'Notice', |
| 130 |
|
E_CORE_WARNING => 'Core Warning', |
| 131 |
|
E_COMPILE_WARNING => 'Compile Warning', |
| 132 |
|
E_USER_ERROR => 'User Error', |
| 133 |
|
E_ERROR => 'Error', |
| 134 |
|
E_PARSE => 'Parse error', |
| 135 |
|
E_CORE_ERROR => 'Core Error', |
| 136 |
|
E_COMPILE_ERROR => 'Compile Error' |
| 137 |
|
); |
| 138 |
|
|
| 139 |
|
function mosErrorHandler () { |
| 140 |
|
set_error_handler(array(&$this, 'handler')); |
| 141 |
|
} |
| 142 |
|
|
| 143 |
|
function handler ($errno, $errstr, $errfile, $errline, $errcontext) { |
| 144 |
|
if ($errno = E_STRICT) return; |
| 145 |
|
$string = $this->types[$errno].': '.$errstr.' in '.$errfile.' at '.$errline; |
| 146 |
|
$database =& mamboDatabase::getInstance(); |
| 147 |
|
if (eregi('^(sql)$', $errstr)) { |
| 148 |
|
$extra = $database->getErrorMsg(); |
| 149 |
|
} |
| 150 |
|
if (function_exists('debug_backtrace')) { |
| 151 |
|
foreach(debug_backtrace() as $back) { |
| 152 |
|
if (@$back['file']) { |
| 153 |
|
$extra .= "\n".$back['file'].':'.$back['line']; |
| 154 |
|
} |
| 155 |
|
} |
| 156 |
|
} |
| 157 |
|
$database->setQuery("DELETE FROM #__errors WHERE file=$errfile AND line=$errline AND number=$errno"); |
| 158 |
|
$database->query(); |
| 159 |
|
$database->setQuery("INSERT INTO #__errors VALUES (0, $errno, '$errfile', $errline, '$string', '$extra')"); |
| 160 |
|
$database->query(); |
| 161 |
|
} |
| 162 |
|
} |
| 163 |
|
*/ |
| 164 |
|
|
| 165 |
/** |
/** |
| 166 |
* Enter description here... |
* Enter description here... |
| 167 |
* |
* |