| @@ 208-220 (lines=13) @@ | ||
| 205 | * |
|
| 206 | * @param string $key The key of the object |
|
| 207 | */ |
|
| 208 | public function purge($key) {
|
|
| 209 | if ($this->log) {
|
|
| 210 | if ($this->log instanceof LoggerInterface) {
|
|
| 211 | $this->log->info("Purging key '{key}' from file cache.", array('key'=>$key));
|
|
| 212 | } else {
|
|
| 213 | $this->log->trace("Purging key '$key' from file cache.");
|
|
| 214 | } |
|
| 215 | } |
|
| 216 | $filename = $this->getFileName($key); |
|
| 217 | if (file_exists($filename)) {
|
|
| 218 | unlink($filename); |
|
| 219 | } |
|
| 220 | } |
|
| 221 | ||
| 222 | /** |
|
| 223 | * Removes all the objects from the cache. |
|
| @@ 172-184 (lines=13) @@ | ||
| 169 | * |
|
| 170 | * @param string $key The key of the object |
|
| 171 | */ |
|
| 172 | public function purge($key) {
|
|
| 173 | if ($this->log) {
|
|
| 174 | if ($this->log instanceof LoggerInterface) {
|
|
| 175 | $this->log->info("Purging key '{key}' from file cache.", array('key'=>$key));
|
|
| 176 | } else {
|
|
| 177 | $this->log->trace("Purging key '$key' from file cache.");
|
|
| 178 | } |
|
| 179 | } |
|
| 180 | $filename = $this->getFileName($key); |
|
| 181 | if (file_exists($filename)) {
|
|
| 182 | unlink($filename); |
|
| 183 | } |
|
| 184 | } |
|
| 185 | ||
| 186 | /** |
|
| 187 | * Removes all the objects from the cache. |
|