當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。