Test if an entry exists in the cache.
string $id cache id The cache id of the entry to check for.:
boolean TRUE if a cache entry exists for the given cache id, FALSE otherwise.
Overrides CacheProvider::doContains
protected function doContains($id) {
$lifetime = -1;
$filename = $this
->getFilename($id);
if (!file_exists($filename)) {
return false;
}
$resource = fopen($filename, "r");
if (false !== ($line = fgets($resource))) {
$lifetime = (int) $line;
}
fclose($resource);
return $lifetime === 0 || $lifetime > time();
}