Merge branch 'wip-MDL-36363-m25' of https://github.com/samhemelryk/moodle
[moodle.git] / cache / locallib.php
index 02dd03e..ce926a5 100644 (file)
@@ -411,8 +411,11 @@ class cache_config_writer extends cache_config {
      * @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();
     }
 
     /**
@@ -705,6 +708,10 @@ abstract class cache_administration_helper extends cache_helper {
                 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()))
                 )
             );
         }
@@ -734,7 +741,7 @@ abstract class cache_administration_helper extends cache_helper {
             }
             $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;