本文整理汇总了PHP中Zend_Cache_Core::getBackend方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Cache_Core::getBackend方法的具体用法?PHP Zend_Cache_Core::getBackend怎么用?PHP Zend_Cache_Core::getBackend使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_Cache_Core
的用法示例。
在下文中一共展示了Zend_Cache_Core::getBackend方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _getTagSupportForCache
/**
* Internal method to check if the given cache supports tags
*
* @param Zend_Cache $cache
*/
private static function _getTagSupportForCache()
{
$backend = self::$_cache->getBackend();
if ($backend instanceof Zend_Cache_Backend_ExtendedInterface) {
$cacheOptions = $backend->getCapabilities();
self::$_cacheTags = $cacheOptions['tags'];
} else {
self::$_cacheTags = false;
}
return self::$_cacheTags;
}
示例2: _getBackendType
/**
* Get cache backend type
*
* @return string
*/
protected function _getBackendType()
{
$backendType = '';
if ($this->_frontend) {
$backend = $this->_frontend->getBackend();
$backendClass = get_class($backend);
$possibleCacheBackends = array('Zend_Cache_Backend_', 'Varien_Cache_Backend_');
foreach ($possibleCacheBackends as $backendClassStart) {
if (substr($backendClass, 0, strlen($backendClassStart)) == $backendClassStart) {
$backendType = substr($backendClass, strlen($backendClassStart));
break;
}
}
}
return $backendType;
}
示例3: getConfigCacheInfo
/**
* Returns cache information
*
* @return array
*/
public function getConfigCacheInfo()
{
$cacheConfig = $this->container->getParameter('shopware.cache');
if ($this->cache->getBackend() instanceof \Zend_Cache_Backend_Apc) {
$apcInfo = apc_cache_info('user');
$info['files'] = $apcInfo['num_entries'];
$info['size'] = $this->encodeSize($apcInfo['mem_size']);
} else {
if (!empty($cacheConfig['backendOptions']['cache_dir'])) {
$dir = $cacheConfig['backendOptions']['cache_dir'];
} elseif (!empty($cacheConfig['backendOptions']['slow_backend_options']['cache_dir'])) {
$dir = $cacheConfig['backendOptions']['slow_backend_options']['cache_dir'];
}
$info = $this->getDirectoryInfo($dir);
}
$info['name'] = 'Shopware configuration';
$backend = get_class($this->cache->getBackend());
$backend = str_replace('Zend_Cache_Backend_', '', $backend);
$info['backend'] = $backend;
return $info;
}
示例4: getBackend
/**
* {@inheritdoc}
*/
public function getBackend()
{
return $this->_frontend->getBackend();
}
示例5: getBackendAdapter
/**
* Returns the backend adapter
*
* @return \Zend_Cache_Backend
*/
public function getBackendAdapter()
{
return $this->cacheAdapter->getBackend();
}