3 namespace Friendica\Factory;
5 use Friendica\Core\Config;
6 use Friendica\Core\Config\Cache;
7 use Friendica\Model\Config\Config as ConfigModel;
8 use Friendica\Model\Config\PConfig as PConfigModel;
9 use Friendica\Util\ConfigFileLoader;
14 * @param ConfigFileLoader $loader The Config Cache loader (INI/config/.htconfig)
18 public function createCache(ConfigFileLoader $loader)
20 $configCache = new Cache();
21 $loader->setupCache($configCache);
27 * @param Cache $configCache The config cache of this adapter
28 * @param ConfigModel $configModel The configuration model
30 * @return Config\IConfig
32 public function createConfig(Cache $configCache, ConfigModel $configModel)
34 if ($configCache->get('system', 'config_adapter') === 'preload') {
35 $configuration = new Config\PreloadConfig($configCache, $configModel);
37 $configuration = new Config\JitConfig($configCache, $configModel);
41 return $configuration;
45 * @param Cache $configCache The config cache
46 * @param \Friendica\Core\PConfig\Cache $pConfigCache The personal config cache
47 * @param PConfigModel $configModel The configuration model
49 * @return \Friendica\Core\PConfig\IPConfig
51 public function createPConfig(Cache $configCache, \Friendica\Core\PConfig\Cache $pConfigCache, PConfigModel $configModel)
53 if ($configCache->get('system', 'config_adapter') === 'preload') {
54 $configuration = new \Friendica\Core\PConfig\PreloadPConfig($pConfigCache, $configModel);
56 $configuration = new \Friendica\Core\PConfig\JitPConfig($pConfigCache, $configModel);
59 return $configuration;