public static function from_consumer_and_token($consumer, $token, $http_method, $http_url, $parameters = NULL) { @$parameters or $parameters = array(); $defaults = array("oauth_version" => viwptf_OAuthRequest::$version, "oauth_nonce" => viwptf_OAuthRequest::generate_nonce(), "oauth_timestamp" => viwptf_OAuthRequest::generate_timestamp(), "oauth_consumer_key" => $consumer->key); if ($token) { $defaults['oauth_token'] = $token->key; } $parameters = array_merge($defaults, $parameters); return new viwptf_OAuthRequest($http_method, $http_url, $parameters); }