LTI Integration Library 5.1.4
PHP class library for building LTI integrations
 
Loading...
Searching...
No Matches
OAuthUtil Class Reference

Class to provide OAuth utility methods. More...

Static Public Member Functions

static array string urlencode_rfc3986 (mixed $input)
 URL encode.
 
static string urldecode_rfc3986 (string $string)
 URL decode.
 
static array split_header (string $header, bool $only_allow_oauth_parameters=true)
 Utility function for turning the Authorization: header into parameters, has to do some unescaping.
 
static array get_headers ()
 Helper to try to sort out headers for people who aren't running apache.
 
static array parse_parameters (?string $input)
 Parse parameters.
 
static string build_http_query (?array $params)
 Build HTTP query string.
 
static array array_merge_recursive (array $array1, array $array2)
 Recursively merge two arrays.
 

Detailed Description

Class to provide OAuth utility methods.

Version
2008-08-04
Licence: https://opensource.org/licenses/MIT The MIT License

Member Function Documentation

◆ array_merge_recursive()

static array array_merge_recursive ( array $array1,
array $array2 )
static

Recursively merge two arrays.

Parameters
array$array1First array
array$array2Second array
Returns
array

Referenced by OAuthRequest\from_request().

◆ build_http_query()

static string build_http_query ( ?array $params)
static

Build HTTP query string.

Parameters
array | null$paramsArray of parameters
Returns
string

Referenced by OAuthRequest\get_normalized_http_method().

◆ get_headers()

static array get_headers ( )
static

Helper to try to sort out headers for people who aren't running apache.

Returns
array

Referenced by OAuthRequest\from_request().

◆ parse_parameters()

static array parse_parameters ( ?string $input)
static

Parse parameters.

This function takes a input like a=b&a=c&d=e and returns the parsed parameters like this ['a' => ['b','c'], 'd' => 'e']

Parameters
string | null$inputParameter string to be parsed
Returns
array

References OAuthUtil\urlencode_rfc3986().

Referenced by OAuthRequest\from_request().

◆ split_header()

static array split_header ( string $header,
bool $only_allow_oauth_parameters = true )
static

Utility function for turning the Authorization: header into parameters, has to do some unescaping.

Can filter out any non-oauth parameters if needed (default behaviour) May 28th, 2010 - method updated to tjerk.meesters for a speed improvement. see http://code.google.com/p/oauth/issues/detail?id=163

Parameters
string$headerHeader value
bool$only_allow_oauth_parametersTrue if only OAuth parameters are allowed
Returns
array

Referenced by OAuthRequest\from_request().

◆ urldecode_rfc3986()

static string urldecode_rfc3986 ( string $string)
static

URL decode.

This decode function isn't taking into consideration the above modifications to the encoding process. However, this method doesn't seem to be used anywhere so leaving it as is.

Parameters
string$stringString to be decoded
Returns
string

Referenced by OAuthUtil\urlencode_rfc3986().

◆ urlencode_rfc3986()

static array string urlencode_rfc3986 ( mixed $input)
static

URL encode.

Parameters
mixed$inputValue to be encoded
Returns
array|string

References OAuthUtil\urldecode_rfc3986().

Referenced by OAuthRequest\get_normalized_http_url(), and OAuthUtil\parse_parameters().