1 | <?php |
||
30 | class Memcached extends KeyValueStorage |
||
31 | { |
||
32 | /** @var MemcachedExtension */ |
||
33 | protected $memcached; |
||
34 | |||
35 | /** |
||
36 | * @param MemcachedExtension $memcached |
||
37 | */ |
||
38 | public function __construct(MemcachedExtension $memcached, array $servers) |
||
42 | |||
43 | /** |
||
44 | * @param MemcachedExtension $memcached |
||
45 | * @param array $servers |
||
46 | * |
||
47 | * @return MemcachedExtension |
||
48 | */ |
||
49 | protected function connection(MemcachedExtension $memcached, array $servers) |
||
56 | |||
57 | |||
58 | /** |
||
59 | * Read values for a set of keys from cache |
||
60 | * |
||
61 | * @param array $keys list of keys to fetch |
||
62 | * |
||
63 | * @return array list of values with the given keys used as indexes |
||
64 | */ |
||
65 | protected function read(array $keys) |
||
76 | |||
77 | /** |
||
78 | * Save values for a set of keys to cache |
||
79 | * |
||
80 | * @param array $keys list of values to save |
||
81 | * @param int $expire expiration time |
||
82 | * |
||
83 | * @return bool true on success, false on failure |
||
84 | */ |
||
85 | protected function write(array $keys, $expire = null) |
||
93 | |||
94 | /** |
||
95 | * Remove values from cache |
||
96 | * |
||
97 | * @param array $keys list of keys to delete |
||
98 | * |
||
99 | * @return bool true on success, false on failure |
||
100 | */ |
||
101 | protected function delete(array $keys) |
||
109 | |||
110 | /** |
||
111 | * Remove *all* values from cache |
||
112 | * |
||
113 | * @return bool true on success, false on failure |
||
114 | */ |
||
115 | protected function purge() |
||
119 | } |
||
120 |