Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

don't dump fatal errors as html on the cli

  • Loading branch information...
commit 6b6fdd2b842caba3750f24047454245dc2646d0e 1 parent 9a693f9
@AD7six AD7six authored
Showing with 7 additions and 1 deletion.
  1. +2 −0  lib/Cake/Console/ShellDispatcher.php
  2. +5 −1 lib/Cake/Core/App.php
View
2  lib/Cake/Console/ShellDispatcher.php
@@ -160,9 +160,11 @@ public function setErrorHandlers() {
$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
6 lib/Cake/Core/App.php
@@ -913,7 +913,11 @@ protected static function _checkFatalError() {
return;
}
- $errorHandler = Configure::read('Error.handler');
+ if (PHP_SAPI === 'cli') {
+ $errorHandler = Configure::read('Error.consoleHandler');
+ } else {
+ $errorHandler = Configure::read('Error.handler');
+ }
if (!is_callable($errorHandler)) {
return;
}
Please sign in to comment.
Something went wrong with that request. Please try again.