• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Client\ClientBuilder类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中Aws\Common\Client\ClientBuilder的典型用法代码示例。如果您正苦于以下问题:PHP ClientBuilder类的具体用法?PHP ClientBuilder怎么用?PHP ClientBuilder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了ClientBuilder类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: factory

 /**
  * Factory method to create a new Amazon STS client using an array of configuration options:
  *
  * @param array|Collection $config Client configuration data
  *
  * @return self
  * @throws InvalidArgumentException
  * @link http://docs.aws.amazon.com/aws-sdk-php/guide/latest/configuration.html#client-configuration-options
  */
 public static function factory($config = array())
 {
     // Always need long term credentials
     if (!isset($config[Options::CREDENTIALS]) && isset($config[Options::TOKEN])) {
         throw new InvalidArgumentException('You must use long-term credentials with Amazon STS');
     }
     // Construct the STS client with the client builder
     $client = ClientBuilder::factory(__NAMESPACE__)->setConfig($config)->setConfigDefaults(array(Options::VERSION => self::LATEST_API_VERSION, Options::SERVICE_DESCRIPTION => __DIR__ . '/Resources/sts-%s.php'))->build();
     // Attach a listener to prevent AssumeRoleWithWebIdentity requests from being signed
     $client->getEventDispatcher()->addListener('command.before_send', function (Event $event) {
         /** @var AbstractCommand $command */
         $command = $event['command'];
         if ($command->getName() === 'AssumeRoleWithWebIdentity') {
             /** @var EventDispatcher $dispatcher */
             $dispatcher = $command->getRequest()->getEventDispatcher();
             foreach ($dispatcher->getListeners('request.before_send') as $listener) {
                 if (is_array($listener) && $listener[0] instanceof SignatureListener) {
                     $dispatcher->removeListener('request.before_send', $listener);
                     break;
                 }
             }
         }
     });
     return $client;
 }
开发者ID:NeilBryant,项目名称:webpagetest,代码行数:34,代码来源:StsClient.php


示例2: factory

 /**
  * Factory method to create a new Amazon Simple Queue Service client using an array of configuration options.
  *
  * @param array|Collection $config Client configuration data
  *
  * @return self
  * @see \Aws\Common\Client\DefaultClient for a list of available configuration options
  */
 public static function factory($config = array())
 {
     $client = ClientBuilder::factory(__NAMESPACE__)->setConfig($config)->setConfigDefaults(array(Options::VERSION => self::LATEST_API_VERSION, Options::SERVICE_DESCRIPTION => __DIR__ . '/Resources/sqs-%s.php'))->build();
     $client->addSubscriber(new QueueUrlListener());
     $client->addSubscriber(new Md5ValidatorListener());
     return $client;
 }
开发者ID:datianshi,项目名称:Drupal,代码行数:15,代码来源:SqsClient.php


示例3: factory

 /**
  * Factory method to create a new Amazon CloudFront client using an array of configuration options.
  *
  * CloudFront specific options (in addition to the default client configuration options):
  * - key_pair_id: The ID of the key pair used to sign CloudFront URLs for private distributions.
  * - private_key: The filepath ot the private key used to sign CloudFront URLs for private distributions.
  *
  * @param array|Collection $config Client configuration data
  *
  * @return self
  * @link http://docs.aws.amazon.com/aws-sdk-php/v2/guide/configuration.html#client-configuration-options
  */
 public static function factory($config = array())
 {
     // Decide which signature to use
     if (isset($config[Options::VERSION]) && $config[Options::VERSION] < self::LATEST_API_VERSION) {
         $config[Options::SIGNATURE] = new CloudFrontSignature();
     }
     // Instantiate the CloudFront client
     return ClientBuilder::factory(__NAMESPACE__)->setConfig($config)->setConfigDefaults(array(Options::VERSION => self::LATEST_API_VERSION, Options::SERVICE_DESCRIPTION => __DIR__ . '/Resources/cloudfront-%s.php'))->setExceptionParser(new DefaultXmlExceptionParser())->build();
 }
开发者ID:willyvidable,项目名称:Wordpress_4_4,代码行数:21,代码来源:CloudFrontClient.php


示例4: factory

 /**
  * Factory method to create a new Amazon DynamoDB Streams client using an array of configuration options.
  *
  * See http://docs.aws.amazon.com/aws-sdk-php/v2/guide/configuration.html#client-configuration-options
  *
  * @param array|Collection $config Client configuration data
  *
  * @return self
  * @link http://docs.aws.amazon.com/aws-sdk-php/v2/guide/configuration.html#client-configuration-options
  */
 public static function factory($config = array())
 {
     // Configure the custom exponential backoff plugin for DynamoDB throttling
     $exceptionParser = new JsonQueryExceptionParser();
     if (!isset($config[Options::BACKOFF])) {
         $config[Options::BACKOFF] = new BackoffPlugin(DynamoDbClient::createDynamoDbBackoffStrategy($exceptionParser));
     }
     return ClientBuilder::factory(__NAMESPACE__)->setConfig($config)->setConfigDefaults(array(Options::VERSION => self::LATEST_API_VERSION, Options::SERVICE_DESCRIPTION => __DIR__ . '/Resources/dynamodbstreams-%s.php'))->setExceptionParser($exceptionParser)->build();
 }
开发者ID:willyvidable,项目名称:Wordpress_4_4,代码行数:19,代码来源:DynamoDbStreamsClient.php


示例5: factory

 /**
  * Factory method to create a new Amazon CloudFront client using an array of configuration options.
  *
  * CloudFront specific options (in addition to the default client configuration options):
  * - key_pair_id: The ID of the key pair used to sign CloudFront URLs for private distributions.
  * - private_key: The filepath ot the private key used to sign CloudFront URLs for private distributions.
  *
  * @param array|Collection $config Client configuration data
  *
  * @return self
  * @see \Aws\Common\Client\DefaultClient for a list of other available configuration options
  */
 public static function factory($config = array())
 {
     // Decide which signature to use
     if (isset($config[Options::VERSION]) && $config[Options::VERSION] < self::LATEST_API_VERSION) {
         $config[Options::SIGNATURE] = new CloudFrontSignature();
     }
     // Instantiate the CloudFront client
     return ClientBuilder::factory(__NAMESPACE__)->setConfig($config)->setConfigDefaults(array(Options::VERSION => self::LATEST_API_VERSION, Options::SERVICE_DESCRIPTION => __DIR__ . '/Resources/cloudfront-%s.php'))->setExceptionParser(new DefaultXmlExceptionParser())->setIteratorsConfig(array('token_param' => 'Marker', 'token_key' => 'NextMarker', 'more_key' => 'IsTruncated', 'result_key' => 'Items', 'operations' => array('ListCloudFrontOriginAccessIdentities', 'ListDistributions', 'ListInvalidations', 'ListStreamingDistributions')))->build();
 }
开发者ID:datianshi,项目名称:Drupal,代码行数:21,代码来源:CloudFrontClient.php


示例6: factory

 /**
  * Factory method to create a new Amazon DynamoDB client using an array of configuration options.
  *
  * @param array|Collection $config Client configuration data
  *
  * @return self
  * @see \Aws\Common\Client\DefaultClient for a list of available configuration options
  */
 public static function factory($config = array())
 {
     // Configure the custom exponential backoff plugin for DynamoDB throttling
     $exceptionParser = new JsonQueryExceptionParser();
     if (!isset($config[Options::BACKOFF])) {
         $config[Options::BACKOFF] = new BackoffPlugin(new Crc32ErrorChecker(new TruncatedBackoffStrategy(11, new ThrottlingErrorChecker($exceptionParser, new HttpBackoffStrategy(null, new CurlBackoffStrategy(null, new ExpiredCredentialsChecker($exceptionParser, new CallbackBackoffStrategy(__CLASS__ . '::calculateRetryDelay', false))))))));
     }
     // Construct the DynamoDB client with the client builder
     return ClientBuilder::factory(__NAMESPACE__)->setConfig($config)->setConfigDefaults(array(self::DISABLE_REDIRECTS => true, Options::VERSION => self::LATEST_API_VERSION, Options::SERVICE_DESCRIPTION => __DIR__ . '/Resources/dynamodb-%s.php', self::COMMAND_PARAMS => array(Cmd::RESPONSE_PROCESSING => Cmd::TYPE_NO_TRANSLATION)))->setExceptionParser($exceptionParser)->setIteratorsConfig(array('result_key' => 'Items', 'token_param' => 'ExclusiveStartKey', 'token_key' => 'LastEvaluatedKey', 'operations' => array('BatchGetItem' => array('token_param' => 'RequestItems', 'token_key' => 'UnprocessedKeys', 'result_key' => 'Responses/*'), 'ListTables' => array('result_key' => 'TableNames', 'token_param' => 'ExclusiveStartTableName', 'token_key' => 'LastEvaluatedTableName'), 'Query', 'Scan')))->build();
 }
开发者ID:kissingwolf,项目名称:namedmanager,代码行数:18,代码来源:DynamoDbClient.php


示例7: factory

 /**
  * Factory method to create a new Amazon STS client using an array of configuration options:
  *
  * Credential options (`key`, `secret`, and optional `token` OR `credentials` is required)
  *
  * - key: AWS Access Key ID
  * - secret: AWS secret access key
  * - credentials: You can optionally provide a custom `Aws\Common\Credentials\CredentialsInterface` object
  * - token: Custom AWS security token to use with request authentication
  * - token.ttd: UNIX timestamp for when the custom credentials expire
  * - credentials.cache: Used to cache credentials when using providers that require HTTP requests. Set the true
  *   to use the default APC cache or provide a `Guzzle\Cache\CacheAdapterInterface` object.
  * - credentials.cache.key: Optional custom cache key to use with the credentials
  * - credentials.client: Pass this option to specify a custom `Guzzle\Http\ClientInterface` to use if your
  *   credentials require a HTTP request (e.g. RefreshableInstanceProfileCredentials)
  *
  * Region and Endpoint options (a `region` and optional `scheme` OR a `base_url` is required)
  *
  * - region: Region name (e.g. 'us-east-1', 'us-west-1', 'us-west-2', 'eu-west-1', etc...)
  * - scheme: URI Scheme of the base URL (e.g. 'https', 'http').
  * - base_url: Instead of using a `region` and `scheme`, you can specify a custom base URL for the client
  * - endpoint_provider: Optional `Aws\Common\Region\EndpointProviderInterface` used to provide region endpoints
  *
  * Generic client options
  *
  * - ssl.certificate_authority: Set to true to use the bundled CA cert (default), system to use the certificate
  *   bundled with your system, or pass the full path to an SSL certificate bundle. This option should be used when
  *   you encounter curl error code 60.
  * - curl.options: Array of cURL options to apply to every request.
  *   See http://www.php.net/manual/en/function.curl-setopt.php for a list of available options
  * - signature: You can optionally provide a custom signature implementation used to sign requests
  * - signature.service: Set to explicitly override the service name used in signatures
  * - signature.region:  Set to explicitly override the region name used in signatures
  * - client.backoff.logger: `Guzzle\Log\LogAdapterInterface` object used to log backoff retries. Use
  *   'debug' to emit PHP warnings when a retry is issued.
  * - client.backoff.logger.template: Optional template to use for exponential backoff log messages. See
  *   `Guzzle\Plugin\Backoff\BackoffLogger` for formatting information.
  *
  * @param array|Collection $config Client configuration data
  *
  * @return self
  */
 public static function factory($config = array())
 {
     // Construct the STS client with the client builder
     return ClientBuilder::factory(__NAMESPACE__)->setConfig($config)->setConfigDefaults(array(Options::SERVICE_DESCRIPTION => __DIR__ . '/Resources/sts-2011-06-15.php'))->setCredentialsResolver(new CredentialsOptionResolver(function (Collection $config) {
         // Always need long term credentials
         if ($config->get(Options::KEY) && $config->get(Options::SECRET) && !$config->get(Options::TOKEN)) {
             return Credentials::factory($config->getAll(array_keys(Credentials::getConfigDefaults())));
         }
     }))->build();
 }
开发者ID:netor27,项目名称:UnovaPrivado,代码行数:52,代码来源:StsClient.php


示例8: factory

 /**
  * Factory method to create a new Amazon STS client using an array of configuration options:
  *
  * Credential options (`key`, `secret`, and optional `token` OR `credentials` is required)
  *
  * - key: AWS Access Key ID
  * - secret: AWS secret access key
  * - credentials: You can optionally provide a custom `Aws\Common\Credentials\CredentialsInterface` object
  * - token: Custom AWS security token to use with request authentication
  * - token.ttd: UNIX timestamp for when the custom credentials expire
  * - credentials.cache: Used to cache credentials when using providers that require HTTP requests. Set the true
  *   to use the default APC cache or provide a `Guzzle\Cache\CacheAdapterInterface` object.
  * - credentials.cache.key: Optional custom cache key to use with the credentials
  * - credentials.client: Pass this option to specify a custom `Guzzle\Http\ClientInterface` to use if your
  *   credentials require a HTTP request (e.g. RefreshableInstanceProfileCredentials)
  *
  * Region and Endpoint options (a `region` and optional `scheme` OR a `base_url` is required)
  *
  * - region: Region name (e.g. 'us-east-1', 'us-west-1', 'us-west-2', 'eu-west-1', etc...)
  * - scheme: URI Scheme of the base URL (e.g. 'https', 'http').
  * - base_url: Instead of using a `region` and `scheme`, you can specify a custom base URL for the client
  * - endpoint_provider: Optional `Aws\Common\Region\EndpointProviderInterface` used to provide region endpoints
  *
  * Generic client options
  *
  * - ssl.cert: Set to true to use the bundled CA cert or pass the full path to an SSL certificate bundle. This
  *   option should be used when you encounter curl error code 60.
  * - curl.options: Array of cURL options to apply to every request.
  *   See http://www.php.net/manual/en/function.curl-setopt.php for a list of available options
  * - signature: You can optionally provide a custom signature implementation used to sign requests
  * - signature.service: Set to explicitly override the service name used in signatures
  * - signature.region:  Set to explicitly override the region name used in signatures
  * - client.backoff.logger: `Guzzle\Log\LogAdapterInterface` object used to log backoff retries. Use
  *   'debug' to emit PHP warnings when a retry is issued.
  * - client.backoff.logger.template: Optional template to use for exponential backoff log messages. See
  *   `Guzzle\Plugin\Backoff\BackoffLogger` for formatting information.
  *
  * @param array|Collection $config Client configuration data
  *
  * @return self
  */
 public static function factory($config = array())
 {
     // Construct the STS client with the client builder
     return ClientBuilder::factory(__NAMESPACE__)->setConfig($config)->setConfigDefaults(array(Options::SERVICE => 'sts', Options::SCHEME => 'https', Options::REGION => 'us-east-1'))->setCredentialsResolver(new CredentialsOptionResolver(function (Collection $config) {
         // Always need long term credentials
         if ($config->get(Options::KEY) && $config->get(Options::SECRET) && !$config->get(Options::TOKEN)) {
             return Credentials::factory($config->getAll(array_keys(Credentials::getConfigDefaults())));
         }
     }))->setSignature(new SignatureV4())->build();
 }
开发者ID:romainneutron,项目名称:aws-sdk-php,代码行数:51,代码来源:StsClient.php


示例9: factory

 /**
  * Factory method to create a new Amazon DynamoDB client using an array of configuration options.
  *
  * @param array|Collection $config Client configuration data
  *
  * @return self
  * @link http://docs.aws.amazon.com/aws-sdk-php/v2/guide/configuration.html#client-configuration-options
  */
 public static function factory($config = array())
 {
     // Configure the custom exponential backoff plugin for DynamoDB throttling
     $exceptionParser = new JsonQueryExceptionParser();
     if (!isset($config[Options::BACKOFF])) {
         $config[Options::BACKOFF] = new BackoffPlugin(new Crc32ErrorChecker(self::createDynamoDbBackoffStrategy($exceptionParser)));
     }
     // Construct the DynamoDB client with the client builder
     return ClientBuilder::factory(__NAMESPACE__)->setConfig($config)->setConfigDefaults(array(self::DISABLE_REDIRECTS => true, Options::VERSION => self::LATEST_API_VERSION, Options::SERVICE_DESCRIPTION => __DIR__ . '/Resources/dynamodb-%s.php', self::COMMAND_PARAMS => array(Cmd::RESPONSE_PROCESSING => Cmd::TYPE_NO_TRANSLATION)))->setExceptionParser($exceptionParser)->build();
 }
开发者ID:sohel4r,项目名称:wordpress_4_1_1,代码行数:18,代码来源:DynamoDbClient.php


示例10: factory

 /**
  * Factory method to create a new AWS Import/Export client using an array of configuration options.
  *
  * @param array|Collection $config Client configuration data
  *
  * @return self
  * @see \Aws\Common\Client\DefaultClient for a list of available configuration options
  */
 public static function factory($config = array())
 {
     $client = ClientBuilder::factory(__NAMESPACE__)->setConfig($config)->setConfigDefaults(array(Options::VERSION => self::LATEST_API_VERSION, Options::SERVICE_DESCRIPTION => __DIR__ . '/Resources/importexport-%s.php'))->build();
     // If the Symfony YAML component is installed, add a listener that will convert arrays to proper YAML in when
     // specifying the "Manifest" parameter of the "CreateJob" operation
     if (class_exists('Symfony\\Component\\Yaml\\Yaml')) {
         $client->addSubscriber(new JobManifestListener());
     }
     return $client;
 }
开发者ID:kissingwolf,项目名称:namedmanager,代码行数:18,代码来源:ImportExportClient.php


示例11: factory

 /**
  * Factory method to create a new Amazon Glacier client using an array of configuration options.
  *
  * @param array|Collection $config Client configuration data
  *
  * @return GlacierClient
  * @link http://docs.aws.amazon.com/aws-sdk-php/v2/guide/configuration.html#client-configuration-options
  */
 public static function factory($config = array())
 {
     // Setup the Glacier client
     $client = ClientBuilder::factory(__NAMESPACE__)->setConfig($config)->setConfigDefaults(array(Options::VERSION => self::LATEST_API_VERSION, Options::SERVICE_DESCRIPTION => __DIR__ . '/Resources/glacier-%s.php', 'command.params' => array('accountId' => '-', Options::MODEL_PROCESSING => true)))->setExceptionParser(new JsonRestExceptionParser())->build();
     // Add the Glacier version header required for all operations
     $client->getConfig()->setPath('request.options/headers/x-amz-glacier-version', $client->getDescription()->getApiVersion());
     // Allow for specifying bodies with file paths and file handles
     $uploadOperations = array('UploadArchive', 'UploadMultipartPart');
     $client->addSubscriber(new UploadBodyListener($uploadOperations, 'body', 'sourceFile'));
     // Listen for upload operations and make sure the required hash headers are added
     $client->addSubscriber(new GlacierUploadListener());
     return $client;
 }
开发者ID:humanmade,项目名称:aws-ses-wp-mail,代码行数:21,代码来源:GlacierClient.php


示例12: getClientFactoryInterfaceMock

 protected function getClientFactoryInterfaceMock()
 {
     $mock = new \mock\LLS\Bundle\AWSBundle\Interfaces\ClientFactoryInterface();
     $config = $this->config;
     $mock->getMockController()->createClient = function ($type, IdentityInterface $identity) use($config) {
         $reflection = new \ReflectionClass("Aws\\Sqs\\SqsClient");
         $file = $reflection->getFileName();
         $client = ClientBuilder::factory("mock\\Aws\\Sqs")->setConfig($config)->setConfigDefaults(array(Options::VERSION => \Aws\Sqs\SqsClient::LATEST_API_VERSION, Options::SERVICE_DESCRIPTION => dirname($file) . '/Resources/sqs-%s.php'))->build();
         $client->addSubscriber(new QueueUrlListener());
         $client->addSubscriber(new Md5ValidatorListener());
         return $client;
     };
     return $mock;
 }
开发者ID:AdrenalineHunter,项目名称:SQSBundle,代码行数:14,代码来源:AwsServiceTest.php


示例13: factory

 /**
  * Factory method to create a new Amazon Cognito Identity client using an array of configuration options.
  *
  * See http://docs.aws.amazon.com/aws-sdk-php/guide/latest/configuration.html#client-configuration-options
  *
  * @param array|Collection $config Client configuration data
  *
  * @return self
  * @link http://docs.aws.amazon.com/aws-sdk-php/guide/latest/configuration.html#client-configuration-options
  */
 public static function factory($config = array())
 {
     $client = ClientBuilder::factory(__NAMESPACE__)->setConfig($config)->setConfigDefaults(array(Options::VERSION => self::LATEST_API_VERSION, Options::SERVICE_DESCRIPTION => __DIR__ . '/Resources/cognitoidentity-%s.php'))->setExceptionParser(new JsonQueryExceptionParser())->build();
     // Attach a listener to prevent some requests from being signed
     $client->getEventDispatcher()->addListener('command.before_send', function (Event $event) {
         /** @var AbstractCommand $command */
         $command = $event['command'];
         if (in_array($command->getName(), array('GetId', 'GetOpenIdToken', 'UnlinkIdentity'))) {
             /** @var EventDispatcher $dispatcher */
             $dispatcher = $command->getRequest()->getEventDispatcher();
             foreach ($dispatcher->getListeners('request.before_send') as $listener) {
                 if (is_array($listener) && $listener[0] instanceof SignatureListener) {
                     $dispatcher->removeListener('request.before_send', $listener);
                     break;
                 }
             }
         }
     });
     return $client;
 }
开发者ID:NeilBryant,项目名称:webpagetest,代码行数:30,代码来源:CognitoIdentityClient.php


示例14: factory

 /**
  * Factory method to create a new AWS Config client using an array of configuration options.
  *
  * See http://docs.aws.amazon.com/aws-sdk-php/v2/guide/configuration.html#client-configuration-options
  *
  * @param array|Collection $config Client configuration data
  *
  * @return self
  * @link http://docs.aws.amazon.com/aws-sdk-php/v2/guide/configuration.html#client-configuration-options
  */
 public static function factory($config = array())
 {
     return ClientBuilder::factory(__NAMESPACE__)->setConfig($config)->setConfigDefaults(array(Options::VERSION => self::LATEST_API_VERSION, Options::SERVICE_DESCRIPTION => __DIR__ . '/Resources/configservice-%s.php'))->setExceptionParser(new JsonQueryExceptionParser())->build();
 }
开发者ID:njbhatt18,项目名称:AWS_S3_File_Remove,代码行数:14,代码来源:ConfigServiceClient.php


示例15: factory

 /**
  * Factory method to create a new Amazon Simple Workflow Service client using an array of configuration options.
  *
  * The following array keys and values are available options:
  *
  * - Credential options (`key`, `secret`, and optional `token` OR `credentials` is required)
  *     - key: AWS Access Key ID
  *     - secret: AWS secret access key
  *     - credentials: You can optionally provide a custom `Aws\Common\Credentials\CredentialsInterface` object
  *     - token: Custom AWS security token to use with request authentication
  *     - token.ttd: UNIX timestamp for when the custom credentials expire
  *     - credentials.cache.key: Optional custom cache key to use with the credentials
  * - Region and Endpoint options (a `region` and optional `scheme` OR a `base_url` is required)
  *     - region: Region name (e.g. 'us-east-1', 'us-west-1', 'us-west-2', 'eu-west-1', etc...)
  *     - scheme: URI Scheme of the base URL (e.g. 'https', 'http').
  *     - base_url: Instead of using a `region` and `scheme`, you can specify a custom base URL for the client
  *     - endpoint_provider: Optional `Aws\Common\Region\EndpointProviderInterface` used to provide region endpoints
  * - Generic client options
  *     - ssl.cert: Set to true to use the bundled CA cert or pass the full path to an SSL certificate bundle. This
  *           option should be used when you encounter curl error code 60.
  *     - curl.CURLOPT_VERBOSE: Set to true to output curl debug information during transfers
  *     - curl.*: Prefix any available cURL option with `curl.` to add cURL options to each request.
  *           See: http://www.php.net/manual/en/function.curl-setopt.php
  *     - service.description.cache.ttl: Optional TTL used for the service description cache
  * - Signature options
  *     - signature: You can optionally provide a custom signature implementation used to sign requests
  *     - signature.service: Set to explicitly override the service name used in signatures
  *     - signature.region:  Set to explicitly override the region name used in signatures
  * - Exponential backoff options
  *     - client.backoff.logger: `Guzzle\Common\Log\LogAdapterInterface` object used to log backoff retries. Use
  *           'debug' to emit PHP warnings when a retry is issued.
  *     - client.backoff.logger.template: Optional template to use for exponential backoff log messages. See
  *           `Guzzle\Http\Plugin\ExponentialBackoffLogger` for formatting information.
  *
  * @param array|Collection $config Client configuration data
  *
  * @return self
  */
 public static function factory($config = array())
 {
     return ClientBuilder::factory(__NAMESPACE__)->setConfig($config)->setConfigDefaults(array(Options::SERVICE_DESCRIPTION => __DIR__ . '/Resources/swf-2012-01-25.php'))->setExceptionParser(new JsonQueryExceptionParser())->build();
 }
开发者ID:netor27,项目名称:UnovaPrivado,代码行数:42,代码来源:SwfClient.php


示例16: factory

 /**
  * Factory method to create a new Amazon DynamoDB client using an array of configuration options:
  *
  * Credential options (`key`, `secret`, and optional `token` OR `credentials` is required)
  *
  * - key: AWS Access Key ID
  * - secret: AWS secret access key
  * - credentials: You can optionally provide a custom `Aws\Common\Credentials\CredentialsInterface` object
  * - token: Custom AWS security token to use with request authentication
  * - token.ttd: UNIX timestamp for when the custom credentials expire
  * - credentials.cache: Used to cache credentials when using providers that require HTTP requests. Set the true
  *   to use the default APC cache or provide a `Guzzle\Cache\CacheAdapterInterface` object.
  * - credentials.cache.key: Optional custom cache key to use with the credentials
  * - credentials.client: Pass this option to specify a custom `Guzzle\Http\ClientInterface` to use if your
  *   credentials require a HTTP request (e.g. RefreshableInstanceProfileCredentials)
  *
  * Region and Endpoint options (a `region` and optional `scheme` OR a `base_url` is required)
  *
  * - region: Region name (e.g. 'us-east-1', 'us-west-1', 'us-west-2', 'eu-west-1', etc...)
  * - scheme: URI Scheme of the base URL (e.g. 'https', 'http').
  * - base_url: Instead of using a `region` and `scheme`, you can specify a custom base URL for the client
  * - endpoint_provider: Optional `Aws\Common\Region\EndpointProviderInterface` used to provide region endpoints
  *
  * Generic client options
  *
  * - ssl.cert: Set to true to use the bundled CA cert or pass the full path to an SSL certificate bundle. This
  *   option should be used when you encounter curl error code 60.
  * - curl.options: Array of cURL options to apply to every request.
  *   See http://www.php.net/manual/en/function.curl-setopt.php for a list of available options
  * - signature: You can optionally provide a custom signature implementation used to sign requests
  * - signature.service: Set to explicitly override the service name used in signatures
  * - signature.region:  Set to explicitly override the region name used in signatures
  * - client.backoff.logger: `Guzzle\Log\LogAdapterInterface` object used to log backoff retries. Use
  *   'debug' to emit PHP warnings when a retry is issued.
  * - client.backoff.logger.template: Optional template to use for exponential backoff log messages. See
  *   `Guzzle\Plugin\Backoff\BackoffLogger` for formatting information.
  *
  * @param array|Collection $config Client configuration data
  *
  * @return self
  */
 public static function factory($config = array())
 {
     // Configure the custom exponential backoff plugin for DynamoDB throttling
     $exponentialBackoffResolver = new BackoffOptionResolver(function ($config, $client) {
         return new BackoffPlugin(new ThrottlingErrorChecker(new HttpBackoffStrategy(null, new TruncatedBackoffStrategy(11, new CurlBackoffStrategy(null, new CallbackBackoffStrategy(array($client, 'calculateRetryDelay'), false))))));
     });
     // Construct the DynamoDB client with the client builder
     return ClientBuilder::factory(__NAMESPACE__)->setConfig($config)->setConfigDefaults(array(Options::SERVICE => 'dynamodb', Options::SCHEME => 'https'))->setSignature(new SignatureV4())->addClientResolver($exponentialBackoffResolver)->setExceptionParser(new JsonQueryExceptionParser())->build();
 }
开发者ID:robertkraig,项目名称:aws-sdk-php,代码行数:50,代码来源:DynamoDbClient.php


示例17: factory

 /**
  * Factory method to create a new Auto Scaling client using an array of configuration options.
  *
  * @param array|Collection $config Client configuration data
  *
  * @return self
  * @link http://docs.aws.amazon.com/aws-sdk-php/v2/guide/configuration.html#client-configuration-options
  */
 public static function factory($config = array())
 {
     return ClientBuilder::factory(__NAMESPACE__)->setConfig($config)->setConfigDefaults(array(Options::VERSION => self::LATEST_API_VERSION, Options::SERVICE_DESCRIPTION => __DIR__ . '/Resources/autoscaling-%s.php'))->build();
 }
开发者ID:sohel4r,项目名称:wordpress_4_1_1,代码行数:12,代码来源:AutoScalingClient.php


示例18: factory

 /**
  * Factory method to create a default client using an array of configuration options.
  *
  * The following array keys and values are available options:
  *
  * - Credential options (`key`, `secret`, and optional `token` OR `credentials` is required)
  *     - key: AWS Access Key ID
  *     - secret: AWS secret access key
  *     - credentials: You can optionally provide a custom `Aws\Common\Credentials\CredentialsInterface` object
  *     - token: Custom AWS security token to use with request authentication
  *     - token.ttd: UNIX timestamp for when the custom credentials expire
  *     - credentials.cache: Used to cache credentials when using providers that require HTTP requests. Set the true
  *           to use the default APC cache or provide a `Guzzle\Cache\CacheAdapterInterface` object.
  *     - credentials.cache.key: Optional custom cache key to use with the credentials
  *     - credentials.client: Pass this option to specify a custom `Guzzle\Http\ClientInterface` to use if your
  *           credentials require a HTTP request (e.g. RefreshableInstanceProfileCredentials)
  * - Region and Endpoint options (a `region` and optional `scheme` OR a `base_url` is required)
  *     - region: Region name (e.g. 'us-east-1', 'us-west-1', 'us-west-2', 'eu-west-1', etc...)
  *     - scheme: URI Scheme of the base URL (e.g. 'https', 'http').
  *     - service: Specify the name of the service
  *     - base_url: Instead of using a `region` and `scheme`, you can specify a custom base URL for the client
  *     - endpoint_provider: Optional `Aws\Common\Region\EndpointProviderInterface` used to provide region endpoints
  * - Signature options
  *     - signature: You can optionally provide a custom signature implementation used to sign requests
  *     - signature.service: Set to explicitly override the service name used in signatures
  *     - signature.region:  Set to explicitly override the region name used in signatures
  * - Exponential backoff options
  *     - client.backoff.logger: `Guzzle\Log\LogAdapterInterface` object used to log backoff retries. Use
  *           'debug' to emit PHP warnings when a retry is issued.
  *     - client.backoff.logger.template: Optional template to use for exponential backoff log messages. See
  *           `Guzzle\Plugin\Backoff\BackoffLogger` for formatting information.
  * - Generic client options
  *     - ssl.cert: Set to true to use the bundled CA cert or pass the full path to an SSL certificate bundle. This
  *           option should be used when you encounter curl error code 60.
  *     - curl.CURLOPT_VERBOSE: Set to true to output curl debug information during transfers
  *     - curl.*: Prefix any available cURL option with `curl.` to add cURL options to each request.
  *           See: http://www.php.net/manual/en/function.curl-setopt.php
  *
  * @param array|Collection $config Client configuration data
  *
  * @return self
  */
 public static function factory($config = array())
 {
     return ClientBuilder::factory()->setConfig($config)->setConfigRequirements(array(Options::REGION, Options::SIGNATURE))->setConfigDefaults(array(Options::SCHEME => 'https'))->build();
 }
开发者ID:romainneutron,项目名称:aws-sdk-php,代码行数:46,代码来源:DefaultClient.php


示例19: factory

 /**
  * Factory method to create a new Amazon CloudWatch client using an array of configuration options.
  *
  * The following array keys and values are available options:
  *
  * - Credential options (`key`, `secret`, and optional `token` OR `credentials` is required)
  *     - key: AWS Access Key ID
  *     - secret: AWS secret access key
  *     - credentials: You can optionally provide a custom `Aws\Common\Credentials\CredentialsInterface` object
  *     - token: Custom AWS security token to use with request authentication
  *     - token.ttd: UNIX timestamp for when the custom credentials expire
  *     - credentials.cache.key: Optional custom cache key to use with the credentials
  * - Region and Endpoint options (a `region` and optional `scheme` OR a `base_url` is required)
  *     - region: Region name (e.g. 'us-east-1', 'us-west-1', 'us-west-2', 'eu-west-1', etc...)
  *     - scheme: URI Scheme of the base URL (e.g. 'https', 'http').
  *     - base_url: Instead of using a `region` and `scheme`, you can specify a custom base URL for the client
  * - Generic client options
  *     - ssl.cert: Set to true to use the bundled CA cert or pass the full path to an SSL certificate bundle. This
  *           option should be used when you encounter curl error code 60.
  *     - curl.CURLOPT_VERBOSE: Set to true to output curl debug information during transfers
  *     - curl.*: Prefix any available cURL option with `curl.` to add cURL options to each request.
  *           See: http://www.php.net/manual/en/function.curl-setopt.php
  *     - service.description.cache.ttl: Optional TTL used for the service description cache
  * - Signature options
  *     - signature: You can optionally provide a custom signature implementation used to sign requests
  *     - signature.service: Set to explicitly override the service name used in signatures
  *     - signature.region:  Set to explicitly override the region name used in signatures
  * - Exponential backoff options
  *     - client.backoff.logger: `Guzzle\Common\Log\LogAdapterInterface` object used to log backoff retries. Use
  *           'debug' to emit PHP warnings when a retry is issued.
  *     - client.backoff.logger.template: Optional template to use for exponential backoff log messages. See
  *           `Guzzle\Http\Plugin\ExponentialBackoffLogger` for formatting information.
  *
  * @param array|Collection $config Client configuration data
  *
  * @return self
  */
 public static function factory($config = array())
 {
     return ClientBuilder::factory(__NAMESPACE__)->setConfig($config)->setConfigDefaults(array(Options::SERVICE_DESCRIPTION => __DIR__ . '/Resources/cloudwatch-2010-08-01.php'))->build();
 }
开发者ID:cstuder,项目名称:nagios-plugins,代码行数:41,代码来源:CloudWatchClient.php


示例20: factory

 /**
  * Factory method to create a new Amazon SimpleDB client using an array of configuration options.
  *
  * The following array keys and values are available options:
  *
  * - Credential options (`key`, `secret`, and optional `token` OR `credentials` is required)
  *     - key: AWS Access Key ID
  *     - secret: AWS secret access key
  *     - credentials: You can optionally provide a custom `Aws\Common\Credentials\CredentialsInterface` object
  *     - token: Custom AWS security token to use with request authentication
  *     - token.ttd: UNIX timestamp for when the custom credentials expire
  *     - credentials.cache.key: Optional custom cache key to use with the credentials
  * - Region and Endpoint options (a `region` and optional `scheme` OR a `base_url` is required)
  *     - region: Region name (e.g. 'us-east-1', 'us-west-1', 'us-west-2', 'eu-west-1', etc...)
  *     - scheme: URI Scheme of the base URL (e.g. 'https', 'http').
  *     - base_url: Instead of using a `region` and `scheme`, you can specify a custom base URL for the client
  *     - endpoint_provider: Optional `Aws\Common\Region\EndpointProviderInterface` used to provide region endpoints
  * - Generic client options
  *     - ssl.cert: Set to true to use the bundled CA cert or pass the full path to an SSL certificate bundle. This
  *           option should be used when you encounter curl error code 60.
  *     - curl.CURLOPT_VERBOSE: Set to true to output curl debug information during transfers
  *     - curl.*: Prefix any available cURL option with `curl.` to add cURL options to each request.
  *           See: http://www.php.net/manual/en/function.curl-setopt.php
  *     - service.description.cache.ttl: Optional TTL used for the service description cache
  * - Signature options
  *     - signature: You can optionally provide a custom signature implementation used to sign requests
  *     - signature.service: Set to explicitly override the service name used in signatures
  *     - signature.region:  Set to explicitly override the region name used in signatures
  * - Exponential backoff options
  *     - client.backoff.logger: `Guzzle\Common\Log\LogAdapterInterface` object used to log backoff retries. Use
  *           'debug' to emit PHP warnings when a retry is issued.
  *     - client.backoff.logger.template: Optional template to use for exponential backoff log messages. See
  *           `Guzzle\Http\Pl 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP DynamoDb\DynamoDbClient类代码示例发布时间:2022-05-23
下一篇:
PHP Common\Aws类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap