| @@ 33-44 (lines=12) @@ | ||
| 30 | /** |
|
| 31 | * {@inheritdoc} |
|
| 32 | */ |
|
| 33 | public function add($key, $value, $ttl = 0) |
|
| 34 | { |
|
| 35 | $res = apc_add($key, $value, $ttl); |
|
| 36 | if ($this->ttlFix) { |
|
| 37 | unset($this->ttls[$key]); |
|
| 38 | // fixing ttl only if it is set |
|
| 39 | if ($res && $ttl) { |
|
| 40 | $this->ttls[$key] = microtime(true) + $ttl; |
|
| 41 | } |
|
| 42 | } |
|
| 43 | return $res; |
|
| 44 | } |
|
| 45 | ||
| 46 | /** |
|
| 47 | * {@inheritdoc} |
|
| @@ 49-61 (lines=13) @@ | ||
| 46 | /** |
|
| 47 | * {@inheritdoc} |
|
| 48 | */ |
|
| 49 | public function set($key, $value, $ttl = 0) |
|
| 50 | { |
|
| 51 | $res = apc_store($key, $value, $ttl); |
|
| 52 | if ($this->ttlFix) { |
|
| 53 | unset($this->ttls[$key]); |
|
| 54 | // fixing ttl only if it is set |
|
| 55 | if ($res && $ttl) { |
|
| 56 | $this->ttls[$key] = microtime(true) + $ttl; |
|
| 57 | } |
|
| 58 | } |
|
| 59 | ||
| 60 | return $res; |
|
| 61 | } |
|
| 62 | ||
| 63 | /** |
|
| 64 | * {@inheritdoc} |
|