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


PHP Zend_Service_Amazon_S3::getEndpoint方法代码示例

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


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

示例1: testCreateObjectSSL

 /**
  * Test creating object with https
  *
  * ZF-7029
  */
 public function testCreateObjectSSL()
 {
     $this->_amazon->setEndpoint('https://s3.amazonaws.com');
     $this->assertEquals('https://s3.amazonaws.com', $this->_amazon->getEndpoint()->getUri());
     $this->_amazon->createBucket($this->_bucket);
     $this->_amazon->putObject($this->_bucket . "/zftest", "testdata");
     $this->assertEquals("testdata", $this->_amazon->getObject($this->_bucket . "/zftest"));
 }
开发者ID:vicfryzel,项目名称:zf,代码行数:13,代码来源:OnlineTest.php

示例2: getUri

 /**
  * Get a URI for a "stored" file.
  *
  * @see http://docs.amazonwebservices.com/AmazonS3/latest/dev/index.html?RESTAuthentication.html#RESTAuthenticationQueryStringAuth
  * @param string $path
  * @return string URI
  */
 public function getUri($path)
 {
     $endpoint = $this->_s3->getEndpoint();
     $object = urlencode($this->_getObjectName($path));
     $uri = "{$endpoint}/{$object}";
     if ($expiration = $this->_getExpiration()) {
         $date = new Zend_Date();
         $date->add($expiration, Zend_Date::MINUTE);
         $accessKeyId = $this->_options[self::AWS_KEY_OPTION];
         $secretKey = $this->_options[self::AWS_SECRET_KEY_OPTION];
         $expires = $date->getTimestamp();
         $stringToSign = "GET\n\n\n{$expires}\n/{$object}";
         $signature = base64_encode(Zend_Crypt_Hmac::compute($secretKey, 'sha1', utf8_encode($stringToSign), Zend_Crypt_Hmac::BINARY));
         $query['AWSAccessKeyId'] = $accessKeyId;
         $query['Expires'] = $expires;
         $query['Signature'] = $signature;
         $queryString = http_build_query($query);
         $uri .= "?{$queryString}";
     }
     return $uri;
 }
开发者ID:lchen01,项目名称:STEdwards,代码行数:28,代码来源:ZendS3.php


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