From 7b9be84bf876963955ef2fcfd0cd1271a146a743 Mon Sep 17 00:00:00 2001 From: skodak Date: Mon, 11 May 2009 17:10:28 +0000 Subject: [PATCH] MDL-19150 moving the $PAGE setup after debug level configuration --- lib/setup.php | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/lib/setup.php b/lib/setup.php index 47d6990142..525286041a 100644 --- a/lib/setup.php +++ b/lib/setup.php @@ -274,14 +274,6 @@ global $SCRIPT; get_system_context(); } -/// Create the $PAGE global. - if (!empty($CFG->moodlepageclass)) { - $classname = $CFG->moodlepageclass; - } else { - $classname = 'moodle_page'; - } - $PAGE = new $classname(); - /// Set error reporting back to normal if ($originaldatabasedebug == -1) { $CFG->debug = DEBUG_MINIMAL; @@ -318,6 +310,15 @@ global $SCRIPT; @ini_set('log_errors', '1'); } +/// Create the $PAGE global. + if (!empty($CFG->moodlepageclass)) { + $classname = $CFG->moodlepageclass; + } else { + $classname = 'moodle_page'; + } + $PAGE = new $classname(); + unset($classname); + /// detect unsupported upgrade jump as soon as possible - do not change anything, do not use system functions if (!empty($CFG->version) and $CFG->version < 2007101509) { print_error('upgraderequires19', 'error'); -- 2.39.5