1 | <?php |
||
20 | class NullStorage implements CacheStorageInterface |
||
21 | { |
||
22 | /** |
||
23 | * NullStorage constructor. |
||
24 | */ |
||
25 | public function __construct(){} |
||
26 | |||
27 | /** |
||
28 | * Persists data in the cache, uniquely referenced by a key with an optional expiration TTL time. |
||
29 | * |
||
30 | * @param string $key The key of the item to store. |
||
31 | * @param mixed $value The value of the item to store, must be serializable. |
||
32 | * @param null|int $ttl Optional. The TTL value of this item. If no value is sent and |
||
33 | * the driver supports TTL then the library may set a default value |
||
34 | * for it or let the driver take care of that. |
||
35 | * |
||
36 | * @return bool True on success and false on failure. |
||
37 | */ |
||
38 | 1 | public function set($key, $value, $ttl = null) |
|
42 | |||
43 | /** |
||
44 | * Fetches a value from the cache. |
||
45 | * |
||
46 | * @param string $key The unique key of this item in the cache. |
||
47 | * |
||
48 | * @return mixed The value of the item from the cache, or $default in case of cache miss. |
||
49 | * |
||
50 | */ |
||
51 | 1 | public function get($key){ |
|
54 | |||
55 | /** |
||
56 | * Determines whether an item is present in the cache. |
||
57 | * |
||
58 | * NOTE: It is recommended that has() is only to be used for cache warming type purposes |
||
59 | * and not to be used within your live applications operations for get/set, as this method |
||
60 | * is subject to a race condition where your has() will return true and immediately after, |
||
61 | * another script can remove it making the state of your app out of date. |
||
62 | * |
||
63 | * @param string $key The cache item key. |
||
64 | * |
||
65 | * @return bool |
||
66 | */ |
||
67 | 1 | public function has($key){ |
|
70 | |||
71 | /** |
||
72 | * Delete an item from the cache by its unique key. |
||
73 | * |
||
74 | * @param string $key The unique cache key of the item to delete. |
||
75 | * |
||
76 | * @return bool True if the item was successfully removed. False if there was an error. |
||
77 | */ |
||
78 | 1 | public function delete($key) |
|
82 | |||
83 | /** |
||
84 | * Wipes clean the entire cache's keys. |
||
85 | * |
||
86 | * @return bool True on success and false on failure. |
||
87 | */ |
||
88 | 1 | public function clear(){ |
|
91 | } |
||
92 |