Skip to content

Commit a8ee9d6

Browse files
authored
Merge pull request #69 from catalyst/68-cache-definitions
Set STATE_INITIALISING before loading config #68
2 parents 57ee87b + 7d5aa48 commit a8ee9d6

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

classes/cache_factory.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@ public function create_config_instance($writer = false) {
5555

5656
if (!array_key_exists($class, $this->configs)) {
5757
// Create a new instance and call it to load it.
58+
// As part of generating store instance config we test the initialisation of stores.
59+
// Testing this may initialise DI, which will attempt to use cache for hookcallbacks.
60+
// Setting the state to initialising will make it use ad-hoc cache for that request.
61+
self::set_state(self::STATE_INITIALISING);
5862
$this->configs[$class] = new $class;
5963
$this->configs[$class]->load();
6064
}
@@ -67,7 +71,7 @@ public function create_config_instance($writer = false) {
6771
$this->set_state(self::STATE_STORES_DISABLED);
6872
} else {
6973
// We cannot directly set the state to enabled from disabled.
70-
// So we instead start and finish an update.
74+
// So we instead start and finish an update to set STATE_READY.
7175
$this->updating_started();
7276
$this->updating_finished();
7377
}

0 commit comments

Comments
 (0)