mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
In CLI mode default the error handlers to Console flavors.
In the somewhat rare case where an error or exception occurs during application bootstrap, we should not emit HTML to the stdout. Refs #7661
This commit is contained in:
parent
df3c786f57
commit
89d5449270
1 changed files with 6 additions and 0 deletions
|
@ -87,6 +87,12 @@ class Configure {
|
|||
'handler' => 'ErrorHandler::handleError',
|
||||
'level' => E_ALL & ~E_DEPRECATED,
|
||||
);
|
||||
if (PHP_SAPI === 'cli') {
|
||||
App::uses('ConsoleErrorHandler', 'Console');
|
||||
$console = new ConsoleErrorHandler();
|
||||
$exception['handler'] = array($console, 'handleException');
|
||||
$error['handler'] = array($console, 'handleError');
|
||||
}
|
||||
static::_setErrorHandlers($error, $exception);
|
||||
|
||||
if (!include APP . 'Config' . DS . 'bootstrap.php') {
|
||||
|
|
Loading…
Reference in a new issue