|
@@ 62-70 (lines=9) @@
|
| 59 |
|
* @param int $default IGNORED IN MEMCACHED. |
| 60 |
|
* @return mixed Description |
| 61 |
|
*/ |
| 62 |
|
public function get($key, $default = null) |
| 63 |
|
{ |
| 64 |
|
$this->lazyLoadRedisServer(); |
| 65 |
|
|
| 66 |
|
$value = $this->redis->get($this->fixKey($key)); |
| 67 |
|
$this->logger->info("[Redis Cache] Get '$key' result "); |
| 68 |
|
|
| 69 |
|
return ($value === false ? $default : unserialize($value)); |
| 70 |
|
} |
| 71 |
|
|
| 72 |
|
/** |
| 73 |
|
* @param string $key The object Key |
|
@@ 78-86 (lines=9) @@
|
| 75 |
|
* @param int $ttl The time to live in seconds of this objects |
| 76 |
|
* @return bool If the object is successfully posted |
| 77 |
|
*/ |
| 78 |
|
public function set($key, $value, $ttl = null) |
| 79 |
|
{ |
| 80 |
|
$this->lazyLoadRedisServer(); |
| 81 |
|
|
| 82 |
|
$this->redis->set($this->fixKey($key), serialize($value), $ttl); |
| 83 |
|
$this->logger->info("[Redis Cache] Set '$key' result "); |
| 84 |
|
|
| 85 |
|
return true; |
| 86 |
|
} |
| 87 |
|
|
| 88 |
|
public function delete($key) |
| 89 |
|
{ |