Revision e102e1d9
Added by Pi Ba over 8 years ago
src/etc/inc/config.lib.inc | ||
---|---|---|
1011 | 1011 |
$error = error_get_last(); |
1012 | 1012 |
|
1013 | 1013 |
if ($error !== NULL) { |
1014 |
if ($error['type'] == E_ERROR) {
|
|
1014 |
if (in_array($error['type'], array(E_ERROR, E_COMPILE_ERROR, E_CORE_ERROR, E_RECOVERABLE_ERROR))) {
|
|
1015 | 1015 |
$errorstr = "PHP ERROR: Type: {$error['type']}, File: {$error['file']}, Line: {$error['line']}, Message: {$error['message']}"; |
1016 | 1016 |
print($errorstr); |
1017 | 1017 |
log_error($errorstr); |
1018 |
file_notice("phperror", $errorstr, 'PHP errors'); |
|
1018 | 1019 |
} else if ($error['type'] != E_NOTICE) { |
1019 | 1020 |
$errorstr = "PHP WARNING: Type: {$error['type']}, File: {$error['file']}, Line: {$error['line']}, Message: {$error['message']}"; |
1020 | 1021 |
// XXX: comment out for now, should re-enable post-2.2 |
1021 | 1022 |
//print($errorstr); |
1022 | 1023 |
//log_error($errorstr); |
1024 |
//file_notice("phpwarning", $errorstr, 'PHP warning'); |
|
1023 | 1025 |
} |
1024 | 1026 |
} |
1025 | 1027 |
|
Also available in: Unified diff
php fatal error logging
(cherry picked from commit ae3463540ea0a3cc94c18ad9c7b829b2645e8910)