MDL-39474 Library: Make a fast way to check developer debug mode

This commit is contained in:
sam marshall
2013-06-11 16:29:00 +01:00
parent b3be471f52
commit 5c92e7a740
6 changed files with 20 additions and 3 deletions
+10
View File
@@ -54,6 +54,13 @@ if (!isset($CFG)) {
}
}
// The 'developerdebug' value is relied upon by various functions, so set it
// immediately (before debugging value is actually known).
if (!isset($CFG->developerdebug)) {
$tempdeveloperdebug = true;
$CFG->developerdebug = false;
}
// We can detect real dirroot path reliably since PHP 4.0.2,
// it can not be anything else, there is no point in having this in config.php
$CFG->dirroot = dirname(dirname(__FILE__));
@@ -612,6 +619,9 @@ if ($originalconfigdebug !== null) {
unset($originalconfigdebug);
unset($originaldatabasedebug);
error_reporting($CFG->debug);
if (!empty($tempdeveloperdebug)) {
$CFG->developerdebug = debugging('', DEBUG_DEVELOPER);
}
// find out if PHP configured to display warnings,
// this is a security problem because some moodle scripts may