1: <?php
2: /**
3: * Created by PhpStorm.
4: * User: manus
5: * Date: 28/03/16
6: * Time: 13:15
7: */
8:
9: namespace GLFramework\Cache;
10:
11:
12: class MemoryCache extends Cache
13: {
14:
15: private $array = array();
16: public function connect($config = array())
17: {
18: // TODO: Implement connect() method.
19: return true;
20: }
21:
22: public function set($key, $value, $duration = null)
23: {
24: // TODO: Implement set() method.
25: $this->array[$key] = $value;
26: }
27:
28: public function get($key)
29: {
30: // TODO: Implement get() method.
31: return $this->array[$key];
32: }
33:
34: public function hash($key)
35: {
36: // TODO: Implement hash() method.
37: return isset($this->array[$key]);
38: }
39:
40: public function remove($key)
41: {
42: // TODO: Implement remove() method.
43: unset($this->array[$key]);
44: }
45: }