BugFix: forgot configCache in ConfigFactory

This commit is contained in:
Philipp Holzer 2019-07-12 23:05:48 +02:00
parent c82127ffb7
commit a30200083a
No known key found for this signature in database
GPG Key ID: D8365C3D36B77D90
5 changed files with 9 additions and 8 deletions

View File

@ -24,7 +24,7 @@ class ConfigFactory
}
/**
* @param Cache\ConfigCache $configCache The config cache of this adapter
* @param Cache\ConfigCache $configCache The config cache
*
* @return Config\Configuration
*/
@ -45,12 +45,13 @@ class ConfigFactory
}
/**
* @param Cache\PConfigCache $configCache The config cache of this adapter
* @param Cache\ConfigCache $configCache The config cache
* @param Cache\PConfigCache $pConfigCache The personal config cache
* @param int $uid The UID of the current user
*
* @return Config\PConfiguration
*/
public static function createPConfig(Cache\PConfigCache $configCache, $uid = null)
public static function createPConfig(Cache\ConfigCache $configCache, Cache\PConfigCache $pConfigCache, $uid = null)
{
if ($configCache->get('system', 'config_adapter') === 'preload') {
$configAdapter = new Adapter\PreloadPConfigAdapter($uid);
@ -58,7 +59,7 @@ class ConfigFactory
$configAdapter = new Adapter\JITPConfigAdapter();
}
$configuration = new Config\PConfiguration($configCache, $configAdapter);
$configuration = new Config\PConfiguration($pConfigCache, $configAdapter);
// Set the config in the static container for legacy usage
Core\PConfig::init($configuration);

View File

@ -33,7 +33,7 @@ class DependencyFactory
$database = Factory\DBFactory::init($configCache, $profiler, $_SERVER);
$config = Factory\ConfigFactory::createConfig($configCache);
// needed to call PConfig::init()
Factory\ConfigFactory::createPConfig(new PConfigCache());
Factory\ConfigFactory::createPConfig($configCache, new PConfigCache());
$logger = Factory\LoggerFactory::create($channel, $database, $config, $profiler);
Factory\LoggerFactory::createDev($channel, $config, $profiler);
$baseURL = new BaseURL($config, $_SERVER);

View File

@ -57,7 +57,7 @@ class ApiTest extends DatabaseTest
$profiler = Factory\ProfilerFactory::create($configCache);
$database = Factory\DBFactory::init($configCache, $profiler, $_SERVER);
$config = Factory\ConfigFactory::createConfig($configCache);
Factory\ConfigFactory::createPConfig(new Config\Cache\PConfigCache());
Factory\ConfigFactory::createPConfig($configCache, new Config\Cache\PConfigCache());
$logger = Factory\LoggerFactory::create('test', $database, $config, $profiler);
$baseUrl = new BaseURL($config, $_SERVER);
$this->app = new App($database, $config, $mode, $router, $baseUrl, $logger, $profiler, false);

View File

@ -22,7 +22,7 @@ class DBATest extends DatabaseTest
$profiler = Factory\ProfilerFactory::create($configCache);
$database = Factory\DBFactory::init($configCache, $profiler, $_SERVER);
$config = Factory\ConfigFactory::createConfig($configCache);
Factory\ConfigFactory::createPConfig(new Config\Cache\PConfigCache());
Factory\ConfigFactory::createPConfig($configCache, new Config\Cache\PConfigCache());
$logger = Factory\LoggerFactory::create('test', $database, $config, $profiler);
$baseUrl = new BaseURL($config, $_SERVER);
$this->app = new App($database, $config, $mode, $router, $baseUrl, $logger, $profiler, false);

View File

@ -23,7 +23,7 @@ class DBStructureTest extends DatabaseTest
$profiler = Factory\ProfilerFactory::create($configCache);
$database = Factory\DBFactory::init($configCache, $profiler, $_SERVER);
$config = Factory\ConfigFactory::createConfig($configCache);
Factory\ConfigFactory::createPConfig(new PConfigCache());
Factory\ConfigFactory::createPConfig($configCache, new PConfigCache());
$logger = Factory\LoggerFactory::create('test', $database, $config, $profiler);
$baseUrl = new BaseURL($config, $_SERVER);
$this->app = new App($database, $config, $mode, $router, $baseUrl, $logger, $profiler, false);