You are here

protected function S3fsStreamWrapper::_uri_to_s3_filename in S3 File System 7

Convert a URI into a valid S3 filename.

2 calls to S3fsStreamWrapper::_uri_to_s3_filename()
S3fsStreamWrapper::getExternalUrl in ./S3fsStreamWrapper.inc
Returns a web accessible URL for the resource.
S3fsStreamWrapper::_get_params in ./S3fsStreamWrapper.inc
Get the Command parameters for the specified URI.

File

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

Class

S3fsStreamWrapper
The stream wrapper class.

Code

protected function _uri_to_s3_filename($uri) {
  $filename = str_replace('s3://', '', $uri);

  // Remove both leading and trailing /s. S3 filenames never start with /,
  // and a $uri for a folder might be specified with a trailing /, which
  // we'd need to remove to be able to retrieve it from the cache.
  return trim($filename, '/');
}