From 8ecf3673561b324c9a8c6194f1df21c22455c3af Mon Sep 17 00:00:00 2001 From: Flavio Copes Date: Sat, 28 Jan 2017 19:09:30 +0100 Subject: [PATCH] Add method to clear the media cache --- classes/adminbasecontroller.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/classes/adminbasecontroller.php b/classes/adminbasecontroller.php index e52082dc..f6604647 100644 --- a/classes/adminbasecontroller.php +++ b/classes/adminbasecontroller.php @@ -924,6 +924,20 @@ class AdminBaseController } } + /** + * Handles clearing the media cache + * + * @return bool True if the action was performed + */ + protected function clearMediaCache() + { + $key = 'media-manager-files'; + $cache = $this->grav['cache']; + $cache->delete(md5($key)); + + return true; + } + /** * Determine if the user can edit media *