當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Zend_Oauth_Http_Utility::urlEncode方法代碼示例

本文整理匯總了PHP中Zend_Oauth_Http_Utility::urlEncode方法的典型用法代碼示例。如果您正苦於以下問題:PHP Zend_Oauth_Http_Utility::urlEncode方法的具體用法?PHP Zend_Oauth_Http_Utility::urlEncode怎麽用?PHP Zend_Oauth_Http_Utility::urlEncode使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Zend_Oauth_Http_Utility的用法示例。


在下文中一共展示了Zend_Oauth_Http_Utility::urlEncode方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: _getBaseSignatureString

 /**
  * Get base signature string
  *
  * @param  array $params
  * @param  null|string $method
  * @param  null|string $url
  * @return string
  */
 protected function _getBaseSignatureString(array $params, $method = null, $url = null)
 {
     $encodedParams = array();
     foreach ($params as $key => $value) {
         $encodedParams[Zend_Oauth_Http_Utility::urlEncode($key)] = Zend_Oauth_Http_Utility::urlEncode($value);
     }
     $baseStrings = array();
     if (isset($method)) {
         $baseStrings[] = strtoupper($method);
     }
     if (isset($url)) {
         // should normalise later
         $baseStrings[] = Zend_Oauth_Http_Utility::urlEncode($this->normaliseBaseSignatureUrl($url));
     }
     if (isset($encodedParams['oauth_signature'])) {
         unset($encodedParams['oauth_signature']);
     }
     $baseStrings[] = Zend_Oauth_Http_Utility::urlEncode($this->_toByteValueOrderedQueryString($encodedParams));
     return implode('&', $baseStrings);
 }
開發者ID:GerDner,項目名稱:luck-docker,代碼行數:28,代碼來源:SignatureAbstract.php

示例2: _toAuthorizationHeader

 /**
  * Generates a valid OAuth Authorization header based on the provided
  * parameters and realm.
  *
  * @param  array $params
  * @param  string $realm
  * @return string
  */
 protected function _toAuthorizationHeader(array $params, $realm = null)
 {
     $headerValue = array();
     $headerValue[] = 'OAuth realm="' . $realm . '"';
     foreach ($params as $key => $value) {
         if (!preg_match("/^oauth_/", $key)) {
             continue;
         }
         $headerValue[] = Zend_Oauth_Http_Utility::urlEncode($key) . '="' . Zend_Oauth_Http_Utility::urlEncode($value) . '"';
     }
     return implode(",", $headerValue);
 }
開發者ID:bizanto,項目名稱:Hooked,代碼行數:20,代碼來源:Http.php

示例3: testUrlEncodeCorrectlyEncodesU3001

 public function testUrlEncodeCorrectlyEncodesU3001()
 {
     $string = '、';
     $this->assertEquals('%E3%80%81', Zend_Oauth_Http_Utility::urlEncode($string));
 }
開發者ID:netvlies,項目名稱:zf,代碼行數:5,代碼來源:UtilityTest.php

示例4: getOauthHeader

 /**
  * Get OAuth 'Authentication' header string
  *
  * @return string
  */
 public function getOauthHeader()
 {
     $this->_oauthParams['oauth_timestamp'] = time();
     $this->_oauthParams['oauth_nonce'] = md5(uniqid(rand(), true));
     // http://oauth.googlecode.com/svn/spec/ext/body_hash/1.0/drafts/5/spec.html
     // Haven't fully implemented that spec, but the idea is the same.
     // TODO: The server should validate this hash to be more secure
     $this->_oauthParams['oauth_body_hash'] = $this->_getRequestHash();
     $this->_generateOauthSignature('POST');
     $headerValue = array();
     foreach ($this->_oauthParams as $key => $value) {
         $headerValue[] = Zend_Oauth_Http_Utility::urlEncode($key) . '="' . Zend_Oauth_Http_Utility::urlEncode($value) . '"';
     }
     return implode(",", $headerValue);
 }
開發者ID:EvanDotPro,項目名稱:cosmos,代碼行數:20,代碼來源:Request.php


注:本文中的Zend_Oauth_Http_Utility::urlEncode方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。