public function ExpiringCache::has

Checks if the cache has a value for a key.

Parameters

string $key A unique key:

Return value

Boolean Whether the cache has a value for this key

Overrides CacheInterface::has

File

drupal/core/vendor/kriswallsmith/assetic/src/Assetic/Cache/ExpiringCache.php, line 30

Class

ExpiringCache
Adds expiration to a cache backend.

Namespace

Assetic\Cache

Code

public function has($key) {
  if ($this->cache
    ->has($key)) {
    if (time() < $this->cache
      ->get($key . '.expires')) {
      return true;
    }
    $this->cache
      ->remove($key . '.expires');
    $this->cache
      ->remove($key);
  }
  return false;
}