当前位置: 首页>>代码示例>>PHP>>正文


PHP Zend_Service_Amazon_S3::getHttpClient方法代码示例

本文整理汇总了PHP中Zend_Service_Amazon_S3::getHttpClient方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Service_Amazon_S3::getHttpClient方法的具体用法?PHP Zend_Service_Amazon_S3::getHttpClient怎么用?PHP Zend_Service_Amazon_S3::getHttpClient使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Zend_Service_Amazon_S3的用法示例。


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

示例1: __construct

 /**
  * Constructor
  * 
  * @param  array|Zend_Config $options 
  * @return void
  */
 public function __construct($options = array())
 {
     if ($options instanceof Zend_Config) {
         $options = $options->toArray();
     }
     if (!is_array($options)) {
         throw new Zend_Cloud_StorageService_Exception('Invalid options provided');
     }
     if (!isset($options[self::AWS_ACCESS_KEY]) || !isset($options[self::AWS_SECRET_KEY])) {
         throw new Zend_Cloud_StorageService_Exception('AWS keys not specified!');
     }
     try {
         $this->_s3 = new Zend_Service_Amazon_S3($options[self::AWS_ACCESS_KEY], $options[self::AWS_SECRET_KEY]);
     } catch (Zend_Service_Amazon_S3_Exception $e) {
         throw new Zend_Cloud_StorageService_Exception('Error on create: ' . $e->getMessage(), $e->getCode(), $e);
     }
     if (isset($options[self::HTTP_ADAPTER])) {
         $this->_s3->getHttpClient()->setAdapter($options[self::HTTP_ADAPTER]);
     }
     if (isset($options[self::BUCKET_NAME])) {
         $this->_defaultBucketName = $options[self::BUCKET_NAME];
     }
     if (isset($options[self::BUCKET_AS_DOMAIN])) {
         $this->_defaultBucketAsDomain = $options[self::BUCKET_AS_DOMAIN];
     }
 }
开发者ID:laiello,项目名称:vinhloi,代码行数:32,代码来源:S3.php

示例2: setUp

 /**
  * Sets up this test case
  *
  * @return void
  */
 public function setUp()
 {
     $this->_amazon = new Zend_Service_Amazon_S3(constant('TESTS_ZEND_SERVICE_AMAZON_ONLINE_ACCESSKEYID'), constant('TESTS_ZEND_SERVICE_AMAZON_ONLINE_SECRETKEY'));
     $this->_nosuchbucket = "nonexistingbucketnamewhichnobodyshoulduse";
     $this->_httpClientAdapterSocket = new Zend_Http_Client_Adapter_Socket();
     $this->_bucket = constant('TESTS_ZEND_SERVICE_AMAZON_S3_BUCKET');
     $this->_amazon->getHttpClient()->setAdapter($this->_httpClientAdapterSocket);
     // terms of use compliance: no more than one query per second
     sleep(1);
 }
开发者ID:vicfryzel,项目名称:zf,代码行数:15,代码来源:OnlineTest.php

示例3: setUp

 /**
  * Sets up this test case
  *
  * @return void
  */
 public function setUp()
 {
     if (!constant('TESTS_ZEND_SERVICE_AMAZON_ONLINE_ENABLED')) {
         $this->markTestSkipped('Zend_Service_Amazon online tests are not enabled');
     }
     $this->_amazon = new S3\S3(constant('TESTS_ZEND_SERVICE_AMAZON_ONLINE_ACCESSKEYID'), constant('TESTS_ZEND_SERVICE_AMAZON_ONLINE_SECRETKEY'));
     $this->_nosuchbucket = "nonexistingbucketnamewhichnobodyshoulduse";
     $this->_httpClientAdapterSocket = new \Zend\Http\Client\Adapter\Socket();
     $this->_bucket = constant('TESTS_ZEND_SERVICE_AMAZON_S3_BUCKET');
     $this->_amazon->getHttpClient()->setAdapter($this->_httpClientAdapterSocket);
 }
开发者ID:tillk,项目名称:vufind,代码行数:16,代码来源:OnlineTest.php

示例4: _initApi

 protected function _initApi()
 {
     if (!$this->_apiInitialized) {
         @ini_set('max_execution_time', self::TIMEOUT);
         @set_time_limit(self::TIMEOUT);
         if (!$this->_api) {
             $this->_api = new Garp_Service_Amazon_S3($this->_config['apikey'], $this->_config['secret']);
         }
         $this->_api->getHttpClient()->setConfig(array('timeout' => self::TIMEOUT, 'keepalive' => $this->_config['keepalive']));
         $this->_apiInitialized = true;
     }
 }
开发者ID:grrr-amsterdam,项目名称:garp3,代码行数:12,代码来源:S3.php


注:本文中的Zend_Service_Amazon_S3::getHttpClient方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。