From 7a93276ecf0c8812e64abb21c1917ad81c601208 Mon Sep 17 00:00:00 2001 From: Thomas Ploch Date: Thu, 8 Mar 2012 16:00:09 +0100 Subject: [PATCH 1/2] Move inclusion of application bootstrap behind ErrorHandler initialization in Configure::bootstrap(). --- lib/Cake/Core/Configure.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/Cake/Core/Configure.php b/lib/Cake/Core/Configure.php index dc7b68c72..8da62466a 100644 --- a/lib/Cake/Core/Configure.php +++ b/lib/Cake/Core/Configure.php @@ -75,9 +75,6 @@ class Configure { App::$bootstrapping = false; App::init(); App::build(); - if (!include APP . 'Config' . DS . 'bootstrap.php') { - trigger_error(__d('cake_dev', "Can't find application bootstrap file. Please create %sbootstrap.php, and make sure it is readable by PHP.", APP . 'Config' . DS), E_USER_ERROR); - } $level = -1; if (isset(self::$_values['Error']['level'])) { error_reporting(self::$_values['Error']['level']); @@ -89,6 +86,9 @@ class Configure { if (!empty(self::$_values['Exception']['handler'])) { set_exception_handler(self::$_values['Exception']['handler']); } + if (!include APP . 'Config' . DS . 'bootstrap.php') { + trigger_error(__d('cake_dev', "Can't find application bootstrap file. Please create %sbootstrap.php, and make sure it is readable by PHP.", APP . 'Config' . DS), E_USER_ERROR); + } } } From cc9b445eceb4bfdb5cebd1e5269e1d6b98c318b6 Mon Sep 17 00:00:00 2001 From: Thomas Ploch Date: Fri, 9 Mar 2012 17:50:03 +0100 Subject: [PATCH 2/2] Fixed warnings in stack trace element when no stack args are set. --- lib/Cake/View/Elements/exception_stack_trace.ctp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/Cake/View/Elements/exception_stack_trace.ctp b/lib/Cake/View/Elements/exception_stack_trace.ctp index be016757a..219bf28c4 100644 --- a/lib/Cake/View/Elements/exception_stack_trace.ctp +++ b/lib/Cake/View/Elements/exception_stack_trace.ctp @@ -41,10 +41,12 @@ App::uses('Debugger', 'Utility'); echo ' → '; if ($stack['function']): $args = array(); - foreach ($stack['args'] as $arg): - $args[] = Debugger::getType($arg); - $params[] = Debugger::exportVar($arg, 2); - endforeach; + if (!empty($stack['args'])): + foreach ((array)$stack['args'] as $arg): + $args[] = Debugger::getType($arg); + $params[] = Debugger::exportVar($arg, 2); + endforeach; + endif; $called = isset($stack['class']) ? $stack['class'] . $stack['type'] . $stack['function'] : $stack['function'];