/** * Clean mr_cache */ public function cleancache_action() { global $CFG; $cache = new mr_cache(); $cache->clean(); $this->notify->good('cachecleaned'); return $this->output->single_button(new moodle_url("{$CFG->wwwroot}/{$CFG->admin}/settings.php?section=local_mr_cache"), get_string('continue')); }
public function test_cache_object() { if (!defined('MR_CACHE_TEST')) { return; } $cache = new mr_cache('test/mr/cache'); $object = new stdClass(); $object->foo = 'bar'; $object->bat = 'baz'; $this->assertTrue($cache->save($object, 'objectkey')); $this->assertIdentical($cache->load('objectkey', true), $object); $this->assertTrue($cache->clean()); }