PrivateS3fsStream.php in S3 File System 8.3
File
src/StreamWrapper/PrivateS3fsStream.php
View source
<?php
namespace Drupal\s3fs\StreamWrapper;
use Drupal\Core\Url;
class PrivateS3fsStream extends S3fsStream {
public function getName() {
return $this
->t('Private files (s3fs)');
}
public function getDescription() {
return $this
->t('Private files served from Amazon S3.');
}
public function getExternalUrl() {
$s3_key = str_replace('\\', '/', $this->streamWrapperManager::getTarget($this->uri));
return Url::fromRoute('system.private_file_download', [
'filepath' => $s3_key,
], [
'absolute' => TRUE,
'path_processing' => FALSE,
])
->toString();
}
}
Classes
Name |
Description |
PrivateS3fsStream |
Defines a Drupal s3fs stream wrapper class for use with private scheme. |