You are here

public function video_amazon_s3::get_authenticated_url in Video 6.5

Same name and namespace in other branches
  1. 6.4 plugins/video_s3/video_s3.lib.inc \video_amazon_s3::get_authenticated_url()
1 call to video_amazon_s3::get_authenticated_url()
video_amazon_s3::getVideoUrl in plugins/video_s3/video_s3.lib.inc

File

plugins/video_s3/video_s3.lib.inc, line 147
Class file to handle amazon s3 transfers.

Class

video_amazon_s3

Code

public function get_authenticated_url($filepath, $bucket = NULL) {
  $lifetime = (int) variable_get('amazon_s3_lifetime', 1800);
  $bucket = $bucket == NULL ? $this->bucket : $bucket;
  $url = $this->s3
    ->get_object_url($bucket, $filepath, time() + $lifetime);
  if ($this->ssl) {
    $url = 'https://' . drupal_substr($url, 7);
  }
  return $url;
}