From d9ffd8518acce98937759ac4be7cb2dd85ec0398 Mon Sep 17 00:00:00 2001 From: Michael Aherne Date: Tue, 22 Dec 2015 16:01:06 +0000 Subject: [PATCH] MDL-52589 cache: Allow unused stores to be uninstalled --- lib/classes/plugininfo/cachestore.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/classes/plugininfo/cachestore.php b/lib/classes/plugininfo/cachestore.php index cf3aeac6942..28cc82feb59 100644 --- a/lib/classes/plugininfo/cachestore.php +++ b/lib/classes/plugininfo/cachestore.php @@ -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; } }