1 | <?php |
||
13 | class Files extends AbstractCache |
||
14 | { |
||
15 | /** |
||
16 | * Constructor. |
||
17 | * |
||
18 | * @param array $options Array of options. |
||
19 | */ |
||
20 | public function __construct(array $options=null) |
||
30 | |||
31 | /** |
||
32 | * Retrieves the cache content for the given key. |
||
33 | * |
||
34 | * @param string $key The cache key to retrieve. |
||
35 | * @return mixed|null Returns the cached data or null. |
||
36 | */ |
||
37 | public function loadKey($key) |
||
61 | |||
62 | /** |
||
63 | * Retrieves the cache keys for the given tag. |
||
64 | * |
||
65 | * @param string $tag The cache tag to retrieve. |
||
66 | * @return array|null Returns an array of cache keys or null. |
||
67 | */ |
||
68 | public function loadTag($tag) |
||
95 | |||
96 | /** |
||
97 | * Saves data to the cache. |
||
98 | * |
||
99 | * @param mixed $data The data to cache. |
||
100 | * @param string $key The cache id to save. |
||
101 | * @param array $tags The cache tags for this cache entry. |
||
102 | * @param int $ttl The time-to-live in seconds, if set to null the |
||
103 | * cache is valid forever. |
||
104 | * @return boolean Returns True on success or False on failure. |
||
105 | */ |
||
106 | public function save($data, $key, array $tags = null, $ttl = null) |
||
124 | |||
125 | /** |
||
126 | * Deletes the specified cache record. |
||
127 | * |
||
128 | * @param string $key The cache id to remove. |
||
129 | * @return boolean Returns True on success or False on failure. |
||
130 | */ |
||
131 | public function delete($key) |
||
141 | |||
142 | /** |
||
143 | * Removes all the cached entries associated with the given tag names. |
||
144 | * |
||
145 | * @param array $tags The array of tags to remove. |
||
146 | * @return boolean Returns True on success or False on failure. |
||
147 | */ |
||
148 | public function clean(array $tags) |
||
166 | |||
167 | /** |
||
168 | * Flush all the cached entries. |
||
169 | * |
||
170 | * @param boolean $all Wether to flush the whole database, or (preferably) |
||
171 | * the entries prefixed with prefix_key and prefix_tag. |
||
172 | * @return boolean Returns True on success or False on failure. |
||
173 | */ |
||
174 | public function flush($all = false) |
||
190 | |||
191 | /** |
||
192 | * Returns the time-to-live (in seconds) for the given key. |
||
193 | * |
||
194 | * @param string $key The name of the key. |
||
195 | * @return int|false Returns the number of seconds left, 0 if valid |
||
196 | * forever or False if the key is non-existant. |
||
197 | */ |
||
198 | public function getTtl($key) |
||
217 | } |