1 | <?php |
||
25 | class CouchbaseStore extends TaggableStore implements Store |
||
26 | { |
||
27 | use RetrievesMultipleKeys; |
||
28 | |||
29 | /** @var string */ |
||
30 | protected $prefix; |
||
31 | |||
32 | /** @var CouchbaseBucket */ |
||
33 | protected $bucket; |
||
34 | |||
35 | /** @var CouchbaseCluster */ |
||
36 | protected $cluster; |
||
37 | |||
38 | /** |
||
39 | * CouchbaseStore constructor. |
||
40 | * |
||
41 | * @param CouchbaseCluster $cluster |
||
42 | * @param $bucket |
||
43 | * @param string $password |
||
44 | * @param null $prefix |
||
45 | * @param string $serialize |
||
46 | */ |
||
47 | 13 | public function __construct(CouchbaseCluster $cluster, $bucket, $password = '', $prefix = null, $serialize = 'php') |
|
53 | |||
54 | /** |
||
55 | * {@inheritdoc} |
||
56 | */ |
||
57 | 6 | public function get($key) |
|
67 | |||
68 | /** |
||
69 | * Store an item in the cache if the key doesn't exist. |
||
70 | * |
||
71 | * @param string|array $key |
||
72 | * @param mixed $value |
||
73 | * @param int $minutes |
||
74 | * |
||
75 | * @return bool |
||
76 | */ |
||
77 | 5 | public function add($key, $value, $minutes = 0) |
|
88 | |||
89 | /** |
||
90 | * {@inheritdoc} |
||
91 | */ |
||
92 | 1 | public function put($key, $value, $minutes) |
|
96 | |||
97 | /** |
||
98 | * {@inheritdoc} |
||
99 | */ |
||
100 | 1 | public function increment($key, $value = 1) |
|
105 | |||
106 | /** |
||
107 | * {@inheritdoc} |
||
108 | */ |
||
109 | 1 | public function decrement($key, $value = 1) |
|
114 | |||
115 | /** |
||
116 | * {@inheritdoc} |
||
117 | */ |
||
118 | public function forever($key, $value) |
||
122 | |||
123 | /** |
||
124 | * {@inheritdoc} |
||
125 | */ |
||
126 | 8 | public function forget($key) |
|
131 | |||
132 | /** |
||
133 | * flush bucket. |
||
134 | * |
||
135 | * @throws FlushException |
||
136 | * @codeCoverageIgnore |
||
137 | */ |
||
138 | public function flush() |
||
145 | |||
146 | /** |
||
147 | * {@inheritdoc} |
||
148 | */ |
||
149 | 1 | public function getPrefix() |
|
153 | |||
154 | /** |
||
155 | * Set the cache key prefix. |
||
156 | * |
||
157 | * @param string $prefix |
||
158 | */ |
||
159 | 13 | public function setPrefix($prefix) |
|
163 | |||
164 | /** |
||
165 | * @param $bucket |
||
166 | * @param string $password |
||
167 | * @param string $serialize |
||
168 | * |
||
169 | * @return $this |
||
170 | */ |
||
171 | 13 | public function setBucket($bucket, $password = '', $serialize = 'php') |
|
179 | |||
180 | /** |
||
181 | * @param $keys |
||
182 | * |
||
183 | * @return array|string |
||
184 | */ |
||
185 | 9 | private function resolveKey($keys) |
|
198 | |||
199 | /** |
||
200 | * @param $meta |
||
201 | * |
||
202 | * @return array|null |
||
203 | */ |
||
204 | 5 | protected function getMetaDoc($meta) |
|
220 | } |
||
221 |