$this->configstores[$name]['lock'] = $configuration['lock'];
unset($this->configstores[$name]['configuration']['lock']);
}
+ // Call instance_created()
+ $store = new $class($name, $this->configstores[$name]['configuration']);
+ $store->instance_created();
+
$this->config_save();
return true;
}
throw new cache_exception('You cannot delete a cache store that has definition mappings.');
}
}
+
+ // Call instance_deleted()
+ $class = 'cachestore_'.$this->configstores[$name]['plugin'];
+ $store = new $class($name, $this->configstores[$name]['configuration']);
+ $store->instance_deleted();
+
unset($this->configstores[$name]);
$this->config_save();
return true;
* @param bool $coreonly If set to true only core definitions will be updated.
*/
public static function update_definitions($coreonly = false) {
- $config = self::instance();
+ $factory = cache_factory::instance();
+ $factory->updating_started();
+ $config = $factory->create_config_instance(true);
$config->write_definitions_to_cache(self::locate_definitions($coreonly));
+ $factory->updating_finished();
}
/**
array(
'text' => get_string('editmappings', 'cache'),
'url' => new moodle_url('/cache/admin.php', array('action' => 'editdefinitionmapping', 'sesskey' => sesskey()))
+ ),
+ array(
+ 'text' => get_string('purge', 'cache'),
+ 'url' => new moodle_url('/cache/admin.php', array('action' => 'purgedefinition', 'sesskey' => sesskey()))
)
);
}
}
$actions[] = array(
'text' => get_string('purge', 'cache'),
- 'url' => new moodle_url($baseurl, array('action' => 'purge'))
+ 'url' => new moodle_url($baseurl, array('action' => 'purgestore'))
);
}
return $actions;