3 namespace Friendica\Core\Cache;
5 use Friendica\Core\Cache;
8 * Cache Driver Interface
10 * @author Hypolite Petovan <hypolite@mrpetovan.com>
12 interface ICacheDriver
15 * Lists all cache keys
17 * @param string prefix optional a prefix to search
19 * @return array Empty if it isn't supported by the cache driver
21 public function getAllKeys($prefix = null);
24 * Fetches cached data according to the key
26 * @param string $key The key to the cached data
28 * @return mixed Cached $value or "null" if not found
30 public function get($key);
33 * Stores data in the cache identified by the key. The input $value can have multiple formats.
35 * @param string $key The cache key
36 * @param mixed $value The value to store
37 * @param integer $ttl The cache lifespan, must be one of the Cache constants
41 public function set($key, $value, $ttl = Cache::FIVE_MINUTES);
44 * Delete a key from the cache
46 * @param string $key The cache key
50 public function delete($key);
53 * Remove outdated data from the cache
54 * @param boolean $outdated just remove outdated values
58 public function clear($outdated = true);