mirror of
https://github.com/friendica/friendica
synced 2025-04-29 15:44:24 +02:00
Refactor ConfigFileManager
This commit is contained in:
parent
cde93c68dc
commit
58e447f7bb
1 changed files with 48 additions and 46 deletions
|
@ -245,7 +245,10 @@ class ConfigFileManager
|
||||||
$fullName = $this->baseDir . DIRECTORY_SEPARATOR . '.' . $name . '.php';
|
$fullName = $this->baseDir . DIRECTORY_SEPARATOR . '.' . $name . '.php';
|
||||||
|
|
||||||
$config = [];
|
$config = [];
|
||||||
if (file_exists($fullName)) {
|
if (!file_exists($fullName)) {
|
||||||
|
return $config;
|
||||||
|
}
|
||||||
|
|
||||||
$a = new \stdClass();
|
$a = new \stdClass();
|
||||||
$a->config = [];
|
$a->config = [];
|
||||||
include $fullName;
|
include $fullName;
|
||||||
|
@ -283,7 +286,7 @@ class ConfigFileManager
|
||||||
$config['database']['database'] = $db_data;
|
$config['database']['database'] = $db_data;
|
||||||
unset($db_data);
|
unset($db_data);
|
||||||
}
|
}
|
||||||
if (isset($config['system']['db_charset'])) {
|
if (isset($config['system']) && isset($config['system']['db_charset'])) {
|
||||||
$config['database']['charset'] = $config['system']['db_charset'];
|
$config['database']['charset'] = $config['system']['db_charset'];
|
||||||
}
|
}
|
||||||
if (isset($pidfile)) {
|
if (isset($pidfile)) {
|
||||||
|
@ -298,7 +301,6 @@ class ConfigFileManager
|
||||||
$config['system']['language'] = $lang;
|
$config['system']['language'] = $lang;
|
||||||
unset($lang);
|
unset($lang);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return $config;
|
return $config;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue