Moodle  2.2.1
http://www.collinsharper.com
oauth_helper Class Reference
Inheritance diagram for oauth_helper:

Public Member Functions

 __construct ($args)
 get_signable_parameters ($params)
 sign ($http_method, $url, $params, $secret)
 prepare_oauth_parameters ($url, $params, $http_method= 'POST')
 setup_oauth_http_header ($params)
 request_token ()
 set_access_token ($token, $secret)
 get_access_token ($token, $secret, $verifier='')
 request ($method, $url, $params=array(), $token='', $secret='')
 get ($url, $params=array(), $token='', $secret='')
 post ($url, $params=array(), $token='', $secret='')
 parse_result ($str)
 set_nonce ($str)
 set_timestamp ($time)
 get_timestamp ()
 get_nonce ()

Protected Attributes

 $consumer_key
 $consumer_secret
 $api_root
 $request_token_api
 $authorize_url
 $http_method
 $access_token_api
 $http

Detailed Description

Definition at line 42 of file oauthlib.php.


Constructor & Destructor Documentation

__construct ( args)

Contructor for oauth_helper. Subclass can override construct to build its own $this->http

Parameters:
array$argsrequires at least three keys, oauth_consumer_key oauth_consumer_secret and api_root, oauth_helper will guess request_token_api, authrize_url and access_token_api based on api_root, but it not always works

Reimplemented in dropbox.

Definition at line 68 of file oauthlib.php.


Member Function Documentation

get ( url,
params = array(),
token = '',
secret = '' 
)

shortcut to start http get request

Definition at line 282 of file oauthlib.php.

Here is the call graph for this function:

get_access_token ( token,
secret,
verifier = '' 
)

Request oauth access token from server

Parameters:
string$method
string$url
string$token
string$secret

Definition at line 247 of file oauthlib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

get_nonce ( )

Generate nonce for oauth request

Definition at line 340 of file oauthlib.php.

Here is the caller graph for this function:

get_signable_parameters ( params)

Build parameters list: oauth_consumer_key="0685bd9184jfhq22", oauth_nonce="4572616e48616d6d65724c61686176", oauth_token="ad180jjd733klru7", oauth_signature_method="HMAC-SHA1", oauth_signature="wOJIO9A2W5mFwDgiDvZbTSMK%2FPY%3D", oauth_timestamp="137131200", oauth_version="1.0" oauth_verifier="1.0"

Parameters:
array$param
Returns:
string

Definition at line 120 of file oauthlib.php.

Here is the caller graph for this function:

Generate timestamp

Definition at line 329 of file oauthlib.php.

Here is the caller graph for this function:

parse_result ( str)

A method to parse oauth response to get oauth_token and oauth_token_secret

Parameters:
string$str
Returns:
array

Definition at line 298 of file oauthlib.php.

Here is the caller graph for this function:

post ( url,
params = array(),
token = '',
secret = '' 
)

shortcut to start http post request

Definition at line 289 of file oauthlib.php.

Here is the call graph for this function:

prepare_oauth_parameters ( url,
params,
http_method = 'POST' 
)

Initilize oauth request parameters, including: oauth_consumer_key="0685bd9184jfhq22", oauth_token="ad180jjd733klru7", oauth_signature_method="HMAC-SHA1", oauth_signature="wOJIO9A2W5mFwDgiDvZbTSMK%2FPY%3D", oauth_timestamp="137131200", oauth_nonce="4572616e48616d6d65724c61686176", oauth_version="1.0" To access protected resources, oauth_token should be defined

Parameters:
string$url
string$token
string$http_method
Returns:
array

Definition at line 170 of file oauthlib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

request ( method,
url,
params = array(),
token = '',
secret = '' 
)

Request oauth protected resources

Parameters:
string$method
string$url
string$token
string$secret

Definition at line 264 of file oauthlib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

Request token for authentication This is the first step to use OAuth, it will return oauth_token and oauth_token_secret

Returns:
array

Definition at line 206 of file oauthlib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

set_access_token ( token,
secret 
)

Set oauth access token for oauth request

Parameters:
string$token
string$secret

Definition at line 235 of file oauthlib.php.

Here is the caller graph for this function:

set_nonce ( str)

Set nonce

Definition at line 317 of file oauthlib.php.

set_timestamp ( time)

Set timestamp

Definition at line 323 of file oauthlib.php.

setup_oauth_http_header ( params)

Definition at line 188 of file oauthlib.php.

Here is the caller graph for this function:

sign ( http_method,
url,
params,
secret 
)

Create signature for oauth request

Parameters:
string$url
string$secret
array$params
Returns:
string

Definition at line 142 of file oauthlib.php.

Here is the call graph for this function:

Here is the caller graph for this function:


Field Documentation

$access_token_api [protected]

Definition at line 55 of file oauthlib.php.

$api_root [protected]

Definition at line 48 of file oauthlib.php.

$authorize_url [protected]

Definition at line 52 of file oauthlib.php.

$consumer_key [protected]

Definition at line 44 of file oauthlib.php.

$consumer_secret [protected]

Definition at line 46 of file oauthlib.php.

$http [protected]

Definition at line 57 of file oauthlib.php.

$http_method [protected]

Definition at line 53 of file oauthlib.php.

$request_token_api [protected]

Definition at line 50 of file oauthlib.php.


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