code cleanup

This commit is contained in:
drigato 2014-11-11 16:29:54 -05:00
parent dbc55632e1
commit 5cf5ff4fa1
3 changed files with 12 additions and 12 deletions

View File

@ -18,25 +18,26 @@ class Amazon_S3
private $zendServiceAmazonS3; private $zendServiceAmazonS3;
function Amazon_S3() function Amazon_S3()
{
$this->initZendServiceAmazonS3();
}
private function initZendServiceAmazonS3()
{ {
$CC_CONFIG = Config::getConfig(); $CC_CONFIG = Config::getConfig();
$this->setBucket($CC_CONFIG['cloud_storage']['bucket']); $this->setBucket($CC_CONFIG['cloud_storage']['bucket']);
$this->setAccessKey($CC_CONFIG['cloud_storage']['api_key']); $this->setAccessKey($CC_CONFIG['cloud_storage']['api_key']);
$this->setSecretKey($CC_CONFIG['cloud_storage']['api_key_secret']); $this->setSecretKey($CC_CONFIG['cloud_storage']['api_key_secret']);
$this->setZendServiceAmazonS3();
$this->zendServiceAmazonS3 = new Zend_Service_Amazon_S3(
$this->getAccessKey(),
$this->getSecretKey());
} }
public function getZendServiceAmazonS3() public function getZendServiceAmazonS3()
{ {
return $this->zendServiceAmazonS3; return $this->zendServiceAmazonS3;
}
private function setZendServiceAmazonS3()
{
$this->zendServiceAmazonS3 = new Zend_Service_Amazon_S3(
$this->getAccessKey(),
$this->getSecretKey());
} }
public function getBucket() public function getBucket()

View File

@ -26,7 +26,7 @@ class Config {
} }
// Parse separate conf file for Amazon S3 values // Parse separate conf file for Amazon S3 values
$amazonFilename = "/etc/airtime-saas/amazon.conf"; $amazonFilename = isset($_SERVER['AMAZONS3_CONF']) ? $_SERVER['AMAZONS3_CONF'] : "/etc/airtime-saas/amazon.conf";
$amazonValues = parse_ini_file($amazonFilename, true); $amazonValues = parse_ini_file($amazonFilename, true);
$CC_CONFIG['cloud_storage'] = $amazonValues['cloud_storage']; $CC_CONFIG['cloud_storage'] = $amazonValues['cloud_storage'];

View File

@ -362,8 +362,7 @@ class LibraryController extends Zend_Controller_Action
} catch (Exception $e) { } catch (Exception $e) {
//could throw a scheduled in future exception. //could throw a scheduled in future exception.
$message = _("Could not delete file(s)."); $message = _("Could not delete file(s).");
Logging::debug($e->getMessage()); Logging::info($message.": ".$e->getMessage());
Logging::info($e->getMessage());
} }
} }
} }