mediawiki/oauthclient-php
PHP OAuth client to use with Wikipedia and other MediaWiki-based wikis running the OAuth extension.
Loading...
Searching...
No Matches
MediaWiki\OAuthClient\Request Class Reference

An OAuth request. More...

Public Member Functions

 __construct ( $method, $url, $parameters=null)
 
 setParameter ( $name, $value, $allow_duplicates=true)
 
 getParameter ( $name)
 
 getParameters ()
 
 unsetParameter ( $name)
 
 getSignableParameters ()
 The request parameters, sorted and concatenated into a normalized string.
 
 getSignatureBaseString ()
 Returns the base string of this request.
 
 getNormalizedMethod ()
 
 getNormalizedUrl ()
 Parses the url and rebuilds it to be scheme://host/path.
 
 toUrl ()
 Builds a url usable for a GET request.
 
 toPostData ()
 Builds the data one would send in a POST request.
 
 toHeader ( $realm=null)
 Builds the Authorization: header.
 
 __toString ()
 
 signRequest (SignatureMethod $signature_method, Consumer $consumer, ?Token $token=null)
 
 buildSignature (SignatureMethod $signature_method, Consumer $consumer, ?Token $token=null)
 

Static Public Member Functions

static fromRequest ( $method=null, $url=null, ?array $params=null)
 Attempt to build up a request from what was passed to the server.
 
static fromConsumerAndToken (Consumer $consumer, ?Token $token, $method, $url, ?array $parameters=null)
 

Static Public Attributes

static $version = '1.0'
 
static $POST_INPUT = 'php://input'
 

Protected Attributes

 $parameters
 
 $method
 
 $url
 

Detailed Description

An OAuth request.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\OAuthClient\Request::__construct ( $method,
$url,
$parameters = null )
Parameters
string$method
string$url
array | null$parameters

Member Function Documentation

◆ buildSignature()

MediaWiki\OAuthClient\Request::buildSignature ( SignatureMethod $signature_method,
Consumer $consumer,
?Token $token = null )
Parameters
SignatureMethod$signature_method
Consumer$consumer
Token | null$token
Returns
mixed

◆ fromConsumerAndToken()

static MediaWiki\OAuthClient\Request::fromConsumerAndToken ( Consumer $consumer,
?Token $token,
$method,
$url,
?array $parameters = null )
static
Parameters
Consumer$consumer
Token | null$token
string$method
string$url
array | null$parameters
Returns
Request

◆ fromRequest()

static MediaWiki\OAuthClient\Request::fromRequest ( $method = null,
$url = null,
?array $params = null )
static

Attempt to build up a request from what was passed to the server.

Parameters
string | null$method
string | null$url
array | null$params
Returns
Request

◆ getNormalizedMethod()

MediaWiki\OAuthClient\Request::getNormalizedMethod ( )
Returns
string

◆ getNormalizedUrl()

MediaWiki\OAuthClient\Request::getNormalizedUrl ( )

Parses the url and rebuilds it to be scheme://host/path.

Returns
string

◆ getParameter()

MediaWiki\OAuthClient\Request::getParameter ( $name)
Parameters
string$name
Returns
mixed

◆ getParameters()

MediaWiki\OAuthClient\Request::getParameters ( )
Returns
array

◆ getSignableParameters()

MediaWiki\OAuthClient\Request::getSignableParameters ( )

The request parameters, sorted and concatenated into a normalized string.

Returns
string

◆ getSignatureBaseString()

MediaWiki\OAuthClient\Request::getSignatureBaseString ( )

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

Returns
string

◆ setParameter()

MediaWiki\OAuthClient\Request::setParameter ( $name,
$value,
$allow_duplicates = true )
Parameters
string$name
string$value
bool$allow_duplicates

◆ signRequest()

MediaWiki\OAuthClient\Request::signRequest ( SignatureMethod $signature_method,
Consumer $consumer,
?Token $token = null )
Parameters
SignatureMethod$signature_method
Consumer$consumer
Token | null$token

◆ toHeader()

MediaWiki\OAuthClient\Request::toHeader ( $realm = null)

Builds the Authorization: header.

Parameters
string | null$realm
Returns
string

◆ toPostData()

MediaWiki\OAuthClient\Request::toPostData ( )

Builds the data one would send in a POST request.

Returns
string

◆ toUrl()

MediaWiki\OAuthClient\Request::toUrl ( )

Builds a url usable for a GET request.

Returns
string

◆ unsetParameter()

MediaWiki\OAuthClient\Request::unsetParameter ( $name)
Parameters
string$name

The documentation for this class was generated from the following file: