|
Moodle
2.2.1
http://www.collinsharper.com
|

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 | |
Definition at line 42 of file oauthlib.php.
| __construct | ( | $ | args | ) |
Contructor for oauth_helper. Subclass can override construct to build its own $this->http
| array | $args | requires 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.
shortcut to start http get request
Definition at line 282 of file oauthlib.php.

| get_access_token | ( | $ | token, |
| $ | secret, | ||
| $ | verifier = '' |
||
| ) |
Request oauth access token from server
| string | $method | |
| string | $url | |
| string | $token | |
| string | $secret |
Definition at line 247 of file oauthlib.php.


| get_nonce | ( | ) |
Generate nonce for oauth request
Definition at line 340 of file oauthlib.php.

| 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"
| array | $param |
Definition at line 120 of file oauthlib.php.

| get_timestamp | ( | ) |
Generate timestamp
Definition at line 329 of file oauthlib.php.

| parse_result | ( | $ | str | ) |
A method to parse oauth response to get oauth_token and oauth_token_secret
| string | $str |
Definition at line 298 of file oauthlib.php.

shortcut to start http post request
Definition at line 289 of file oauthlib.php.

| 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
| string | $url | |
| string | $token | |
| string | $http_method |
Definition at line 170 of file oauthlib.php.


Request oauth protected resources
| string | $method | |
| string | $url | |
| string | $token | |
| string | $secret |
Definition at line 264 of file oauthlib.php.


| request_token | ( | ) |
Request token for authentication This is the first step to use OAuth, it will return oauth_token and oauth_token_secret
Definition at line 206 of file oauthlib.php.


| set_access_token | ( | $ | token, |
| $ | secret | ||
| ) |
Set oauth access token for oauth request
| string | $token | |
| string | $secret |
Definition at line 235 of file oauthlib.php.

| 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 | ) |
| sign | ( | $ | http_method, |
| $ | url, | ||
| $ | params, | ||
| $ | secret | ||
| ) |
Create signature for oauth request
| string | $url | |
| string | $secret | |
| array | $params |
Definition at line 142 of file oauthlib.php.


$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.