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