Total Complexity | 8 |
Total Lines | 36 |
Duplicated Lines | 0 % |
Coverage | 76.19% |
Changes | 0 |
1 | <?php |
||
11 | class Memcache { |
||
12 | |||
13 | static $memcache; |
||
14 | |||
15 | 2 | public function __construct() { |
|
16 | 2 | if (!self::$memcache) { |
|
17 | 1 | if (class_exists('\Memcached')) { |
|
18 | 1 | self::$memcache = new \Memcached; |
|
19 | 1 | self::$memcache->addServer('localhost', 11211); |
|
20 | } else { |
||
21 | self::$memcache = new \Memcache; |
||
22 | self::$memcache->connect('localhost', 11211); |
||
23 | } |
||
24 | } |
||
25 | 2 | } |
|
26 | |||
27 | 2 | public function set($key, $value, $timeout = 3600) { |
|
32 | } |
||
33 | 2 | } |
|
34 | |||
35 | 1 | public function get($key) { |
|
47 | } |
||
48 | } |
||
50 |