3 namespace Friendica\Core\Cache;
5 use Friendica\Core\Cache;
8 * Cache Driver Interface
10 * @author Hypolite Petovan <mrpetovan@gmail.com>
12 interface ICacheDriver
15 * Fetches cached data according to the key
17 * @param string $key The key to the cached data
19 * @return mixed Cached $value or "null" if not found
21 public function get($key);
24 * Stores data in the cache identified by the key. The input $value can have multiple formats.
26 * @param string $key The cache key
27 * @param mixed $value The value to store
28 * @param integer $ttl The cache lifespan, must be one of the Cache constants
32 public function set($key, $value, $ttl = Cache::FIVE_MINUTES);
35 * Delete a key from the cache
37 * @param string $key The cache key
41 public function delete($key);
44 * Remove outdated data from the cache
45 * @param boolean $outdated just remove outdated values
49 public function clear($outdated = true);