/** * Set the keys to use when accessing SQS. * * @param string $access_key Set the default Access Key * @param string $secret_key Set the default Secret Key * @return void */ public static function setKeys($accessKey, $secretKey) { self::$_defaultAccessKey = $accessKey; self::$_defaultSecretKey = $secretKey; }
/** * 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) { if (!$region) { $region = self::$_defaultRegion; } else { // make rue the region is valid if (!empty($region) && !in_array(strtolower($region), self::$_validEc2Regions, true)) { throw new Zend_Service_Amazon_Exception('Invalid Amazon Ec2 Region'); } } $this->_region = $region; parent::__construct($accessKey, $secretKey); }