/** * @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']; }
/** * @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']; }
public function driverSet() { $config = new ConfigObject(['Bridge' => '\\Webiny\\Component\\Amazon\\Tests\\Mocks\\S3BridgeMock']); S3::setConfig($config); return [[new S3(false, false)]]; }