public static function OAuthRequest::from_consumer_and_token in OAuth 1.0 6
Same name and namespace in other branches
- 6.3 lib/OAuth.php \OAuthRequest::from_consumer_and_token()
- 7.3 lib/OAuth.php \OAuthRequest::from_consumer_and_token()
pretty much a helper function to set up the request
1 call to OAuthRequest::from_consumer_and_token()
File
- ./
OAuth.php, line 221
Class
Code
public static function from_consumer_and_token($consumer, $token, $http_method, $http_url, $parameters = NULL) {
/*{{{*/
@$parameters or $parameters = array();
$defaults = array(
"oauth_version" => OAuthRequest::$version,
"oauth_nonce" => OAuthRequest::generate_nonce(),
"oauth_timestamp" => OAuthRequest::generate_timestamp(),
"oauth_consumer_key" => $consumer->key,
);
$parameters = array_merge($defaults, $parameters);
if ($token) {
$parameters['oauth_token'] = $token->key;
}
return new OAuthRequest($http_method, $http_url, $parameters);
}