Total Complexity | 6 |
Total Lines | 58 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
5 | class MemcachedProvider implements ProviderInterface |
||
6 | { |
||
7 | /** |
||
8 | * @var \Memcached $_memcached |
||
9 | */ |
||
10 | private $_memcached; |
||
11 | |||
12 | /** |
||
13 | * @param $configuration |
||
14 | */ |
||
15 | public function configure($configuration) |
||
16 | { |
||
17 | $memcachedHost = $configuration['server']; |
||
18 | $memcachedPort = $configuration['port']; |
||
19 | |||
20 | $_memcached = new \Memcached(); |
||
21 | $_memcached->addServer($memcachedHost, $memcachedPort); |
||
22 | $this->_memcached = $_memcached; |
||
23 | } |
||
24 | |||
25 | /** |
||
26 | * @inheritdoc |
||
27 | */ |
||
28 | public function get($key) |
||
29 | { |
||
30 | return $this->_memcached->get($key); |
||
31 | } |
||
32 | |||
33 | /** |
||
34 | * @inheritdoc |
||
35 | */ |
||
36 | public function set($key, $expiresAt) |
||
39 | } |
||
40 | |||
41 | /** |
||
42 | * @inheritdoc |
||
43 | */ |
||
44 | public function remove($key) |
||
47 | } |
||
48 | |||
49 | /** |
||
50 | * @return array |
||
51 | */ |
||
52 | public function fetchAllItems() |
||
55 | } |
||
56 | |||
57 | /** |
||
58 | * @return int |
||
59 | */ |
||
60 | public function getItemsCount() |
||
63 | } |
||
64 | } |
||
65 |