本文整理汇总了PHP中JCache::_handler方法的典型用法代码示例。如果您正苦于以下问题:PHP JCache::_handler方法的具体用法?PHP JCache::_handler怎么用?PHP JCache::_handler使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JCache
的用法示例。
在下文中一共展示了JCache::_handler方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getCache
/**
* 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;
}
示例2: getCache
/**
* 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;
}