1 | <?php |
||
23 | class ApcStorage extends AbstractStorage |
||
24 | { |
||
25 | /** |
||
26 | * ApcStorage constructor. |
||
27 | * |
||
28 | * @param DateInterval $ttl |
||
29 | * @throws CacheException |
||
30 | */ |
||
31 | public function __construct(DateInterval $ttl) |
||
41 | |||
42 | /** |
||
43 | * Determines whether an item is present in the cache. |
||
44 | * |
||
45 | * NOTE: It is recommended that has() is only to be used for cache warming type purposes |
||
46 | * and not to be used within your live applications operations for get/set, as this method |
||
47 | * is subject to a race condition where your has() will return true and immediately after, |
||
48 | * another script can remove it making the state of your app out of date. |
||
49 | * |
||
50 | * @param string $key The cache item key. |
||
51 | * |
||
52 | * @return bool |
||
53 | */ |
||
54 | public function has($key){ |
||
57 | |||
58 | /** |
||
59 | * Persists data in the cache, uniquely referenced by a key with an optional expiration TTL time. |
||
60 | * |
||
61 | * @param string $key The key of the item to store. |
||
62 | * @param mixed $value The value of the item to store, must be serializable. |
||
63 | * @param null|int $ttl Optional. The TTL value of this item. If no value is sent and |
||
64 | * the driver supports TTL then the library may set a default value |
||
65 | * for it or let the driver take care of that. |
||
66 | * |
||
67 | * @return bool True on success and false on failure. |
||
68 | */ |
||
69 | public function set($key, $value, $ttl = null) |
||
74 | |||
75 | /** |
||
76 | * Fetches a value from the cache. |
||
77 | * |
||
78 | * @param string $key The unique key of this item in the cache. |
||
79 | * |
||
80 | * @return mixed The value of the item from the cache, or $default in case of cache miss. |
||
81 | * |
||
82 | */ |
||
83 | public function get($key) |
||
87 | |||
88 | /** |
||
89 | * Delete an item from the cache by its unique key. |
||
90 | * |
||
91 | * @param string $key The unique cache key of the item to delete. |
||
92 | * |
||
93 | * @return bool True if the item was successfully removed. False if there was an error. |
||
94 | */ |
||
95 | public function delete($key) |
||
101 | |||
102 | /** |
||
103 | * Wipes clean the entire cache's keys. |
||
104 | * |
||
105 | * @return bool True on success and false on failure. |
||
106 | */ |
||
107 | public function clear(){ |
||
119 | |||
120 | /** |
||
121 | * Get APC status. |
||
122 | * |
||
123 | * @return array |
||
124 | */ |
||
125 | public function getInfo(){ |
||
128 | |||
129 | |||
130 | |||
131 | } |
||
132 |