Adding ConfigFileSaver and tests

This commit is contained in:
Philipp Holzer 2019-03-24 12:54:26 +01:00
parent fa31bb6dde
commit 49def0dc27
No known key found for this signature in database
GPG key ID: 517BE60E2CE5C8A5
21 changed files with 493 additions and 473 deletions

View file

@ -6,19 +6,19 @@ use Friendica\Core;
use Friendica\Core\Config;
use Friendica\Core\Config\Adapter;
use Friendica\Core\Config\Cache;
use Friendica\Util\Config\ConfigCacheLoader;
use Friendica\Util\Config\ConfigFileLoader;
class ConfigFactory
{
/**
* @param ConfigCacheLoader $loader The Config Cache loader (INI/config/.htconfig)
* @param ConfigFileLoader $loader The Config Cache loader (INI/config/.htconfig)
*
* @return Cache\ConfigCache
*/
public static function createCache(ConfigCacheLoader $loader)
public static function createCache(ConfigFileLoader $loader)
{
$configCache = new Cache\ConfigCache();
$loader->loadConfigFiles($configCache);
$loader->setupCache($configCache);
return $configCache;
}

View file

@ -24,7 +24,7 @@ class DependencyFactory
{
$basePath = BasePath::create($directory, $_SERVER);
$mode = new App\Mode($basePath);
$configLoader = new Config\ConfigCacheLoader($basePath, $mode);
$configLoader = new Config\ConfigFileLoader($basePath, $mode);
$configCache = Factory\ConfigFactory::createCache($configLoader);
$profiler = Factory\ProfilerFactory::create($configCache);
Factory\DBFactory::init($basePath, $configCache, $profiler, $_SERVER);