\OAuth2Request

OAuth2\Request This class is taken from the Symfony2 Framework and is part of the Symfony package.

See Symfony\Component\HttpFoundation\Request (https://github.com/symfony/symfony)

Summary

Methods
Properties
Constants
__construct()
initialize()
query()
request()
server()
headers()
getAllQueryParameters()
getContent()
createFromGlobals()
$attributes
$request
$query
$server
$files
$cookies
$headers
$content
No constants found
No protected methods found
No protected properties found
N/A
getHeadersFromServer()
No private properties found
N/A

Properties

$attributes

$attributes : 

Type

$request

$request : 

Type

$query

$query : 

Type

$server

$server : 

Type

$files

$files : 

Type

$cookies

$cookies : 

Type

$headers

$headers : 

Type

$content

$content : 

Type

Methods

__construct()

__construct(array  $query = array(), array  $request = array(), array  $attributes = array(), array  $cookies = array(), array  $files = array(), array  $server = array(), string  $content = null, array  $headers = null) 

Constructor.

Parameters

array $query
  • The GET parameters
array $request
  • The POST parameters
array $attributes
  • The request attributes (parameters parsed from the PATH_INFO, ...)
array $cookies
  • The COOKIE parameters
array $files
  • The FILES parameters
array $server
  • The SERVER parameters
string $content
  • The raw body data
array $headers
  • The headers

initialize()

initialize(array  $query = array(), array  $request = array(), array  $attributes = array(), array  $cookies = array(), array  $files = array(), array  $server = array(), string  $content = null, array  $headers = null) 

Sets the parameters for this request.

This method also re-initializes all properties.

Parameters

array $query
  • The GET parameters
array $request
  • The POST parameters
array $attributes
  • The request attributes (parameters parsed from the PATH_INFO, ...)
array $cookies
  • The COOKIE parameters
array $files
  • The FILES parameters
array $server
  • The SERVER parameters
string $content
  • The raw body data
array $headers
  • The headers

query()

query(string  $name, mixed  $default = null) : mixed

Parameters

string $name
mixed $default

Returns

mixed

request()

request(string  $name, mixed  $default = null) : mixed

Parameters

string $name
mixed $default

Returns

mixed

server()

server(string  $name, mixed  $default = null) : mixed

Parameters

string $name
mixed $default

Returns

mixed

headers()

headers(string  $name, mixed  $default = null) : mixed

Parameters

string $name
mixed $default

Returns

mixed

getAllQueryParameters()

getAllQueryParameters() : array

Returns

array

getContent()

getContent(boolean  $asResource = false) : string|resource

Returns the request body content.

Parameters

boolean $asResource
  • If true, a resource will be returned

Throws

\LogicException

Returns

string|resource —
  • The request body content or a resource to read the body stream.

createFromGlobals()

createFromGlobals() : \OAuth2\Request

Creates a new request with values from PHP's super globals.

Returns

\OAuth2\Request
  • A new request

getHeadersFromServer()

getHeadersFromServer(array  $server) : array

Parameters

array $server

Returns

array