diff --git a/classes/cache_factory.php b/classes/cache_factory.php index 5f2466d..593afa7 100644 --- a/classes/cache_factory.php +++ b/classes/cache_factory.php @@ -55,6 +55,10 @@ public function create_config_instance($writer = false) { if (!array_key_exists($class, $this->configs)) { // Create a new instance and call it to load it. + // As part of generating store instance config we test the initialisation of stores. + // Testing this may initialise DI, which will attempt to use cache for hookcallbacks. + // Setting the state to initialising will make it use ad-hoc cache for that request. + self::set_state(self::STATE_INITIALISING); $this->configs[$class] = new $class; $this->configs[$class]->load(); } @@ -67,7 +71,7 @@ public function create_config_instance($writer = false) { $this->set_state(self::STATE_STORES_DISABLED); } else { // We cannot directly set the state to enabled from disabled. - // So we instead start and finish an update. + // So we instead start and finish an update to set STATE_READY. $this->updating_started(); $this->updating_finished(); }