You are here

public function DrupalCacheAdapter::has in Flysystem 8

Same name and namespace in other branches
  1. 3.x src/Flysystem/Adapter/DrupalCacheAdapter.php \Drupal\flysystem\Flysystem\Adapter\DrupalCacheAdapter::has()
  2. 2.0.x src/Flysystem/Adapter/DrupalCacheAdapter.php \Drupal\flysystem\Flysystem\Adapter\DrupalCacheAdapter::has()
  3. 3.0.x src/Flysystem/Adapter/DrupalCacheAdapter.php \Drupal\flysystem\Flysystem\Adapter\DrupalCacheAdapter::has()

File

src/Flysystem/Adapter/DrupalCacheAdapter.php, line 175

Class

DrupalCacheAdapter
A Flysystem adapter implementing caching with Drupal's Cache API.

Namespace

Drupal\flysystem\Flysystem\Adapter

Code

public function has($path) {
  if ($this->cacheItemBackend
    ->has($path)) {
    return TRUE;
  }

  // Always check the upstream adapter for new files.
  // TODO: This could be a good place for a microcache?
  return $this->adapter
    ->has($path);
}