1 | <?php |
||
15 | class Apc extends Storage |
||
16 | { |
||
17 | /** |
||
18 | * The cache key from the cache configuration file. |
||
19 | * |
||
20 | * @var string |
||
21 | */ |
||
22 | protected $key; |
||
23 | |||
24 | /** |
||
25 | * Is APCu is supported. |
||
26 | * |
||
27 | * @var bool |
||
28 | */ |
||
29 | protected $apcu = false; |
||
30 | |||
31 | /** |
||
32 | * Create a new APC cache storage instance. |
||
33 | * |
||
34 | * @param string $key |
||
35 | */ |
||
36 | public function __construct($key) |
||
41 | |||
42 | /** |
||
43 | * Retrieve an item from the cache storage. |
||
44 | * |
||
45 | * @param string $key |
||
46 | * |
||
47 | * @return mixed |
||
48 | */ |
||
49 | protected function retrieve($key) |
||
57 | |||
58 | /** |
||
59 | * Write an item to the cache for a given number of minutes. |
||
60 | * |
||
61 | * <code> |
||
62 | * // Put an item in the cache for 15 minutes |
||
63 | * Cache::put('name', 'Robin', 15); |
||
64 | * </code> |
||
65 | * |
||
66 | * @param string $key |
||
67 | * @param mixed $value |
||
68 | * @param int $minutes |
||
69 | * |
||
70 | * @return bool |
||
71 | */ |
||
72 | public function put($key, $value, $minutes) |
||
79 | |||
80 | /** |
||
81 | * Write an item to the cache that lasts forever. |
||
82 | * |
||
83 | * @param string $key |
||
84 | * @param mixed $value |
||
85 | * |
||
86 | * @return boolean |
||
87 | */ |
||
88 | public function forever($key, $value) |
||
92 | |||
93 | /** |
||
94 | * Delete an item from the cache. |
||
95 | * |
||
96 | * @param string $key |
||
97 | * |
||
98 | * @return bool |
||
99 | */ |
||
100 | public function forget($key) |
||
104 | |||
105 | /** |
||
106 | * Remove all items from the cache. |
||
107 | * |
||
108 | * @return void |
||
109 | */ |
||
110 | public function flush() |
||
114 | } |
||
115 |