diff --git a/airtime_mvc/application/cloud_storage/Amazon_S3.php b/airtime_mvc/application/cloud_storage/Amazon_S3.php index b9e405032..8a7c3b387 100644 --- a/airtime_mvc/application/cloud_storage/Amazon_S3.php +++ b/airtime_mvc/application/cloud_storage/Amazon_S3.php @@ -6,13 +6,11 @@ class Amazon_S3 extends StorageBackend { private $zendServiceAmazonS3; - public function Amazon_S3() + public function Amazon_S3($securityCredentials) { - $CC_CONFIG = Config::getConfig(); - - $this->setBucket($CC_CONFIG['storage_backend']['bucket']); - $this->setAccessKey($CC_CONFIG['storage_backend']['api_key']); - $this->setSecretKey($CC_CONFIG['storage_backend']['api_key_secret']); + $this->setBucket($securityCredentials['bucket']); + $this->setAccessKey($securityCredentials['api_key']); + $this->setSecretKey($securityCredentials['api_key_secret']); $this->zendServiceAmazonS3 = new Zend_Service_Amazon_S3( $this->getAccessKey(), diff --git a/airtime_mvc/application/cloud_storage/ProxyStorageBackend.php b/airtime_mvc/application/cloud_storage/ProxyStorageBackend.php index db475c04a..78aeb1b35 100644 --- a/airtime_mvc/application/cloud_storage/ProxyStorageBackend.php +++ b/airtime_mvc/application/cloud_storage/ProxyStorageBackend.php @@ -18,7 +18,9 @@ class ProxyStorageBackend extends StorageBackend */ public function ProxyStorageBackend($storageBackend) { - $this->storageBackend = new $storageBackend(); + $CC_CONFIG = Config::getConfig(); + + $this->storageBackend = new $storageBackend($CC_CONFIG[$storageBackend]); } public function getAbsoluteFilePath($resourceId) diff --git a/airtime_mvc/application/configs/conf.php b/airtime_mvc/application/configs/conf.php index fda19171a..932834fe3 100644 --- a/airtime_mvc/application/configs/conf.php +++ b/airtime_mvc/application/configs/conf.php @@ -28,9 +28,11 @@ class Config { // Parse separate conf file for cloud storage values $cloudStorageConfig = isset($_SERVER['CLOUD_STORAGE_CONF']) ? $_SERVER['CLOUD_STORAGE_CONF'] : "/etc/airtime-saas/cloud_storage.conf"; $cloudStorageValues = parse_ini_file($cloudStorageConfig, true); - $currentStorageBackend = $cloudStorageValues['current_backend']['storage_backend']; - $CC_CONFIG['current_backend'] = $cloudStorageValues['current_backend']['storage_backend']; - $CC_CONFIG['storage_backend'] = $cloudStorageValues[$currentStorageBackend]; + + $supportedStorageBackends = array('amazon_S3'); + foreach ($supportedStorageBackends as $backend) { + $CC_CONFIG[$backend] = $cloudStorageValues[$backend]; + } $values = parse_ini_file($filename, true);