public function Redis_Cache_PhpRedis::get in Redis 7.3
Same name and namespace in other branches
- 7 lib/Redis/Cache/PhpRedis.php \Redis_Cache_PhpRedis::get()
- 7.2 lib/Redis/Cache/PhpRedis.php \Redis_Cache_PhpRedis::get()
File
- lib/
Redis/ Cache/ PhpRedis.php, line 44
Class
- Redis_Cache_PhpRedis
- Predis cache backend.
Code
public function get($id) {
$client = $this
->getClient();
$key = $this
->getKey($id);
$values = $client
->hgetall($key);
// Recent versions of PhpRedis will return the Redis instance
// instead of an empty array when the HGETALL target key does
// not exists. I see what you did there.
if (empty($values) || !is_array($values)) {
return false;
}
return $values;
}