MDL-39312 cache: interfaces for managing lock instances.

Bug: There was no way to create an instance of a lock plugin for use
within Moodle.
Solution: Implemented management interfaces as part of cache/admin.php
to allow for instances to be added and deleted.
This was done in along the same lines of adding store instances.
This commit is contained in:
Sam Hemelryk
2013-04-30 16:26:34 +12:00
parent cf5a3296c4
commit acf49f4b9a
9 changed files with 323 additions and 10 deletions
+10
View File
@@ -541,6 +541,16 @@ class cache_config {
return $this->configlocks[$lock];
}
}
return $this->get_default_lock();
}
/**
* Gets the default lock instance.
*
* @return array
* @throws cache_exception
*/
public function get_default_lock() {
foreach ($this->configlocks as $lockconf) {
if (!empty($lockconf['default'])) {
return $lockconf;