You are here

public function S3fsStream::writeUriToCache in S3 File System 4.0.x

Same name and namespace in other branches
  1. 8.3 src/StreamWrapper/S3fsStream.php \Drupal\s3fs\StreamWrapper\S3fsStream::writeUriToCache()
  2. 8.2 src/StreamWrapper/S3fsStream.php \Drupal\s3fs\StreamWrapper\S3fsStream::writeUriToCache()

Write the file at the given URI into the metadata cache.

This function is public so that other code can upload files to S3 and then have us write the correct metadata into our cache.

1 call to S3fsStream::writeUriToCache()
S3fsStream::stream_flush in src/StreamWrapper/S3fsStream.php
Flushes the output.

File

src/StreamWrapper/S3fsStream.php, line 1177

Class

S3fsStream
Defines a Drupal s3 (s3://) stream wrapper class.

Namespace

Drupal\s3fs\StreamWrapper

Code

public function writeUriToCache($uri) {
  if ($this
    ->waitUntilFileExists($uri)) {
    $metadata = $this
      ->getS3Metadata($uri);
    if (!empty($metadata)) {
      $this
        ->writeCache($metadata);
      clearstatcache(TRUE, $uri);
    }
  }
}