From 14a6368b39e24e9487876260b9c11019b662b398 Mon Sep 17 00:00:00 2001 From: mark_story Date: Sun, 14 Nov 2010 22:48:13 -0500 Subject: [PATCH] Adding missed isset() check Making ConsoleErrorHandler handle both errors, and exceptions in CLI. --- cake/console/shell_dispatcher.php | 6 ++++-- cake/libs/error_handler.php | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/cake/console/shell_dispatcher.php b/cake/console/shell_dispatcher.php index 5b1b6a8fe9d..192801433bc 100644 --- a/cake/console/shell_dispatcher.php +++ b/cake/console/shell_dispatcher.php @@ -141,13 +141,15 @@ function __bootstrap() { $boot = file_exists(ROOT . DS . APP_DIR . DS . 'config' . DS . 'bootstrap.php'); require CORE_PATH . 'cake' . DS . 'bootstrap.php'; - require_once CONSOLE_LIBS . 'console_error_handler.php'; - set_exception_handler(array('ConsoleErrorHandler', 'handleException')); if (!file_exists(APP_PATH . 'config' . DS . 'core.php')) { include_once CAKE_CORE_INCLUDE_PATH . DS . 'cake' . DS . 'console' . DS . 'templates' . DS . 'skel' . DS . 'config' . DS . 'core.php'; App::build(); } + require_once CONSOLE_LIBS . 'console_error_handler.php'; + set_exception_handler(array('ConsoleErrorHandler', 'handleException')); + set_error_handler(array('ConsoleErrorHandler', 'handleError')); + if (!defined('FULL_BASE_URL')) { define('FULL_BASE_URL', '/'); } diff --git a/cake/libs/error_handler.php b/cake/libs/error_handler.php index 33146a289f1..c22f3ddc6fe 100644 --- a/cake/libs/error_handler.php +++ b/cake/libs/error_handler.php @@ -93,7 +93,7 @@ public static function handleException(Exception $exception) { */ public static function handleError($code, $description, $file = null, $line = null, $context = null) { $errorConfig = Configure::read('Error'); - if ($errorConfig['level'] && ($code & ~$errorConfig['level'])) { + if (isset($errorConfig['level']) && ($code & ~$errorConfig['level'])) { return; } list($error, $log) = self::_mapErrorCode($code);