]> git.mxchange.org Git - friendica.git/blob - src/Core/Cache/ICacheDriver.php
old behaviour restored
[friendica.git] / src / Core / Cache / ICacheDriver.php
1 <?php
2
3 namespace Friendica\Core\Cache;
4
5 use Friendica\Core\Cache;
6
7 /**
8  * Cache Driver Interface
9  *
10  * @author Hypolite Petovan <mrpetovan@gmail.com>
11  */
12 interface ICacheDriver
13 {
14         /**
15          * Fetches cached data according to the key
16          *
17          * @param string $key The key to the cached data
18          *
19          * @return mixed Cached $value or "null" if not found
20          */
21         public function get($key);
22
23         /**
24          * Stores data in the cache identified by the key. The input $value can have multiple formats.
25          *
26          * @param string  $key      The cache key
27          * @param mixed   $value    The value to store
28          * @param integer $duration The cache lifespan, must be one of the Cache constants
29          *
30          * @return bool
31          */
32         public function set($key, $value, $duration = Cache::MONTH);
33
34
35         /**
36          * Delete a key from the cache
37          *
38          * @param string $key
39          *
40          * @return bool
41          */
42         public function delete($key);
43
44         /**
45          * Remove outdated data from the cache
46          *
47          * @return bool
48          */
49         public function clear();
50 }