don't dump fatal errors as html on the cli

This commit is contained in:
AD7six 2012-04-29 16:25:07 +02:00
parent 9a693f9a13
commit 6b6fdd2b84
2 changed files with 7 additions and 1 deletions

View file

@ -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'));

View file

@ -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;
}