Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions classes/cache_factory.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,21 @@ public function create_config_instance($writer = false) {
}
}

$config = null;

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();
$config = new $class();
$config->load();

// Re-register after load in case anything reset $this->configs.
$this->configs[$class] = $config;
} else {
$config = $this->configs[$class];
}

// We need the siteid in order to use the caches, but the siteid
Expand All @@ -77,7 +84,7 @@ public function create_config_instance($writer = false) {
}

// Return the instance.
return $this->configs[$class];
return $config;
}

/**
Expand Down
6 changes: 3 additions & 3 deletions version.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@

defined('MOODLE_INTERNAL') || die();

$plugin->version = 2024093000;
$plugin->release = "2024093000";
$plugin->requires = 2024092700; // Requires 4.5.
$plugin->version = 2024093001;
$plugin->release = "2024093001";
$plugin->requires = 2024100700; // Requires 4.5.
$plugin->component = 'tool_forcedcache'; // Full name of the plugin (used for diagnostics).
$plugin->maturity = MATURITY_STABLE;
$plugin->supported = [405, 405];
Expand Down