mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Change configuration property to static class property
This commit is contained in:
parent
a5e1be7abf
commit
e37db25ce0
1 changed files with 11 additions and 3 deletions
|
@ -95,6 +95,14 @@ App::uses('Router', 'Routing');
|
||||||
*/
|
*/
|
||||||
class ErrorHandler {
|
class ErrorHandler {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether to give up rendering an exception, if the renderer itself is
|
||||||
|
* throwing exceptions.
|
||||||
|
*
|
||||||
|
* @var bool
|
||||||
|
*/
|
||||||
|
protected static $_bailExceptionRendering = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set as the default exception handler by the CakePHP bootstrap process.
|
* Set as the default exception handler by the CakePHP bootstrap process.
|
||||||
*
|
*
|
||||||
|
@ -126,7 +134,7 @@ class ErrorHandler {
|
||||||
$e->getTraceAsString()
|
$e->getTraceAsString()
|
||||||
);
|
);
|
||||||
|
|
||||||
Configure::write('Exception.bail', true);
|
static::$_bailExceptionRendering = true;
|
||||||
trigger_error($message, E_USER_ERROR);
|
trigger_error($message, E_USER_ERROR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -258,8 +266,8 @@ class ErrorHandler {
|
||||||
$exception = new InternalErrorException();
|
$exception = new InternalErrorException();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Configure::read('Exception.bail')) {
|
if (static::$_bailExceptionRendering) {
|
||||||
Configure::write('Exception.bail', false);
|
static::$_bailExceptionRendering = false;
|
||||||
throw $exception;
|
throw $exception;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue