1 | <?php |
||
22 | class MemcachedBucketStore extends MemcachedStore |
||
23 | { |
||
24 | /** @var string[] */ |
||
25 | protected $servers; |
||
26 | |||
27 | /** @var array */ |
||
28 | protected $options = [ |
||
29 | CURLOPT_RETURNTRANSFER => false, |
||
30 | CURLOPT_SSL_VERIFYPEER => false, |
||
31 | ]; |
||
32 | |||
33 | /** @var int */ |
||
34 | protected $port = 8091; |
||
35 | |||
36 | /** @var int */ |
||
37 | protected $timeout = 1; |
||
38 | |||
39 | /** @var string */ |
||
40 | protected $flushEndpoint = ':%s/pools/default/buckets/%s/controller/doFlush'; |
||
41 | |||
42 | /** |
||
43 | * MemcachedBucketStore constructor. |
||
44 | * |
||
45 | * @param \Memcached $memcached |
||
46 | * @param string $prefix |
||
47 | * @param array $servers |
||
48 | */ |
||
49 | public function __construct($memcached, $prefix = '', array $servers) |
||
54 | |||
55 | /** |
||
56 | * Increment the value of an item in the cache. |
||
57 | * |
||
58 | * @param string $key |
||
59 | * @param mixed $value |
||
60 | * |
||
61 | * @return int|bool |
||
62 | */ |
||
63 | public function increment($key, $value = 1) |
||
75 | |||
76 | /** |
||
77 | * Decrement the value of an item in the cache. |
||
78 | * |
||
79 | * @param string $key |
||
80 | * @param mixed $value |
||
81 | * |
||
82 | * @return int|bool |
||
83 | */ |
||
84 | public function decrement($key, $value = 1) |
||
101 | |||
102 | /** |
||
103 | * {@inheritdoc} |
||
104 | */ |
||
105 | public function flush() |
||
123 | |||
124 | /** |
||
125 | * @param $handler |
||
126 | * |
||
127 | * @throws \RuntimeException |
||
128 | */ |
||
129 | protected function callMulti($handler) |
||
160 | |||
161 | /** |
||
162 | * @param int $second |
||
163 | */ |
||
164 | public function timeout($second) |
||
168 | |||
169 | /** |
||
170 | * @param int $port |
||
171 | */ |
||
172 | public function port($port) |
||
176 | } |
||
177 |