refactor: Centralize includes and initialization (#4991)

This commit is contained in:
Tony Murray
2016-11-21 14:12:59 -06:00
committed by Neil Lathwood
parent bbf05feb90
commit 9a33464c52
61 changed files with 326 additions and 578 deletions

View File

@@ -25,6 +25,26 @@
*/
/**
* merge the database config with the global config
* Global config overrides db
*/
function mergedb()
{
global $config;
$clone = $config;
foreach (dbFetchRows('select config_name,config_value from config') as $obj) {
$clone = array_replace_recursive($clone, mergecnf($obj));
}
$config = array_replace_recursive($clone, $config);
}
/**
* @param $obj
* @return array
*/
function mergecnf($obj)
{
$pointer = array();