mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
refactor: Centralize includes and initialization (#4991)
This commit is contained in:
committed by
Neil Lathwood
parent
bbf05feb90
commit
9a33464c52
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user