1 | <?php |
||
21 | class Memcached extends Cache |
||
22 | { |
||
23 | /** |
||
24 | * The Memcached driver |
||
25 | * |
||
26 | * @var \Memcached |
||
27 | * @since 1.0 |
||
28 | */ |
||
29 | private $driver; |
||
30 | |||
31 | /** |
||
32 | * Constructor. |
||
33 | * |
||
34 | * @param \Memcached $memcached The Memcached driver being used for this pool |
||
35 | * @param array|\ArrayAccess $options An options array, or an object that implements \ArrayAccess |
||
36 | * |
||
37 | * @since 1.0 |
||
38 | * @throws \RuntimeException |
||
39 | */ |
||
40 | 10 | public function __construct(\Memcached $memcached, $options = []) |
|
47 | |||
48 | /** |
||
49 | * This will wipe out the entire cache's keys |
||
50 | * |
||
51 | * @return boolean The result of the clear operation. |
||
52 | * |
||
53 | * @since 1.0 |
||
54 | */ |
||
55 | 10 | public function clear() |
|
59 | |||
60 | /** |
||
61 | * Method to get a storage entry value from a key. |
||
62 | * |
||
63 | * @param string $key The storage entry identifier. |
||
64 | * |
||
65 | * @return CacheItemInterface |
||
66 | * |
||
67 | * @since 1.0 |
||
68 | */ |
||
69 | 5 | public function getItem($key) |
|
82 | |||
83 | /** |
||
84 | * Method to remove a storage entry for a key. |
||
85 | * |
||
86 | * @param string $key The storage entry identifier. |
||
87 | * |
||
88 | * @return boolean |
||
89 | * |
||
90 | * @since 1.0 |
||
91 | */ |
||
92 | 2 | public function deleteItem($key) |
|
108 | |||
109 | /** |
||
110 | * Persists a cache item immediately. |
||
111 | * |
||
112 | * @param CacheItemInterface $item The cache item to save. |
||
113 | * |
||
114 | * @return static The invoked object. |
||
115 | */ |
||
116 | 8 | public function save(CacheItemInterface $item) |
|
131 | |||
132 | /** |
||
133 | * Method to determine whether a storage entry has been set for a key. |
||
134 | * |
||
135 | * @param string $key The storage entry identifier. |
||
136 | * |
||
137 | * @return boolean |
||
138 | * |
||
139 | * @since 1.0 |
||
140 | */ |
||
141 | 4 | public function hasItem($key) |
|
147 | |||
148 | /** |
||
149 | * Test to see if the CacheItemPoolInterface is available |
||
150 | * |
||
151 | * @return boolean True on success, false otherwise |
||
152 | * |
||
153 | * @since __DEPLOY_VERSION__ |
||
154 | */ |
||
155 | 10 | public static function isSupported() |
|
163 | } |
||
164 |