public function S3fsStream::writeUriToCache in S3 File System 8.2
Same name and namespace in other branches
- 8.3 src/StreamWrapper/S3fsStream.php \Drupal\s3fs\StreamWrapper\S3fsStream::writeUriToCache()
- 4.0.x 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 - Support for fflush(). Flush current cached stream data to a file in S3.
File
- src/
StreamWrapper/ S3fsStream.php, line 1133
Class
- S3fsStream
- Defines a Drupal s3fs (s3fs://) stream wrapper class.
Namespace
Drupal\s3fs\StreamWrapperCode
public function writeUriToCache($uri) {
if (!$this
->waitUntilFileExists($uri)) {
throw new S3fsException($this
->t('The file at URI %file does not exist in S3.', [
'%file' => $uri,
]));
}
$metadata = $this
->_get_metadata_from_s3($uri);
$this
->_write_cache($metadata);
clearstatcache(TRUE, $uri);
}