fix: Stop flattening config options added in config.php (#5493)

This commit is contained in:
David Bell
2017-01-17 22:26:35 +00:00
committed by Neil Lathwood
parent 292c4382c1
commit 7fc2834eb4

View File

@ -1522,11 +1522,16 @@ function load_os(&$device)
if (!isset($device['os'])) {
throw new Exception('No OS to load');
}
$config['os'][$device['os']] = Symfony\Component\Yaml\Yaml::parse(
$tmp_os = Symfony\Component\Yaml\Yaml::parse(
file_get_contents($config['install_dir'] . '/includes/definitions/' . $device['os'] . '.yaml')
);
if (isset($config['os'][$device['os']])) {
$config['os'][$device['os']] = array_replace_recursive($tmp_os, $config['os'][$device['os']]);
} else {
$config['os'][$device['os']] = $tmp_os;
}
// Set type to a predefined type for the OS if it's not already set
if ($config['os'][$device['os']]['type'] != $device['type']) {
log_event('Device type changed '.$device['type'].' => '.$config['os'][$device['os']]['type'], $device, 'system');
@ -1555,7 +1560,11 @@ function load_all_os($restricted = array())
$tmp = Symfony\Component\Yaml\Yaml::parse(
file_get_contents($file)
);
$config['os'][$tmp['os']] = $tmp;
if (isset($config['os'][$tmp['os']])) {
$config['os'][$tmp['os']] = array_replace_recursive($tmp, $config['os'][$tmp['os']]);
} else {
$config['os'][$tmp['os']] = $tmp;
}
}
}