1 | <?php |
||
12 | class MemcachedAdapter extends Adapter implements CacheAdapter |
||
13 | { |
||
14 | /** |
||
15 | * @var Memcached |
||
16 | */ |
||
17 | protected $memcached; |
||
18 | |||
19 | /** |
||
20 | * @param string $persistentId |
||
21 | * @param array $connections |
||
22 | * @param CacheAdapter $next |
||
23 | */ |
||
24 | public function __construct($persistentId, array $connections, CacheAdapter $next = null) |
||
29 | |||
30 | /** |
||
31 | * @param string $persistentId |
||
32 | * @param array $connections |
||
33 | * |
||
34 | * @codeCoverageIgnore |
||
35 | * @return Memcached |
||
36 | */ |
||
37 | protected function getMemcachedClient($persistentId, array $connections) |
||
41 | |||
42 | /** |
||
43 | * Get a value identified by $key. |
||
44 | * |
||
45 | * @param string $key |
||
46 | * |
||
47 | * @return mixed |
||
48 | */ |
||
49 | public function get($key) |
||
70 | |||
71 | /** |
||
72 | * Set a value identified by $key and with an optional $ttl. |
||
73 | * |
||
74 | * @param string $key |
||
75 | * @param mixed $value |
||
76 | * @param int $ttl |
||
77 | * |
||
78 | * @return $this |
||
79 | */ |
||
80 | public function set($key, $value, $ttl = 0) |
||
96 | |||
97 | /** |
||
98 | * Delete a value identified by $key. |
||
99 | * |
||
100 | * @param string $key |
||
101 | */ |
||
102 | public function delete($key) |
||
107 | |||
108 | /** |
||
109 | * Checks the availability of the cache service. |
||
110 | * |
||
111 | * @return bool |
||
112 | */ |
||
113 | public function isAvailable() |
||
118 | |||
119 | /** |
||
120 | * Clears all expired values from cache. |
||
121 | * |
||
122 | * @return mixed |
||
123 | */ |
||
124 | public function clear() |
||
128 | |||
129 | /** |
||
130 | * Clears all values from the cache. |
||
131 | * |
||
132 | * @return mixed |
||
133 | */ |
||
134 | public function drop() |
||
139 | } |
||
140 |