/** * Method to get cache instance * * @return object */ public function getCache($path = '') { $conf = JFactory::getConfig(); $options = array('defaultgroup' => '', 'storage' => $conf->get('cache_handler', ''), 'caching' => true, 'cachebase' => $path); jimport('joomla.cache.cache'); // We need to clear the previously used cache handlers, otherwise backend cachebase can't be used JCache::$_handler = array(); $cache = JCache::getInstance('', $options); return $cache; }
/** * Method to get cache instance * * @return object */ public function getCache() { $conf = JFactory::getConfig(); $options = array('defaultgroup' => '', 'storage' => $conf->get('cache_handler', ''), 'caching' => true, 'cachebase' => $this->getState('clientId') == 1 ? JPATH_ADMINISTRATOR . DS . 'cache' : $conf->get('cache_path', JPATH_SITE . DS . 'cache')); jimport('joomla.cache.cache'); // We need to clear the previously used cache handlers, otherwise backend cachebase can't be used JCache::$_handler = array(); $cache = JCache::getInstance('', $options); return $cache; }