MDL-39430 cache: gets purged by force during upgrade and install

This commit is contained in:
Sam Hemelryk
2013-05-09 10:42:21 +12:00
parent c6ec9309fa
commit b0dd08dd63
7 changed files with 52 additions and 26 deletions
+10 -2
View File
@@ -396,10 +396,18 @@ class cache_config {
* @param string $storename
* @return array Associative array of definitions, id=>definition
*/
public static function get_definitions_by_store($storename) {
public function get_definitions_by_store($storename) {
$definitions = array();
$config = cache_config::instance();
// This function was accidentally made static at some stage in the past.
// It was converted to an instance method but to be backwards compatible
// we must step around this in code.
if (!isset($this)) {
$config = cache_config::instance();
} else {
$config = $this;
}
$stores = $config->get_all_stores();
if (!array_key_exists($storename, $stores)) {
// The store does not exist.