Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fixing how error handlers are registered when debug levels
are toggled mid request.  Previously Debugger would stay
as the active error handler even after changing debug to 0.
Now, either CakeLog or Debugger will be assigned as the error handler
depending on the debug level.
Fixes #1941
  • Loading branch information
markstory committed Aug 27, 2011
1 parent aee650d commit fdc006a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions cake/libs/configure.php
Expand Up @@ -118,6 +118,7 @@ function write($config, $value = null) {
if (function_exists('ini_set')) {
ini_set('display_errors', 1);
}
$callback = array('Debugger', 'getInstance');
} elseif (function_exists('ini_set')) {
ini_set('display_errors', 0);
}
Expand All @@ -132,6 +133,12 @@ function write($config, $value = null) {
if (!class_exists('CakeLog')) {
require LIBS . 'cake_log.php';
}
if (empty($callback)) {
$callback = array('CakeLog', 'getInstance');
}
}
if (!empty($callback) && class_exists('Debugger')) {
Debugger::invoke(call_user_func($callback));
}
error_reporting($reporting);
}
Expand Down

0 comments on commit fdc006a

Please sign in to comment.