1 | <?php |
||
15 | class Memory extends Storage |
||
16 | { |
||
17 | /** |
||
18 | * The in-memory array of cached items. |
||
19 | * |
||
20 | * @var array |
||
21 | */ |
||
22 | public $storage = array(); |
||
23 | |||
24 | /** |
||
25 | * Retrieve an item from the cache storage. |
||
26 | * |
||
27 | * @param string $key |
||
28 | * |
||
29 | * @return mixed|null |
||
30 | */ |
||
31 | protected function retrieve($key) |
||
39 | |||
40 | /** |
||
41 | * Write an item to the cache for a given number of minutes. |
||
42 | * |
||
43 | * <code> |
||
44 | * // Put an item in the cache for 15 minutes |
||
45 | * Cache::put('name', 'Robin', 15); |
||
46 | * </code> |
||
47 | * |
||
48 | * @param string $key |
||
49 | * @param mixed $value |
||
50 | * @param int $minutes |
||
51 | */ |
||
52 | public function put($key, $value, $minutes) |
||
56 | |||
57 | /** |
||
58 | * Write an item to the cache that lasts forever. |
||
59 | * |
||
60 | * @param $key |
||
61 | * @param $value |
||
62 | */ |
||
63 | public function forever($key, $value) |
||
67 | |||
68 | /** |
||
69 | * Delete an item from the cache. |
||
70 | * |
||
71 | * @param string $key |
||
72 | */ |
||
73 | public function forget($key) |
||
77 | |||
78 | /** |
||
79 | * Flush the entire cache. |
||
80 | */ |
||
81 | public function flush() |
||
85 | } |
||
86 |