/**
  * @param string $path
  * @param array  $cfg
  * @throws Exception
  */
 public function __construct($path, array $cfg = array())
 {
     parent::__construct($path, $cfg);
     if (empty($cfg[self::CONTAINER])) {
         throw new Exception('RackspaceBucket: missing configuration key - ' . self::CONTAINER);
     }
     if (empty($cfg[self::REGION])) {
         throw new Exception('RackspaceBucket: missing configuration key - ' . self::REGION);
     }
     if (empty($cfg[self::USERNAME])) {
         throw new Exception('RackspaceBucket: missing configuration key - ' . self::USERNAME);
     }
     if (empty($cfg[self::API_KEY])) {
         throw new Exception('RackspaceBucket: missing configuration key - ' . self::API_KEY);
     }
     $this->containerName = $this->config[self::CONTAINER];
 }
 /**
  * @param string $path
  * @param array  $cfg
  * @throws Exception
  */
 public function __construct($path, array $cfg = array())
 {
     parent::__construct($path, $cfg);
     if (empty($cfg[self::CONTAINER])) {
         throw new Exception('S3Bucket: missing configuration key - ' . self::CONTAINER);
     }
     if (empty($cfg[self::REGION])) {
         throw new Exception('S3Bucket: missing configuration key - ' . self::REGION);
     }
     if (empty($cfg[self::API_KEY])) {
         throw new Exception('S3Bucket: missing configuration key - ' . self::API_KEY);
     }
     if (empty($cfg[self::API_SECRET])) {
         throw new Exception('S3Bucket: missing configuration key - ' . self::API_SECRET);
     }
     $this->containerName = $this->config[self::CONTAINER];
     $this->client = S3Client::factory(array('key' => $this->config[self::API_KEY], 'secret' => $this->config[self::API_SECRET], 'region' => $this->config[self::REGION]));
 }
 /**
  * @param string $path
  * @param array  $cfg
  * @throws Exception
  */
 public function __construct($path, array $cfg = array())
 {
     parent::__construct($path, $cfg);
     if (empty($cfg[self::CONTAINER])) {
         throw new Exception('S3Bucket: missing configuration key - ' . self::CONTAINER);
     }
     if (empty($cfg[self::REGION])) {
         throw new Exception('S3Bucket: missing configuration key - ' . self::REGION);
     }
     if (empty($cfg[self::USE_ROLE]) || $cfg[self::USE_ROLE] === false) {
         if (empty($cfg[self::API_KEY])) {
             throw new Exception('S3Bucket: missing configuration key - ' . self::API_KEY);
         }
         if (empty($cfg[self::API_SECRET])) {
             throw new Exception('S3Bucket: missing configuration key - ' . self::API_SECRET);
         }
     }
     $this->containerName = $this->config[self::CONTAINER];
     $this->client = new S3Client(array('key' => isset($this->config[self::API_KEY]) ? $this->config[self::API_KEY] : null, 'secret' => isset($this->config[self::API_SECRET]) ? $this->config[self::API_SECRET] : null, 'region' => $this->config[self::REGION], 'version' => '2006-03-01'));
 }