MDL-36466 cache: improved handling of exceptions during initialisation.

This commit is contained in:
Sam Hemelryk 2012-11-13 09:26:07 +13:00
parent f42c34a38a
commit 7383a7e2a0
4 changed files with 127 additions and 13 deletions

View file

@ -1444,7 +1444,12 @@ border-color:black; background-color:#ffffee; border-style:solid; border-radius:
width: 80%; -moz-border-radius: 20px; padding: 15px">
' . $message . '
</div>';
if (!empty($CFG->debug) && $CFG->debug >= DEBUG_DEVELOPER) {
// Check whether debug is set.
$debug = (!empty($CFG->debug) && $CFG->debug >= DEBUG_DEVELOPER);
// Also check we have it set in the config file. This occurs if the method to read the config table from the
// database fails, reading from the config table is the first database interaction we have.
$debug = $debug || (!empty($CFG->config_php_settings['debug']) && $CFG->config_php_settings['debug'] >= DEBUG_DEVELOPER );
if ($debug) {
if (!empty($debuginfo)) {
$debuginfo = s($debuginfo); // removes all nasty JS
$debuginfo = str_replace("\n", '<br />', $debuginfo); // keep newlines