X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=src%2FCore%2FConfig%2FConfigCache.php;h=e03d3525666464a849e5c09e53f4179b3abdfb05;hb=a0b14a46cb83b93ea5f42437bc78aafd20eec70c;hp=355b1df2f5c3d3b56d7b67acd7d4222379d13c03;hpb=bc73d4bd2bbbb7c045b063c25c136f00480179c0;p=friendica.git diff --git a/src/Core/Config/ConfigCache.php b/src/Core/Config/ConfigCache.php index 355b1df2f5..e03d352566 100644 --- a/src/Core/Config/ConfigCache.php +++ b/src/Core/Config/ConfigCache.php @@ -11,24 +11,14 @@ namespace Friendica\Core\Config; */ class ConfigCache implements IConfigCache, IPConfigCache { - /** - * NEVER, EVER use this public config array outside of the class - * It is only public due to backward compatibility to .htconfig.php - * - * @var array The cached config array - */ - public $config; + private $config; /** * @param array $config A initial config array */ - public function __construct($config = []) + public function __construct(array $config = []) { - $this->config = []; - - if (isset($config)) { - $this->loadConfigArray($config, true); - } + $this->config = $config; } /** @@ -43,9 +33,9 @@ class ConfigCache implements IConfigCache, IPConfigCache foreach ($config as $category => $values) { foreach ($values as $key => $value) { if ($overwrite) { - self::set($category, $key, $value); + $this->set($category, $key, $value); } else { - self::setDefault($category, $key, $value); + $this->setDefault($category, $key, $value); } } } @@ -83,7 +73,7 @@ class ConfigCache implements IConfigCache, IPConfigCache private function setDefault($cat, $k, $v) { if (!isset($this->config[$cat][$k])) { - self::set($cat, $k, $v); + $this->set($cat, $k, $v); } }