Move inclusion of APP bootstrap after initialization of ErrorHandler #552

Merged
merged 3 commits into from Mar 11, 2012
@@ -75,9 +75,6 @@ public static function bootstrap($boot = true) {
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 @@ public static function bootstrap($boot = true) {
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);
+ }
}
}
@@ -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'];