1 | <?php |
||
21 | class ApcCache extends AbstractCache |
||
22 | { |
||
23 | public function get($key) |
||
27 | |||
28 | /** |
||
29 | * @param string $timeout |
||
30 | */ |
||
31 | public function set($key, $value, $timeout) |
||
35 | |||
36 | /** |
||
37 | * @param string $timeout |
||
38 | */ |
||
39 | public function replace($key, $value, $timeout) |
||
40 | { |
||
41 | if(!apc_exists($key)) |
||
42 | return false; |
||
43 | apc_store($key, serialize($value), $timeout); |
||
44 | } |
||
45 | |||
46 | /** |
||
47 | * @param string $key |
||
48 | */ |
||
49 | public function delete($key) |
||
53 | |||
54 | public function increment($key, $step = 1, $timeout = 0) |
||
55 | { |
||
56 | apc_add($key, 0, $timeout); |
||
57 | return apc_inc($key, $step); |
||
58 | } |
||
59 | |||
60 | public function decrement($key, $step = 1, $timeout = 0) |
||
61 | { |
||
62 | apc_add($key, 0, $timeout); |
||
63 | return apc_dec($key, $step); |
||
64 | } |
||
65 | |||
66 | public function flush() |
||
70 | } |
||
71 |
Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a
@return
annotation as described here.