Source of file PublicAdapter.php
Size: 0,891 Bytes - Last Modified: 2021-12-24T07:07:39+00:00
/var/www/docs.ssmods.com/process/src/src/Adapter/PublicAdapter.php
123456789101112131415161718192021222324252627282930313233 | <?php namespace SilverStripe\S3\Adapter; use Aws\S3\S3Client; use InvalidArgumentException; use League\Flysystem\AwsS3v3\AwsS3Adapter; use SilverStripe\Assets\Flysystem\PublicAdapter as SilverstripePublicAdapter; class PublicAdapter extends AwsS3Adapter implements SilverstripePublicAdapter { public function __construct(S3Client $client, $bucket, $prefix = '', array $options = []) { if (!$bucket) { throw new InvalidArgumentException("AWS_BUCKET_NAME environment variable not set"); } if (!$prefix) { $prefix = 'public'; } parent::__construct($client, $bucket, $prefix, $options); } /** * @param string $path * * @return string */ public function getPublicUrl($path) { return $this->getClient()->getObjectUrl($this->getBucket(), $this->applyPathPrefix($path)); } } |