Extends
lithium\core\Object
Delete an entry from the cache.
Parameters
- string $key The key to uniquely identify the cached item.
Returns
closure Function returning boolean `true` on successful delete, `false` otherwise.Source
public function delete($key) {
$path = $this->_config['path'];
return function($self, $params) use (&$path) {
extract($params);
$path = "$path/$key";
$file = new SplFileInfo($path);
if ($file->isFile() && $file->isReadable()) {
return unlink($path);
}
return false;
};
}