| 38 | | public function __construct($awsAccessKeyId, $associateTag = null, $merchantId = null) |
|---|
| 39 | | { |
|---|
| 40 | | $params = array('AWSAccessKeyId' => $awsAccessKeyId, 'AssociateTag' => $associateTag, 'MerchantId' => $merchantId); |
|---|
| 41 | | |
|---|
| 42 | | $this->sfWSDL = new sfWSDL('AmazonECS', $this->wsdl, $params); |
|---|
| 43 | | |
|---|
| 44 | | $this->awsAccessKeyId = $awsAccessKeyId; |
|---|
| 45 | | $this->associateTag = $associateTag; |
|---|
| 46 | | $this->merchantId = $merchantId; |
|---|
| | 38 | public function __construct($awsAccessKeyId = null, $associateTag = null, $merchantId = null) |
|---|
| | 39 | { |
|---|
| | 40 | $args = $this->prepareArgs($awsAccessKeyId, $associateTag, $merchantId); |
|---|
| | 41 | |
|---|
| | 42 | $this->sfWSDL = new sfWSDL('AmazonECS', $this->wsdl, $args); |
|---|
| | 43 | |
|---|
| | 44 | $this->awsAccessKeyId = $args['AWSAccessKeyId']; |
|---|
| | 45 | $this->associateTag = $args['AssociateTag']; |
|---|
| | 46 | $this->merchantId = $args['MerchantId']; |
|---|
| | 47 | } |
|---|
| | 48 | |
|---|
| | 49 | public function prepareArgs($awsAccessKeyId, $associateTag, $merchantId) |
|---|
| | 50 | { |
|---|
| | 51 | if( !$awsAccessKeyId ) |
|---|
| | 52 | { |
|---|
| | 53 | $awsAccessKeyId = sfConfig::get('app_aws_access_key_id'); |
|---|
| | 54 | } |
|---|
| | 55 | |
|---|
| | 56 | if( !$associateTag ) |
|---|
| | 57 | { |
|---|
| | 58 | $associateTag = sfConfig::get('app_aws_associate_tag'); |
|---|
| | 59 | } |
|---|
| | 60 | |
|---|
| | 61 | if( !$merchantId ) |
|---|
| | 62 | { |
|---|
| | 63 | $merchantId = sfConfig::get('app_aws_merchant_id'); |
|---|
| | 64 | } |
|---|
| | 65 | |
|---|
| | 66 | if( !$awsAccessKeyId ) |
|---|
| | 67 | { |
|---|
| | 68 | throw new Exception('We could not find your AWSAccessKeyId. You must place a aws_access_key_id value in your app.yml or pass aws_access_key_id as a parameter to your api method, or pass it as the 3rd argument to the sfWSDL constructor.'); |
|---|
| | 69 | } |
|---|
| | 70 | |
|---|
| | 71 | return array('AWSAccessKeyId' => $awsAccessKeyId, 'AssociateTag' => $associateTag, 'MerchantId' => $merchantId); |
|---|