本文整理匯總了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();
}