当前位置: 首页>>代码示例>>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;未经允许,请勿转载。