1 | <?php |
||
11 | class MemcachedStore extends LaravelMemcachedStore |
||
12 | { |
||
13 | /** |
||
14 | * Mcrouter config |
||
15 | * |
||
16 | * @var \Inspirum\Mcrouter\Model\Values\Mcrouter |
||
17 | */ |
||
18 | private $mcrouter; |
||
19 | |||
20 | /** |
||
21 | * Create a new Memcached store. |
||
22 | * |
||
23 | * @param \Memcached $memcached |
||
24 | * @param string $prefix |
||
25 | * @param \Inspirum\Mcrouter\Model\Values\Mcrouter|null $mcrouter |
||
26 | */ |
||
27 | 20 | public function __construct(Memcached $memcached, string $prefix = '', Mcrouter $mcrouter = null) |
|
33 | |||
34 | /** |
||
35 | * Begin executing a new tags operation. |
||
36 | * |
||
37 | * @param string|array<string> $names |
||
38 | * |
||
39 | * @return \Illuminate\Cache\TaggedCache |
||
40 | */ |
||
41 | 3 | public function tags($names) |
|
45 | |||
46 | /** |
||
47 | * Retrieve an item from the cache by key. |
||
48 | * |
||
49 | * @param string $key |
||
50 | * |
||
51 | * @return mixed |
||
52 | */ |
||
53 | 9 | public function get($key) |
|
63 | |||
64 | /** |
||
65 | * Retrieve multiple items from the cache by key. |
||
66 | * |
||
67 | * Items not found in the cache will have a null value. |
||
68 | * |
||
69 | * @param array<string> $keys |
||
70 | * |
||
71 | * @return array<string,mixed> |
||
72 | */ |
||
73 | 2 | public function many(array $keys) |
|
91 | |||
92 | /** |
||
93 | * Store an item in the cache for a given number of minutes. |
||
94 | * |
||
95 | * @param string $key |
||
96 | * @param mixed $value |
||
97 | * @param int $seconds |
||
98 | * |
||
99 | * @return bool |
||
100 | */ |
||
101 | 5 | public function put($key, $value, $seconds) |
|
105 | |||
106 | /** |
||
107 | * Store multiple items in the cache for a given number of minutes. |
||
108 | * |
||
109 | * @param array<string,mixed> $values |
||
110 | * @param int $seconds |
||
111 | * |
||
112 | * @return bool |
||
113 | */ |
||
114 | 1 | public function putMany(array $values, $seconds) |
|
124 | |||
125 | /** |
||
126 | * Store an item in the cache if the key doesn't exist. |
||
127 | * |
||
128 | * @param string $key |
||
129 | * @param mixed $value |
||
130 | * @param int $seconds |
||
131 | * |
||
132 | * @return bool |
||
133 | */ |
||
134 | 1 | public function add($key, $value, $seconds) |
|
138 | |||
139 | /** |
||
140 | * Increment the value of an item in the cache. |
||
141 | * |
||
142 | * @param string $key |
||
143 | * @param int $value |
||
144 | * |
||
145 | * @return int|bool |
||
146 | */ |
||
147 | 1 | public function increment($key, $value = 1) |
|
151 | |||
152 | /** |
||
153 | * Decrement the value of an item in the cache. |
||
154 | * |
||
155 | * @param string $key |
||
156 | * @param int $value |
||
157 | * |
||
158 | * @return int|bool |
||
159 | */ |
||
160 | 1 | public function decrement($key, $value = 1) |
|
164 | |||
165 | /** |
||
166 | * Remove an item from the cache. |
||
167 | * |
||
168 | * @param string $key |
||
169 | * |
||
170 | * @return bool |
||
171 | */ |
||
172 | 1 | public function forget($key) |
|
176 | |||
177 | /** |
||
178 | * Get the cache key prefix. |
||
179 | * |
||
180 | * @param string $key |
||
181 | * |
||
182 | * @return string |
||
183 | */ |
||
184 | 18 | protected function getPrefixedKey(string $key): string |
|
198 | } |
||
199 |