Class to represent an OAuth request.
More...
|
static string | $version = '1.0' |
| Version.
|
|
static string | $POST_INPUT = 'php://input' |
| Access to POST data.
|
|
Class to represent an OAuth request.
- Copyright
- Andy Smith (http://oauth.googlecode.com/svn/code/php/)
- Version
- 2008-08-04
- Licence: https://opensource.org/licenses/MIT The MIT License
◆ __construct()
ceLTIc\LTI\OAuth\OAuthRequest::__construct |
( |
string | $http_method, |
|
|
string | $http_url, |
|
|
?array | $parameters = null ) |
Class constructor.
- Parameters
-
string | $http_method | HTTP method |
string | $http_url | HTTP URL |
array | null | $parameters | Request parameters |
◆ __toString()
string ceLTIc\LTI\OAuth\OAuthRequest::__toString |
( |
| ) |
|
Convert object to a string.
- Returns
- string
◆ build_signature()
Build the signature.
- Parameters
-
OAuthSignatureMethod | $signature_method | Signature method |
OAuthConsumer | $consumer | Consumer |
OAuthToken | null | $token | Token |
- Returns
- string
Referenced by to_header().
◆ from_consumer_and_token()
static OAuthRequest ceLTIc\LTI\OAuth\OAuthRequest::from_consumer_and_token |
( |
OAuthConsumer | $consumer, |
|
|
?OAuthToken | $token, |
|
|
string | $http_method, |
|
|
string | $http_url, |
|
|
?array | $parameters = null ) |
|
static |
Pretty much a helper function to set up the request.
- Parameters
-
OAuthConsumer | $consumer | Consumer |
OAuthToken | null | $token | Token |
string | $http_method | HTTP method |
string | $http_url | HTTP URL |
array | null | $parameters | Request parameters |
- Returns
- OAuthRequest
◆ from_request()
static OAuthRequest ceLTIc\LTI\OAuth\OAuthRequest::from_request |
( |
?string | $http_method = null, |
|
|
?string | $http_url = null, |
|
|
?array | $parameters = null ) |
|
static |
◆ get_normalized_http_method()
string ceLTIc\LTI\OAuth\OAuthRequest::get_normalized_http_method |
( |
| ) |
|
◆ get_normalized_http_url()
string ceLTIc\LTI\OAuth\OAuthRequest::get_normalized_http_url |
( |
| ) |
|
◆ get_parameter()
string array null ceLTIc\LTI\OAuth\OAuthRequest::get_parameter |
( |
string | $name | ) |
|
◆ get_parameters()
array ceLTIc\LTI\OAuth\OAuthRequest::get_parameters |
( |
| ) |
|
◆ get_signable_parameters()
string ceLTIc\LTI\OAuth\OAuthRequest::get_signable_parameters |
( |
| ) |
|
The request parameters, sorted and concatenated into a normalized string.
- Returns
- string
Referenced by get_parameters().
◆ get_signature_base_string()
string ceLTIc\LTI\OAuth\OAuthRequest::get_signature_base_string |
( |
| ) |
|
Returns the base string of this request.
The base string defined as the method, the url and the parameters (normalized), each urlencoded and then concatenated with &.
- Returns
- string
◆ set_parameter()
void ceLTIc\LTI\OAuth\OAuthRequest::set_parameter |
( |
string | $name, |
|
|
string | $value, |
|
|
bool | $allow_duplicates = true ) |
Set a parameter.
- Parameters
-
string | $name | Parameter name |
string | $value | Parameter value |
bool | $allow_duplicates | True if duplicates are allowed |
Referenced by to_header().
◆ sign_request()
Sign the request.
- Parameters
-
OAuthSignatureMethod | $signature_method | Signature method |
OAuthConsumer | $consumer | Consumer |
OAuthToken | null | $token | Token |
◆ to_header()
string ceLTIc\LTI\OAuth\OAuthRequest::to_header |
( |
?string | $realm = null | ) |
|
◆ to_postdata()
string ceLTIc\LTI\OAuth\OAuthRequest::to_postdata |
( |
| ) |
|
Builds the data one would send in a POST request.
- Returns
- string
References to_url().
◆ to_url()
string ceLTIc\LTI\OAuth\OAuthRequest::to_url |
( |
| ) |
|
Builds a url usable for a GET request.
- Returns
- string
Referenced by to_postdata().
◆ unset_parameter()
void ceLTIc\LTI\OAuth\OAuthRequest::unset_parameter |
( |
string | $name | ) |
|
Delete a parameter.
- Parameters
-
string | $name | Parameter name |
◆ $base_string
string ceLTIc\LTI\OAuth\OAuthRequest::$base_string |
◆ $http_method
string ceLTIc\LTI\OAuth\OAuthRequest::$http_method |
|
protected |
◆ $http_url
string ceLTIc\LTI\OAuth\OAuthRequest::$http_url |
|
protected |
◆ $parameters
array ceLTIc\LTI\OAuth\OAuthRequest::$parameters |
|
protected |
◆ $POST_INPUT
string ceLTIc\LTI\OAuth\OAuthRequest::$POST_INPUT = 'php://input' |
|
static |
◆ $version
string ceLTIc\LTI\OAuth\OAuthRequest::$version = '1.0' |
|
static |