Exemplo n.º 1
0
 /**
  * Get a CloudFront URL for an S3 key.
  *
  * @param $key
  *   The S3 object key.
  * @param int $expiry
  *   (optional) Expiry time for the URL, as a Unix timestamp.
  * @return \Guzzle\Http\Url
  *   The CloudFront URL.
  */
 protected function getCloudFrontUrl($key, $expiry = NULL)
 {
     // Real CloudFront credentials are required to test this, so we ignore
     // testing this.
     // @codeCoverageIgnoreStart
     $cf = $this->config->getCloudFront();
     $url = new Url('https', $this->config->getDomain());
     $url->setPath($key);
     $this->injectCname($url);
     $options = array('url' => (string) $url, 'expires' => $expiry);
     $url = Url::factory($cf->getSignedUrl($options));
     return $url;
     // @codeCoverageIgnoreEnd
 }