本文整理汇总了PHP中OAuth::normalize_params方法的典型用法代码示例。如果您正苦于以下问题:PHP OAuth::normalize_params方法的具体用法?PHP OAuth::normalize_params怎么用?PHP OAuth::normalize_params使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OAuth
的用法示例。
在下文中一共展示了OAuth::normalize_params方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: as_query
/**
* Convert the request parameters into a query string, suitable for GET and
* POST requests.
*
* $query = $request->as_query();
*
* [!!] This method implements [OAuth 1.0 Spec 5.2 (2,3)](http://oauth.net/core/1.0/#rfc.section.5.2).
*
* @param boolean include oauth parameters?
* @param boolean return a normalized string?
* @return string
*/
public function as_query($include_oauth = NULL, $as_string = TRUE)
{
if ($include_oauth === NULL) {
// If we are sending a header, OAuth parameters should not be
// included in the query string.
$include_oauth = !$this->send_header;
}
if ($include_oauth) {
$params = $this->params;
} else {
$params = array();
foreach ($this->params as $name => $value) {
if (strpos($name, 'oauth_') !== 0) {
// This is not an OAuth parameter
$params[$name] = $value;
}
}
}
return $as_string ? OAuth::normalize_params($params) : $params;
}
示例2: as_query
/**
* Convert the request parameters into a query string, suitable for GET and
* POST requests.
*
* $query = $request->as_query();
*
* [!!] This method implements [OAuth 1.0 Spec 5.2 (2,3)](http://oauth.net/core/1.0/#rfc.section.5.2).
*
* @return string
*/
public function as_query()
{
return OAuth::normalize_params($this->params);
}