本文整理匯總了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);
}