1 | <?php |
||
28 | class LegacyCouchbaseStore extends CouchbaseTaggableStore implements Store |
||
|
|||
29 | { |
||
30 | /** @var string */ |
||
31 | protected $prefix; |
||
32 | |||
33 | /** @var CouchbaseBucket */ |
||
34 | protected $bucket; |
||
35 | |||
36 | /** @var CouchbaseCluster */ |
||
37 | protected $cluster; |
||
38 | |||
39 | /** |
||
40 | * LegacyCouchbaseStore constructor. |
||
41 | * |
||
42 | * @param CouchbaseCluster $cluster |
||
43 | * @param $bucket |
||
44 | * @param string $password |
||
45 | * @param null $prefix |
||
46 | * @param string $serialize |
||
47 | */ |
||
48 | public function __construct(CouchbaseCluster $cluster, $bucket, $password = '', $prefix = null, $serialize = 'php') |
||
54 | |||
55 | /** |
||
56 | * {@inheritdoc} |
||
57 | */ |
||
58 | public function get($key) |
||
68 | |||
69 | /** |
||
70 | * Store an item in the cache if the key doesn't exist. |
||
71 | * |
||
72 | * @param string|array $key |
||
73 | * @param mixed $value |
||
74 | * @param int $minutes |
||
75 | * |
||
76 | * @return bool |
||
77 | */ |
||
78 | public function add($key, $value, $minutes = 0) |
||
89 | |||
90 | /** |
||
91 | * {@inheritdoc} |
||
92 | */ |
||
93 | public function put($key, $value, $minutes) |
||
97 | |||
98 | /** |
||
99 | * {@inheritdoc} |
||
100 | */ |
||
101 | public function increment($key, $value = 1) |
||
106 | |||
107 | /** |
||
108 | * {@inheritdoc} |
||
109 | */ |
||
110 | public function decrement($key, $value = 1) |
||
115 | |||
116 | /** |
||
117 | * {@inheritdoc} |
||
118 | */ |
||
119 | public function forever($key, $value) |
||
127 | |||
128 | /** |
||
129 | * {@inheritdoc} |
||
130 | */ |
||
131 | public function forget($key) |
||
139 | |||
140 | /** |
||
141 | * flush bucket. |
||
142 | * |
||
143 | * @throws FlushException |
||
144 | * @codeCoverageIgnore |
||
145 | */ |
||
146 | public function flush() |
||
153 | |||
154 | /** |
||
155 | * {@inheritdoc} |
||
156 | */ |
||
157 | public function getPrefix() |
||
161 | |||
162 | /** |
||
163 | * Set the cache key prefix. |
||
164 | * |
||
165 | * @param string $prefix |
||
166 | */ |
||
167 | public function setPrefix($prefix) |
||
171 | |||
172 | /** |
||
173 | * @param $bucket |
||
174 | * @param string $password |
||
175 | * @param string $serialize |
||
176 | * |
||
177 | * @return $this |
||
178 | */ |
||
179 | public function setBucket($bucket, $password = '', $serialize = 'php') |
||
188 | |||
189 | /** |
||
190 | * @param $keys |
||
191 | * |
||
192 | * @return array|string |
||
193 | */ |
||
194 | private function resolveKey($keys) |
||
207 | |||
208 | /** |
||
209 | * @param $meta |
||
210 | * |
||
211 | * @return array|null |
||
212 | */ |
||
213 | protected function getMetaDoc($meta) |
||
229 | } |
||
230 |