Commit 1744120c authored by Andrew Robert Nicols's avatar Andrew Robert Nicols

Fill $OVERRIDDEN with all variables set in config.php

See bug #803955

This does mean that $OVERRIDDEN will also get a list of database fields and
plugins, but I think that more fields, is better than too few.

Change-Id: I3fef6277484e48d5ec4c1609fbe1178f976333f6
Signed-off-by: default avatarAndrew Robert Nicols <andrew.nicols@luns.net.uk>
parent 8add246e
......@@ -736,14 +736,16 @@ function ini_get_bool($ini_get_arg) {
*/
function load_config() {
global $CFG;
global $OVERRIDDEN; // array containing the database config fields overridden by $CFG
global $OVERRIDDEN; // array containing the config fields overridden by $CFG
$dbconfig = get_records_array('config', '', '', '', 'field, value');
// Get a full list of overridden fields
foreach ($CFG as $field => $value) {
$OVERRIDDEN[] = $field;
}
$dbconfig = get_records_array('config', '', '', '', 'field, value');
foreach ($dbconfig as $cfg) {
if (isset($CFG->{$cfg->field})) {
$OVERRIDDEN[] = $cfg->field;
} else {
if (!isset($CFG->{$cfg->field})) {
$CFG->{$cfg->field} = $cfg->value;
}
}
......
Markdown is supported
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