You are here

public static function OAuthRequest::from_consumer_and_token in OAuth 1.0 6

Same name and namespace in other branches
  1. 6.3 lib/OAuth.php \OAuthRequest::from_consumer_and_token()
  2. 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()
oauth_request_call_submit in ./oauth.module

File

./OAuth.php, line 221

Class

OAuthRequest

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);
}