public function S3fsStreamWrapper::writeUriToCache in S3 File System 7.2
Same name and namespace in other branches
- 7.3 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 511 - Drupal stream wrapper implementation for S3 File System.
Class
- S3fsStreamWrapper
- The stream wrapper class.
Code
public function writeUriToCache($uri) {
if (!$this
->waitUntilFileExists($uri)) {
throw new S3fsException(t('The file at URI %file does not exist in S3.', array(
'%file' => $uri,
)));
}
$metadata = $this
->_get_metadata_from_s3($uri);
$this
->_write_cache($metadata);
clearstatcache(TRUE, $uri);
}