public function DrupalCacheAdapter::getMetadata in Flysystem 8
Same name and namespace in other branches
- 3.x src/Flysystem/Adapter/DrupalCacheAdapter.php \Drupal\flysystem\Flysystem\Adapter\DrupalCacheAdapter::getMetadata()
- 2.0.x src/Flysystem/Adapter/DrupalCacheAdapter.php \Drupal\flysystem\Flysystem\Adapter\DrupalCacheAdapter::getMetadata()
- 3.0.x src/Flysystem/Adapter/DrupalCacheAdapter.php \Drupal\flysystem\Flysystem\Adapter\DrupalCacheAdapter::getMetadata()
File
- src/
Flysystem/ Adapter/ DrupalCacheAdapter.php, line 212
Class
- DrupalCacheAdapter
- A Flysystem adapter implementing caching with Drupal's Cache API.
Namespace
Drupal\flysystem\Flysystem\AdapterCode
public function getMetadata($path) {
$item = $this->cacheItemBackend
->load($path);
if ($metadata = $item
->getMetadata()) {
return $metadata;
}
$metadata = $this->adapter
->getMetadata($path);
$item
->updateMetadata($metadata);
$this->cacheItemBackend
->set($path, $item);
return $metadata;
}