Commit b30fa335 authored by Petr Skoda's avatar Petr Skoda
Browse files

MDL-23948 we should make CFG global before assigning value to it, you could...

MDL-23948 we should make CFG global before assigning value to it, you could not include our config.php from non-global scope before which was breaking external stuff
parent 56953adc
......@@ -28,6 +28,7 @@
// //
///////////////////////////////////////////////////////////////////////////
unset($CFG); // Ignore this line
global $CFG; // This is necessary here for PHPUnit execution
$CFG = new stdClass();
//=========================================================================
......
......@@ -138,6 +138,7 @@ function install_generate_configphp($database, $cfg) {
$configphp = '<?php // Moodle configuration file' . PHP_EOL . PHP_EOL;
$configphp .= 'unset($CFG);' . PHP_EOL;
$configphp .= 'global $CFG;' . PHP_EOL;
$configphp .= '$CFG = new stdClass();' . PHP_EOL . PHP_EOL; // prevent PHP5 strict warnings
$dbconfig = $database->export_dbconfig();
......
......@@ -40,7 +40,7 @@
* @global object $CFG
* @name $CFG
*/
global $CFG;
global $CFG; // this should be done much earlier in config.php before creating new $CFG instance
// 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
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment