protected function cleanCache($group = null, $client_id = 0) { // Initialise variables; $conf = MFactory::getConfig(); $dispatcher = MDispatcher::getInstance(); $options = array('defaultgroup' => $group ? $group : (isset($this->option) ? $this->option : MRequest::getCmd('option')), 'cachebase' => MPATH_CACHE); $cache = MCache::getInstance('callback', $options); $cache->clean(); // Trigger the onContentCleanCache event. $dispatcher->trigger($this->event_clean_cache, $options); }
public static function getCache($group = '', $handler = 'callback', $storage = null) { $hash = md5($group . $handler . $storage); if (isset(self::$cache[$hash])) { return self::$cache[$hash]; } $handler = $handler == 'function' ? 'callback' : $handler; $options = array('defaultgroup' => $group); if (isset($storage)) { $options['storage'] = $storage; } $cache = MCache::getInstance($handler, $options); self::$cache[$hash] = $cache; return self::$cache[$hash]; }
protected function cleanCache($group = null, $client_id = 0) { $conf = MFactory::getConfig(); $dispatcher = MEventDispatcher::getInstance(); $options = array('defaultgroup' => $group ? $group : (isset($this->option) ? $this->option : MFactory::getApplication()->input->get('option')), 'cachebase' => $client_id ? MPATH_ADMINISTRATOR . '/cache' : $conf->get('cache_path', MPATH_SITE . '/cache')); $cache = MCache::getInstance('callback', $options); $cache->clean(); // Trigger the onContentCleanCache event. $dispatcher->trigger($this->event_clean_cache, $options); }