|
|
@@ -48,11 +48,6 @@ abstract class Zend_Service_Amazon_Abstract extends Zend_Service_Abstract
|
|
|
protected static $_defaultSecretKey = null;
|
|
|
|
|
|
/**
|
|
|
- * @var string Amazon Region
|
|
|
- */
|
|
|
- protected static $_defaultRegion = null;
|
|
|
-
|
|
|
- /**
|
|
|
* @var string Amazon Secret Key
|
|
|
*/
|
|
|
protected $_secretKey;
|
|
|
@@ -62,17 +57,6 @@ abstract class Zend_Service_Amazon_Abstract extends Zend_Service_Abstract
|
|
|
*/
|
|
|
protected $_accessKey;
|
|
|
|
|
|
- /**
|
|
|
- * @var string Amazon Region
|
|
|
- */
|
|
|
- protected $_region;
|
|
|
-
|
|
|
- /**
|
|
|
- * An array that contains all the valid Amazon Ec2 Regions.
|
|
|
- *
|
|
|
- * @var array
|
|
|
- */
|
|
|
- protected static $_validEc2Regions = array('eu-west-1', 'us-east-1');
|
|
|
|
|
|
/**
|
|
|
* Set the keys to use when accessing SQS.
|
|
|
@@ -88,30 +72,13 @@ abstract class Zend_Service_Amazon_Abstract extends Zend_Service_Abstract
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * Set which region you are working in. It will append the
|
|
|
- * end point automaticly
|
|
|
- *
|
|
|
- * @param string $region
|
|
|
- */
|
|
|
- public static function setRegion($region)
|
|
|
- {
|
|
|
- if(in_array(strtolower($region), self::$_validEc2Regions, true)) {
|
|
|
- self::$_defaultRegion = $region;
|
|
|
- } else {
|
|
|
- require_once 'Zend/Service/Amazon/Exception.php';
|
|
|
- throw new Zend_Service_Amazon_Exception('Invalid Amazon Ec2 Region');
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * Create Amazon Sqs client.
|
|
|
+ * Create Amazon client.
|
|
|
*
|
|
|
* @param string $access_key Override the default Access Key
|
|
|
* @param string $secret_key Override the default Secret Key
|
|
|
- * @param string $region Sets the AWS Region
|
|
|
* @return void
|
|
|
*/
|
|
|
- public function __construct($accessKey=null, $secretKey=null, $region=null)
|
|
|
+ public function __construct($accessKey=null, $secretKey=null)
|
|
|
{
|
|
|
if(!$accessKey) {
|
|
|
$accessKey = self::$_defaultAccessKey;
|
|
|
@@ -119,15 +86,6 @@ abstract class Zend_Service_Amazon_Abstract extends Zend_Service_Abstract
|
|
|
if(!$secretKey) {
|
|
|
$secretKey = self::$_defaultSecretKey;
|
|
|
}
|
|
|
- if(!$region) {
|
|
|
- $region = self::$_defaultRegion;
|
|
|
- } else {
|
|
|
- // make rue the region is valid
|
|
|
- if(!empty($region) && !in_array(strtolower($region), self::$_validEc2Regions, true)) {
|
|
|
- require_once 'Zend/Service/Amazon/Exception.php';
|
|
|
- throw new Zend_Service_Amazon_Exception('Invalid Amazon Ec2 Region');
|
|
|
- }
|
|
|
- }
|
|
|
|
|
|
if(!$accessKey || !$secretKey) {
|
|
|
require_once 'Zend/Service/Amazon/Exception.php';
|
|
|
@@ -135,18 +93,9 @@ abstract class Zend_Service_Amazon_Abstract extends Zend_Service_Abstract
|
|
|
}
|
|
|
$this->_accessKey = $accessKey;
|
|
|
$this->_secretKey = $secretKey;
|
|
|
- $this->_region = $region;
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * Method to fetch the AWS Region
|
|
|
- *
|
|
|
- * @return string
|
|
|
- */
|
|
|
- protected function _getRegion()
|
|
|
- {
|
|
|
- return (!empty($this->_region)) ? $this->_region . '.' : '';
|
|
|
- }
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* Method to fetch the Access Key
|