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)
16 * @return Cache\ConfigCache
18 public function createCache(ConfigFileLoader $loader)
20 $configCache = new Cache\ConfigCache();
21 $loader->setupCache($configCache);
27 * @param Cache\ConfigCache $configCache The config cache of this adapter
28 * @param ConfigModel $configModel The configuration model
30 * @return Config\Configuration
32 public function createConfig(Cache\ConfigCache $configCache, ConfigModel $configModel)
34 if ($configCache->get('system', 'config_adapter') === 'preload') {
35 $configuration = new Config\PreloadConfiguration($configCache, $configModel);
37 $configuration = new Config\JitConfiguration($configCache, $configModel);
41 return $configuration;
45 * @param Cache\ConfigCache $configCache The config cache
46 * @param Cache\PConfigCache $pConfigCache The personal config cache
47 * @param PConfigModel $configModel The configuration model
49 * @return Config\PConfiguration
51 public function createPConfig(Cache\ConfigCache $configCache, Cache\PConfigCache $pConfigCache, PConfigModel $configModel)
53 if ($configCache->get('system', 'config_adapter') === 'preload') {
54 $configuration = new Config\PreloadPConfiguration($pConfigCache, $configModel);
56 $configuration = new Config\JitPConfiguration($pConfigCache, $configModel);
59 return $configuration;