Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.10.x will end 8 November 2021 (12 months).
  • Bug fixes for security issues in 3.10.x will end 9 May 2022 (18 months).
  • PHP version: minimum PHP 7.2.0 Note: minimum PHP version has increased since Moodle 3.8. PHP 7.3.x and 7.4.x are supported too.

Differences Between: [Versions 310 and 401] [Versions 310 and 402] [Versions 310 and 403]

(no description)

File Size: 282 lines (9 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: OAuthRequest  - X-Ref

Class to represent an %OAuth Request

__construct($http_method, $http_url, $parameters = null)   X-Ref
No description

from_request($http_method = null, $http_url = null, $parameters = null)   X-Ref
attempt to build up a request from what was passed to the server


from_consumer_and_token($consumer, $token, $http_method, $http_url, $parameters = null)   X-Ref
pretty much a helper function to set up the request


set_parameter($name, $value, $allow_duplicates = true)   X-Ref
No description

get_parameter($name)   X-Ref
No description

get_parameters()   X-Ref
No description

unset_parameter($name)   X-Ref
No description

get_signable_parameters()   X-Ref
The request parameters, sorted and concatenated into a normalized string.

return: string

get_signature_base_string()   X-Ref
Returns the base string of this request

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

get_normalized_http_method()   X-Ref
just uppercases the http method


get_normalized_http_url()   X-Ref
parses the url and rebuilds it to be
scheme://host/path


to_url()   X-Ref
builds a url usable for a GET request


to_postdata()   X-Ref
builds the data one would send in a POST request


to_header($realm = null)   X-Ref
builds the Authorization: header


__toString()   X-Ref
No description

sign_request($signature_method, $consumer, $token)   X-Ref
No description

build_signature($signature_method, $consumer, $token)   X-Ref
No description

generate_timestamp()   X-Ref
util function: current timestamp


generate_nonce()   X-Ref
util function: current nonce