Inheritance: implements Webiny\Component\Amazon\S3\S3ClientInterface, use trait Webiny\Component\StdLib\ComponentTrait
Exemplo n.º 1
0
 /**
  * @inheritdoc
  */
 public function getURL($key)
 {
     if ($this->cdnDomain) {
         return $this->cdnDomain . '/' . $key;
     }
     if (!$this->arr($this->recentFiles)->keyExists($key)) {
         $this->recentFiles[$key]['ObjectURL'] = $this->s3Client->getObjectUrl($this->bucket, $key);
     }
     return $this->recentFiles[$key]['ObjectURL'];
 }
Exemplo n.º 2
0
 /**
  * @inheritdoc
  */
 public function getURL($key)
 {
     if (!$this->arr($this->recentFiles)->keyExists($key)) {
         $this->recentFiles[$key]['ObjectURL'] = $this->s3Client->getObjectUrl($this->bucket, $key);
     }
     if ($this->cdnDomain) {
         $objectUrl = $this->url($this->recentFiles[$key]['ObjectURL']);
         $cdnDomain = $this->url($this->cdnDomain);
         $objectUrl->setHost($cdnDomain->getHost())->setScheme($cdnDomain->getScheme());
         return $objectUrl->val();
     }
     return $this->recentFiles[$key]['ObjectURL'];
 }
Exemplo n.º 3
0
 public function driverSet()
 {
     $config = new ConfigObject(['Bridge' => '\\Webiny\\Component\\Amazon\\Tests\\Mocks\\S3BridgeMock']);
     S3::setConfig($config);
     return [[new S3(false, false)]];
 }