From a30200083a50c6b030d07d9efba6a6cfd201efc0 Mon Sep 17 00:00:00 2001 From: Philipp Holzer Date: Fri, 12 Jul 2019 23:05:48 +0200 Subject: [PATCH] BugFix: forgot configCache in ConfigFactory --- src/Factory/ConfigFactory.php | 9 +++++---- src/Factory/DependencyFactory.php | 2 +- tests/include/ApiTest.php | 2 +- tests/src/Database/DBATest.php | 2 +- tests/src/Database/DBStructureTest.php | 2 +- 5 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/Factory/ConfigFactory.php b/src/Factory/ConfigFactory.php index 3575ca63ea..7764d89900 100644 --- a/src/Factory/ConfigFactory.php +++ b/src/Factory/ConfigFactory.php @@ -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); diff --git a/src/Factory/DependencyFactory.php b/src/Factory/DependencyFactory.php index 607f34b9ee..656a255b2b 100644 --- a/src/Factory/DependencyFactory.php +++ b/src/Factory/DependencyFactory.php @@ -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); diff --git a/tests/include/ApiTest.php b/tests/include/ApiTest.php index fb4bb585f9..94557ac69c 100644 --- a/tests/include/ApiTest.php +++ b/tests/include/ApiTest.php @@ -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); diff --git a/tests/src/Database/DBATest.php b/tests/src/Database/DBATest.php index 912c7f0f43..84d17dc899 100644 --- a/tests/src/Database/DBATest.php +++ b/tests/src/Database/DBATest.php @@ -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); diff --git a/tests/src/Database/DBStructureTest.php b/tests/src/Database/DBStructureTest.php index 266bd98745..b005d8d53d 100644 --- a/tests/src/Database/DBStructureTest.php +++ b/tests/src/Database/DBStructureTest.php @@ -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); -- 2.39.5