class Redis_Cache in Redis 7.2
Same name and namespace in other branches
- 7.3 lib/Redis/Cache.php \Redis_Cache
Cache backend for Redis module.
Hierarchy
- class \Redis_Cache implements DrupalCacheInterface
Expanded class hierarchy of Redis_Cache
File
- lib/
Redis/ Cache.php, line 6
View source
class Redis_Cache implements DrupalCacheInterface {
/**
* @var DrupalCacheInterface
*/
protected $backend;
function __construct($bin) {
$className = Redis_Client::getClass(Redis_Client::REDIS_IMPL_CACHE);
$this->backend = new $className($bin);
}
function get($cid) {
return $this->backend
->get($cid);
}
function getMultiple(&$cids) {
return $this->backend
->getMultiple($cids);
}
function set($cid, $data, $expire = CACHE_PERMANENT) {
$this->backend
->set($cid, $data, $expire);
}
function clear($cid = NULL, $wildcard = FALSE) {
// This function also accepts arrays, thus handle everything like an array.
$cids = is_array($cid) ? $cid : array(
$cid,
);
foreach ($cids as $cid) {
$this->backend
->clear($cid, $wildcard);
}
}
function isEmpty() {
return $this->backend
->isEmpty();
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
Redis_Cache:: |
protected | property | ||
Redis_Cache:: |
function |
Expires data from the cache. Overrides DrupalCacheInterface:: |
||
Redis_Cache:: |
function |
Returns data from the persistent cache. Overrides DrupalCacheInterface:: |
||
Redis_Cache:: |
function |
Returns data from the persistent cache when given an array of cache IDs. Overrides DrupalCacheInterface:: |
||
Redis_Cache:: |
function |
Checks if a cache bin is empty. Overrides DrupalCacheInterface:: |
||
Redis_Cache:: |
function |
Stores data in the persistent cache. Overrides DrupalCacheInterface:: |
||
Redis_Cache:: |
function |