From 6b6fdd2b842caba3750f24047454245dc2646d0e Mon Sep 17 00:00:00 2001 From: AD7six Date: Sun, 29 Apr 2012 16:25:07 +0200 Subject: [PATCH] don't dump fatal errors as html on the cli --- lib/Cake/Console/ShellDispatcher.php | 2 ++ lib/Cake/Core/App.php | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/Cake/Console/ShellDispatcher.php b/lib/Cake/Console/ShellDispatcher.php index 87c3c6e02..40c27cc15 100644 --- a/lib/Cake/Console/ShellDispatcher.php +++ b/lib/Cake/Console/ShellDispatcher.php @@ -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')); diff --git a/lib/Cake/Core/App.php b/lib/Cake/Core/App.php index 01e0d1ae6..071faa7a6 100644 --- a/lib/Cake/Core/App.php +++ b/lib/Cake/Core/App.php @@ -913,7 +913,11 @@ class App { 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; }