mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-03-17 06:59:51 +00:00
Removing error masking in ErrorHandler, instead correctly calling set_error_handler() works better.
This commit is contained in:
parent
c717ff2e72
commit
d3f0d25c03
2 changed files with 5 additions and 7 deletions
|
@ -102,12 +102,13 @@ class Configure {
|
||||||
if (!include(CONFIGS . 'bootstrap.php')) {
|
if (!include(CONFIGS . 'bootstrap.php')) {
|
||||||
trigger_error(sprintf(__("Can't find application bootstrap file. Please create %sbootstrap.php, and make sure it is readable by PHP."), CONFIGS), E_USER_ERROR);
|
trigger_error(sprintf(__("Can't find application bootstrap file. Please create %sbootstrap.php, and make sure it is readable by PHP."), CONFIGS), E_USER_ERROR);
|
||||||
}
|
}
|
||||||
|
$level = -1;
|
||||||
if (!empty(self::$_values['Error']['handler'])) {
|
|
||||||
set_error_handler(self::$_values['Error']['handler']);
|
|
||||||
}
|
|
||||||
if (isset(self::$_values['Error']['level'])) {
|
if (isset(self::$_values['Error']['level'])) {
|
||||||
error_reporting(self::$_values['Error']['level']);
|
error_reporting(self::$_values['Error']['level']);
|
||||||
|
$level = self::$_values['Error']['level'];
|
||||||
|
}
|
||||||
|
if (!empty(self::$_values['Error']['handler'])) {
|
||||||
|
set_error_handler(self::$_values['Error']['handler'], $level);
|
||||||
}
|
}
|
||||||
if (!empty(self::$_values['Exception']['handler'])) {
|
if (!empty(self::$_values['Exception']['handler'])) {
|
||||||
set_exception_handler(self::$_values['Exception']['handler']);
|
set_exception_handler(self::$_values['Exception']['handler']);
|
||||||
|
|
|
@ -134,9 +134,6 @@ class ErrorHandler {
|
||||||
*/
|
*/
|
||||||
public static function handleError($code, $description, $file = null, $line = null, $context = null) {
|
public static function handleError($code, $description, $file = null, $line = null, $context = null) {
|
||||||
$errorConfig = Configure::read('Error');
|
$errorConfig = Configure::read('Error');
|
||||||
if (isset($errorConfig['level']) && ($code & ~$errorConfig['level'])) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
list($error, $log) = self::_mapErrorCode($code);
|
list($error, $log) = self::_mapErrorCode($code);
|
||||||
|
|
||||||
$debug = Configure::read('debug');
|
$debug = Configure::read('debug');
|
||||||
|
|
Loading…
Add table
Reference in a new issue