MDL-37683 cache: siteidentifier is now included in the keys
Conflicts: lib/db/upgrade.php lib/moodlelib.php version.php
This commit is contained in:
Vendored
+20
@@ -71,6 +71,12 @@ class cache_config {
|
||||
*/
|
||||
protected $configlocks = array();
|
||||
|
||||
/**
|
||||
* The site identifier used when the cache config was last saved.
|
||||
* @var string
|
||||
*/
|
||||
protected $siteidentifier = null;
|
||||
|
||||
/**
|
||||
* Please use cache_config::instance to get an instance of the cache config that is ready to be used.
|
||||
*/
|
||||
@@ -139,6 +145,12 @@ class cache_config {
|
||||
$this->configdefinitionmappings = array();
|
||||
$this->configlockmappings = array();
|
||||
|
||||
$siteidentifier = 'unknown';
|
||||
if (array_key_exists('siteidentifier', $configuration)) {
|
||||
$siteidentifier = $configuration['siteidentifier'];
|
||||
}
|
||||
$this->siteidentifier = $siteidentifier;
|
||||
|
||||
// Filter the lock instances.
|
||||
$defaultlock = null;
|
||||
foreach ($configuration['locks'] as $conf) {
|
||||
@@ -271,6 +283,14 @@ class cache_config {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the site identifier used by the cache API.
|
||||
* @return string
|
||||
*/
|
||||
public function get_site_identifier() {
|
||||
return $this->siteidentifier;
|
||||
}
|
||||
|
||||
/**
|
||||
* Includes the configuration file and makes sure it contains the expected bits.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user