|
|
|
@ -103,47 +103,61 @@ class ConfigCacheLoader
|
|
|
|
|
{ |
|
|
|
|
$filePath = $this->baseDir . DIRECTORY_SEPARATOR . '.' . $name . '.php'; |
|
|
|
|
|
|
|
|
|
$config = []; |
|
|
|
|
|
|
|
|
|
if (file_exists($filePath)) { |
|
|
|
|
$a = new \stdClass(); |
|
|
|
|
$a->config = []; |
|
|
|
|
include $filePath; |
|
|
|
|
|
|
|
|
|
if (isset($db_host)) { |
|
|
|
|
$a->config['database']['hostname'] = $db_host; |
|
|
|
|
$config['database']['hostname'] = $db_host; |
|
|
|
|
unset($db_host); |
|
|
|
|
} |
|
|
|
|
if (isset($db_user)) { |
|
|
|
|
$a->config['database']['username'] = $db_user; |
|
|
|
|
$config['database']['username'] = $db_user; |
|
|
|
|
unset($db_user); |
|
|
|
|
} |
|
|
|
|
if (isset($db_pass)) { |
|
|
|
|
$a->config['database']['password'] = $db_pass; |
|
|
|
|
$config['database']['password'] = $db_pass; |
|
|
|
|
unset($db_pass); |
|
|
|
|
} |
|
|
|
|
if (isset($db_data)) { |
|
|
|
|
$a->config['database']['database'] = $db_data; |
|
|
|
|
$config['database']['database'] = $db_data; |
|
|
|
|
unset($db_data); |
|
|
|
|
} |
|
|
|
|
if (isset($a->config['system']['db_charset'])) { |
|
|
|
|
$a->config['database']['charset'] = $a->config['system']['charset']; |
|
|
|
|
$a->config['database']['charset'] = $config['system']['charset']; |
|
|
|
|
} |
|
|
|
|
if (isset($pidfile)) { |
|
|
|
|
$a->config['system']['pidfile'] = $pidfile; |
|
|
|
|
$config['system']['pidfile'] = $pidfile; |
|
|
|
|
unset($pidfile); |
|
|
|
|
} |
|
|
|
|
if (isset($default_timezone)) { |
|
|
|
|
$a->config['system']['default_timezone'] = $default_timezone; |
|
|
|
|
$config['system']['default_timezone'] = $default_timezone; |
|
|
|
|
unset($default_timezone); |
|
|
|
|
} |
|
|
|
|
if (isset($lang)) { |
|
|
|
|
$a->config['system']['language'] = $lang; |
|
|
|
|
$config['system']['language'] = $lang; |
|
|
|
|
unset($lang); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return $a->config; |
|
|
|
|
} else { |
|
|
|
|
return []; |
|
|
|
|
if (isset($admin_email)) { |
|
|
|
|
$config['config']['admin_email'] = $admin_email; |
|
|
|
|
unset($admin_email); |
|
|
|
|
} |
|
|
|
|
if (isset($admin_nickname)) { |
|
|
|
|
$config['config']['admin_nickname'] = $admin_nickname; |
|
|
|
|
unset($admin_nickname); |
|
|
|
|
} |
|
|
|
|
if (isset($php_path)) { |
|
|
|
|
$config['config']['php_path'] = $php_path; |
|
|
|
|
unset($php_path); |
|
|
|
|
} |
|
|
|
|
if (isset($max_import_size)) { |
|
|
|
|
$config['config']['max_import_size'] = $max_import_size; |
|
|
|
|
unset($max_import_size); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return $config; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|