MDL-52589 cache: Allow unused stores to be uninstalled

This commit is contained in:
Michael Aherne
2016-01-11 15:33:38 +00:00
committed by Dan Poltawski
parent 65e74ad477
commit cf9e808967
+8 -2
View File
@@ -26,11 +26,17 @@ namespace core\plugininfo;
defined('MOODLE_INTERNAL') || die();
/**
* Class for admin tool plugins
* Class for cache store plugins
*/
class cachestore extends base {
public function is_uninstall_allowed() {
return false;
$instance = \cache_config::instance();
foreach ($instance->get_all_stores() as $store) {
if ($store['plugin'] == $this->name) {
return false;
}
}
return true;
}
}