本文整理汇总了PHP中OAuthRequest::build_signature方法的典型用法代码示例。如果您正苦于以下问题:PHP OAuthRequest::build_signature方法的具体用法?PHP OAuthRequest::build_signature怎么用?PHP OAuthRequest::build_signature使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OAuthRequest
的用法示例。
在下文中一共展示了OAuthRequest::build_signature方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: request
function request($url, $extra = array(), $force_post = false)
{
$oauth = array('oauth_version' => OAuthRequest::$version, 'oauth_nonce' => OAuthRequest::generate_nonce(), 'oauth_timestamp' => OAuthRequest::generate_timestamp(), 'oauth_consumer_key' => $this->consumer->key, 'oauth_token' => $this->access_token->key, 'oauth_signature_method' => $this->oa_method->get_name());
if (isset($extra['post'])) {
$params = $extra['post'];
} elseif (isset($extra['get'])) {
$params = $extra['get'];
} else {
$params = array();
}
if (isset($extra['post']) || $force_post) {
$method = 'POST';
} else {
$method = 'GET';
}
$params = array_merge($params, $oauth);
$request = new OAuthRequest($method, $url, $params);
$params['oauth_signature'] = $request->build_signature($this->oa_method, $this->consumer, $this->access_token);
$extra[strtolower($method)] = $params;
return parent::request($url, $extra, $force_post);
}