Commit 09580e3c authored by Hugh Davenport's avatar Hugh Davenport Committed by Gerrit Code Review
Browse files

Merge "Fill $OVERRIDDEN with all variables set in config.php"

parents 315a0083 1744120c
......@@ -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