|
|
@ -8,7 +8,7 @@ |
|
|
|
namespace yii\caching; |
|
|
|
namespace yii\caching; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* WinCache provides XCache caching in terms of an application component. |
|
|
|
* WinCache provides Windows Cache caching in terms of an application component. |
|
|
|
* |
|
|
|
* |
|
|
|
* To use this application component, the [WinCache PHP extension](http://www.iis.net/expand/wincacheforphp) |
|
|
|
* To use this application component, the [WinCache PHP extension](http://www.iis.net/expand/wincacheforphp) |
|
|
|
* must be loaded. Also note that "wincache.ucenabled" should be set to "On" in your php.ini file. |
|
|
|
* must be loaded. Also note that "wincache.ucenabled" should be set to "On" in your php.ini file. |
|
|
@ -21,6 +21,22 @@ namespace yii\caching; |
|
|
|
class WinCache extends Cache |
|
|
|
class WinCache extends Cache |
|
|
|
{ |
|
|
|
{ |
|
|
|
/** |
|
|
|
/** |
|
|
|
|
|
|
|
* Checks whether a specified key exists in the cache. |
|
|
|
|
|
|
|
* This can be faster than getting the value from the cache if the data is big. |
|
|
|
|
|
|
|
* Note that this method does not check whether the dependency associated |
|
|
|
|
|
|
|
* with the cached data, if there is any, has changed. So a call to [[get]] |
|
|
|
|
|
|
|
* may return false while exists returns true. |
|
|
|
|
|
|
|
* @param mixed $key a key identifying the cached value. This can be a simple string or |
|
|
|
|
|
|
|
* a complex data structure consisting of factors representing the key. |
|
|
|
|
|
|
|
* @return boolean true if a value exists in cache, false if the value is not in the cache or expired. |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
public function exists($key) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
$key = $this->buildKey($key); |
|
|
|
|
|
|
|
return wincache_ucache_exists($key); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
* Retrieves a value from cache with a specified key. |
|
|
|
* Retrieves a value from cache with a specified key. |
|
|
|
* This is the implementation of the method declared in the parent class. |
|
|
|
* This is the implementation of the method declared in the parent class. |
|
|
|
* @param string $key a unique key identifying the cached value |
|
|
|
* @param string $key a unique key identifying the cached value |
|
|
|