You are here

protected function S3FileOriginLocator::getOriginalFileUrl in Acquia Content Hub 8.2

Returns the original file url from the current request.

Transforms the image style provided derivative url back to the original.

Parameters

string $uri: The uri to transform.

Return value

string The original url.

1 call to S3FileOriginLocator::getOriginalFileUrl()
S3FileOriginLocator::getS3FileSource in modules/acquia_contenthub_s3/src/S3FileOriginLocator.php
Returns the source of the s3 file.

File

modules/acquia_contenthub_s3/src/S3FileOriginLocator.php, line 165

Class

S3FileOriginLocator
Responsible for locating the s3 source of the given file url.

Namespace

Drupal\acquia_contenthub_s3

Code

protected function getOriginalFileUrl(string $uri) : string {
  $parts = explode('s3/', $uri);
  $transformed_uri = isset($parts[1]) ? $parts[1] : $parts[0];
  return "s3://{$transformed_uri}";
}