상속: implements Webiny\Component\Amazon\S3\S3ClientInterface, use trait Webiny\Component\StdLib\ComponentTrait
예제 #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'];
 }
예제 #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'];
 }
예제 #3
0
 public function driverSet()
 {
     $config = new ConfigObject(['Bridge' => '\\Webiny\\Component\\Amazon\\Tests\\Mocks\\S3BridgeMock']);
     S3::setConfig($config);
     return [[new S3(false, false)]];
 }