You are here

public function video_amazon_s3::connect in Video 6.5

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

File

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

Class

video_amazon_s3

Code

public function connect($access_key = '', $secret_key = '', $ssl = FALSE) {
  $access_key = $access_key ? $access_key : $this->access_key;
  $secret_key = $secret_key ? $secret_key : $this->secret_key;
  $ssl = $ssl ? $ssl : $this->ssl;

  // Make our connection to Amazon.
  require_once $this->libfile;
  $credential = new stdClass();
  $credential->key = $access_key;
  $credential->secret = $secret_key;
  $credential->token = NULL;
  CFCredentials::set(array(
    $credential,
  ));
  $this->s3 = new AmazonS3();
  $this->s3->use_ssl = $ssl;
}