1 | <?php |
||
9 | final class PhpFileCacheDoctrineAdapter implements Cache |
||
10 | { |
||
11 | const MODE_VAR_EXPORT = CacheInterface::MODE_VAR_EXPORT; |
||
12 | const MODE_SERIALIZER = CacheInterface::MODE_SERIALIZER; |
||
13 | |||
14 | /** @var CacheInterface */ |
||
15 | protected $phpFileCache; |
||
16 | |||
17 | 6 | public function __construct(CacheInterface $phpFileCache) |
|
21 | |||
22 | /** |
||
23 | * Fetches an entry from the cache. |
||
24 | * |
||
25 | * @param string $id the id of the cache entry to fetch |
||
26 | * |
||
27 | * @return mixed the cached data or FALSE, if no cache entry exists for the given id |
||
28 | */ |
||
29 | 2 | public function fetch($id) |
|
37 | |||
38 | /** |
||
39 | * Tests if an entry exists in the cache. |
||
40 | * |
||
41 | * @param string $id the cache id of the entry to check for |
||
42 | * |
||
43 | * @return bool tRUE if a cache entry exists for the given cache id, FALSE otherwise |
||
44 | */ |
||
45 | 1 | public function contains($id) |
|
49 | |||
50 | /** |
||
51 | * Puts data into the cache. |
||
52 | * |
||
53 | * If a cache entry with the given id already exists, its data will be replaced. |
||
54 | * |
||
55 | * @param string $id the cache id |
||
56 | * @param mixed $data the cache entry/data |
||
57 | * @param int $lifeTime The lifetime in number of seconds for this cache entry. |
||
58 | * If zero (the default), the entry never expires (although it may be deleted from the cache |
||
59 | * to make place for other entries). |
||
60 | * |
||
61 | * @return bool tRUE if the entry was successfully stored in the cache, FALSE otherwise |
||
62 | */ |
||
63 | 1 | public function save($id, $data, $lifeTime = 0) |
|
67 | |||
68 | /** |
||
69 | * Deletes a cache entry. |
||
70 | * |
||
71 | * @param string $id the cache id |
||
72 | * |
||
73 | * @return bool TRUE if the cache entry was successfully deleted, FALSE otherwise. |
||
74 | * Deleting a non-existing entry is considered successful. |
||
75 | */ |
||
76 | 1 | public function delete($id) |
|
80 | |||
81 | /** |
||
82 | * Retrieves cached information from the data store. |
||
83 | * |
||
84 | * The server's statistics array has the following values: |
||
85 | * |
||
86 | * - <b>hits</b> |
||
87 | * Number of keys that have been requested and found present. |
||
88 | * |
||
89 | * - <b>misses</b> |
||
90 | * Number of items that have been requested and not found. |
||
91 | * |
||
92 | * - <b>uptime</b> |
||
93 | * Time that the server is running. |
||
94 | * |
||
95 | * - <b>memory_usage</b> |
||
96 | * Memory used by this server to store items. |
||
97 | * |
||
98 | * - <b>memory_available</b> |
||
99 | * Memory allowed to use for storage. |
||
100 | * |
||
101 | * @since 2.2 |
||
102 | * |
||
103 | * @return array|null an associative array with server's statistics if available, NULL otherwise |
||
104 | */ |
||
105 | 1 | public function getStats() |
|
113 | } |
||
114 |