refactor naming & superfluous check
This commit is contained in:
parent
8c6e6b5dea
commit
b22ff7419e
2 changed files with 7 additions and 7 deletions
|
@ -30,7 +30,7 @@ class ConfigCache implements IConfigCache, IPConfigCache
|
||||||
$categories = array_keys($config);
|
$categories = array_keys($config);
|
||||||
|
|
||||||
foreach ($categories as $category) {
|
foreach ($categories as $category) {
|
||||||
if (isset($config[$category]) && is_array($config[$category])) {
|
if (is_array($config[$category])) {
|
||||||
$keys = array_keys($config[$category]);
|
$keys = array_keys($config[$category]);
|
||||||
|
|
||||||
foreach ($keys as $key) {
|
foreach ($keys as $key) {
|
||||||
|
|
|
@ -110,18 +110,18 @@ class ConfigCacheLoader
|
||||||
$a->config = [];
|
$a->config = [];
|
||||||
include $filePath;
|
include $filePath;
|
||||||
|
|
||||||
$htconfigAr = array_keys($a->config);
|
$htConfigCategories = array_keys($a->config);
|
||||||
|
|
||||||
// map the legacy configuration structure to the current structure
|
// map the legacy configuration structure to the current structure
|
||||||
foreach ($htconfigAr as $htconfig) {
|
foreach ($htConfigCategories as $htConfigCategory) {
|
||||||
if (isset($a->config[$htconfig]) && is_array($a->config[$htconfig])) {
|
if (is_array($a->config[$htConfigCategory])) {
|
||||||
$keys = array_keys($a->config[$htconfig]);
|
$keys = array_keys($a->config[$htConfigCategory]);
|
||||||
|
|
||||||
foreach ($keys as $key) {
|
foreach ($keys as $key) {
|
||||||
$config[$htconfig][$key] = $a->config[$htconfig][$key];
|
$config[$htConfigCategory][$key] = $a->config[$htConfigCategory][$key];
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$config['config'][$htconfig] = $a->config[$htconfig];
|
$config['config'][$htConfigCategory] = $a->config[$htConfigCategory];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue