3 namespace Friendica\Factory;
5 use Friendica\Core\Config;
10 * @param Config\ConfigCacheLoader $loader The Config Cache loader (INI/config/.htconfig)
12 * @return Config\ConfigCache
14 public static function createCache(Config\ConfigCacheLoader $loader)
16 $configCache = new Config\ConfigCache();
17 $loader->loadConfigFiles($configCache);
23 * @param string $type The adapter type
24 * @param Config\IConfigCache $config The config cache of this adapter
26 * @return Config\IConfigAdapter
28 public static function createConfig($type, $config)
30 if ($type == 'preload') {
31 return new Config\PreloadConfigAdapter($config);
33 return new Config\JITConfigAdapter($config);
38 * @param string $type The adapter type
39 * @param int $uid The UID of the current user
40 * @param Config\IPConfigCache $config The config cache of this adapter
42 * @return Config\IPConfigAdapter
44 public static function createPConfig($type, $uid, $config)
46 if ($type == 'preload') {
47 return new Config\PreloadPConfigAdapter($uid, $config);
49 return new Config\JITPConfigAdapter($config);