mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
don't dump fatal errors as html on the cli
This commit is contained in:
parent
9a693f9a13
commit
6b6fdd2b84
2 changed files with 7 additions and 1 deletions
|
@ -160,9 +160,11 @@ class ShellDispatcher {
|
|||
$errorHandler = new ConsoleErrorHandler();
|
||||
if (empty($error['consoleHandler'])) {
|
||||
$error['consoleHandler'] = array($errorHandler, 'handleError');
|
||||
Configure::write('error', $error);
|
||||
}
|
||||
if (empty($exception['consoleHandler'])) {
|
||||
$exception['consoleHandler'] = array($errorHandler, 'handleException');
|
||||
Configure::write('exception', $exception);
|
||||
}
|
||||
set_exception_handler($exception['consoleHandler']);
|
||||
set_error_handler($error['consoleHandler'], Configure::read('Error.level'));
|
||||
|
|
|
@ -913,7 +913,11 @@ class App {
|
|||
return;
|
||||
}
|
||||
|
||||
if (PHP_SAPI === 'cli') {
|
||||
$errorHandler = Configure::read('Error.consoleHandler');
|
||||
} else {
|
||||
$errorHandler = Configure::read('Error.handler');
|
||||
}
|
||||
if (!is_callable($errorHandler)) {
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue