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:
Sam Hemelryk
2013-02-18 08:30:29 +13:00
parent 09de5eb3de
commit a2b5f389de
10 changed files with 106 additions and 10 deletions
+20
View File
@@ -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.
*