factory() public static method

See http://docs.aws.amazon.com/aws-sdk-php/v2/guide/configuration.html#client-configuration-options
public static factory ( array | Guzzle\Common\Collection $config = [] ) : self
$config array | Guzzle\Common\Collection Client configuration data
return self
 /**
  * @covers Aws\CloudWatchLogs\CloudWatchLogsClient::factory
  */
 public function testFactoryInitializesClient()
 {
     $client = CloudWatchLogsClient::factory(array('key' => 'foo', 'secret' => 'bar', 'region' => 'us-east-1'));
     $this->assertInstanceOf('Aws\\Common\\Signature\\SignatureV4', $client->getSignature());
     $this->assertInstanceOf('Aws\\Common\\Credentials\\Credentials', $client->getCredentials());
     $this->assertEquals('https://logs.us-east-1.amazonaws.com', $client->getBaseUrl());
 }
示例#2
0
 public function init()
 {
     $this->client = CloudWatchLogsClient::factory($this->awsArgs);
 }