Merge pull request #7673 from cakephp/issue-7661

In CLI mode default the error handlers to Console flavors.
This commit is contained in:
José Lorenzo Rodríguez 2015-11-10 09:38:35 +01:00
commit 65b84107a1

View file

@ -87,6 +87,12 @@ class Configure {
'handler' => 'ErrorHandler::handleError', 'handler' => 'ErrorHandler::handleError',
'level' => E_ALL & ~E_DEPRECATED, '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); static::_setErrorHandlers($error, $exception);
if (!include APP . 'Config' . DS . 'bootstrap.php') { if (!include APP . 'Config' . DS . 'bootstrap.php') {