for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
namespace yii\caching;
* ZendDataCache provides Zend data caching in terms of an application component.
*
* To use this application component, the [Zend Data Cache PHP extension](http://www.zend.com/en/products/server/)
* must be loaded.
* Application configuration example:
* ```php
* return [
* 'components' => [
* 'cache' => [
* 'class' => yii\caching\Cache::class,
* 'handler' => [
* 'class' => yii\caching\ZendDataCache::class,
* ],
* // ...
* ];
* ```
* See [[\Psr\SimpleCache\CacheInterface]] for common cache operations that ZendDataCache supports.
* For more details and usage information on Cache, see the [guide article on caching](guide:caching-overview).
* @author Qiang Xue <[email protected]>
* @since 2.0
class ZendDataCache extends SimpleCache
{
* {@inheritdoc}
protected function getValue($key)
$result = zend_shm_cache_fetch($key);
return $result === null ? false : $result;
}
protected function setValue($key, $value, $ttl)
return zend_shm_cache_store($key, $value, $ttl);
protected function deleteValue($key)
return zend_shm_cache_delete($key);
public function clear()
return zend_shm_cache_clear();