CommonSense PHP API Library
OAuthRequest Class Reference

List of all members.

Public Member Functions

 __construct ($httpMethod, $httpUrl, $parameters=null)
 setParameter ($name, $value, $allow_duplicates=true)
 getParameter ($name)
 getParameters ()
 unsetParameter ($name)
 getSignableParameters ()
 getSignatureBaseString ()
 getNormalizedHttpMethod ()
 getNormalizedHttpUrl ()
 toUrl ()
 toPostData ()
 toHeader ($realm=null)
 __toString ()
 signRequest ($signatureMethod, $consumer, $token)
 buildSignature ($signatureMethod, $consumer, $token)

Static Public Member Functions

static fromRequest ($httpMethod=null, $httpUrl=null, $parameters=null)
static fromConsumerAndToken ($consumer, $token, $httpMethod, $httpUrl, $parameters=null)

Public Attributes

 $baseString

Static Public Attributes

static $version = "1.0"
static $POST_INPUT = "php://input"

Constructor & Destructor Documentation

OAuthRequest::__construct ( httpMethod,
httpUrl,
parameters = null 
)

Member Function Documentation

OAuthRequest::buildSignature ( signatureMethod,
consumer,
token 
)
static OAuthRequest::fromConsumerAndToken ( consumer,
token,
httpMethod,
httpUrl,
parameters = null 
) [static]

pretty much a helper function to set up the request

static OAuthRequest::fromRequest ( httpMethod = null,
httpUrl = null,
parameters = null 
) [static]

Creates an OAuthRequest from the request passed to the server.

attempt to build up a request from what was passed to the server

Returns:
OAuthRequest

just uppercases the http method

parses the url and rebuilds it to be scheme://host/path

The request parameters, sorted and concatenated into a normalized string.

Returns:
string

Returns the base string of this request.

The base string defined as the method, the url and the parameters (normalized), each urlencoded and concated with &.

OAuthRequest::setParameter ( name,
value,
allow_duplicates = true 
)
OAuthRequest::signRequest ( signatureMethod,
consumer,
token 
)
OAuthRequest::toHeader ( realm = null)

builds the Authorization: header

builds the data one would send in a POST request

builds a url usable for a GET request


Member Data Documentation

OAuthRequest::$baseString
OAuthRequest::$POST_INPUT = "php://input" [static]
OAuthRequest::$version = "1.0" [static]

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables