You are here

public function S3fsStreamWrapper::writeUriToCache in S3 File System 7.3

Same name and namespace in other branches
  1. 7.2 S3fsStreamWrapper.inc \S3fsStreamWrapper::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 S3fsStreamWrapper::writeUriToCache()
S3fsStreamWrapper::stream_flush in ./S3fsStreamWrapper.inc
Support for fflush(). Flush current cached stream data to a file in S3.

File

./S3fsStreamWrapper.inc, line 542
Drupal stream wrapper implementation for S3 File System.

Class

S3fsStreamWrapper
The stream wrapper class.

Code

public function writeUriToCache($uri) {
  if ($this
    ->waitUntilFileExists($uri)) {
    $metadata = $this
      ->_get_metadata_from_s3($uri);
    $this
      ->_write_cache($metadata);
    clearstatcache(TRUE, $uri);
  }
}