1 | <?php |
||
11 | class CacheBridge implements CacheInterface |
||
12 | { |
||
13 | /** |
||
14 | * Fetches an entry from the cache. |
||
15 | * |
||
16 | * @param string $id The id of the cache entry to fetch. |
||
17 | * |
||
18 | * @return mixed The cached data or FALSE, if no cache entry exists for the given id. |
||
19 | */ |
||
20 | public function fetch($id) |
||
24 | |||
25 | /** |
||
26 | * Tests if an entry exists in the cache. |
||
27 | * |
||
28 | * @param string $id The cache id of the entry to check for. |
||
29 | * |
||
30 | * @return bool TRUE if a cache entry exists for the given cache id, FALSE otherwise. |
||
31 | */ |
||
32 | public function contains($id) |
||
36 | |||
37 | /** |
||
38 | * Puts data into the cache. |
||
39 | * |
||
40 | * If a cache entry with the given id already exists, its data will be replaced. |
||
41 | * |
||
42 | * @param string $id The cache id. |
||
43 | * @param mixed $data The cache entry/data. |
||
44 | * @param int $lifeTime The lifetime in number of seconds for this cache entry. |
||
45 | * If zero (the default), the entry never expires (although it may be deleted from the cache |
||
46 | * to make place for other entries). |
||
47 | * |
||
48 | * @return bool TRUE if the entry was successfully stored in the cache, FALSE otherwise. |
||
49 | */ |
||
50 | public function save($id, $data, $lifeTime = 0) |
||
58 | |||
59 | /** |
||
60 | * Deletes a cache entry. |
||
61 | * |
||
62 | * @param string $id The cache id. |
||
63 | * |
||
64 | * @return bool TRUE if the cache entry was successfully deleted, FALSE otherwise. |
||
65 | * Deleting a non-existing entry is considered successful. |
||
66 | */ |
||
67 | public function delete($id) |
||
71 | |||
72 | /** |
||
73 | * Retrieves cached information from the data store. |
||
74 | * |
||
75 | * @return array|null An associative array with server's statistics if available, NULL otherwise. |
||
76 | */ |
||
77 | public function getStats() |
||
80 | } |
||
81 |