SproutCMS

This is the code documentation for the SproutCMS project

Page options:

Inherited members

class Request

Get information about the incoming HTTP request.

Variables

NameVisibilityDescription
$accept_types (static) 
$http_methods (static) 

Functions

NameVisibilityDescription
acceptspublic (static)Returns boolean of whether client accepts content type.
acceptsAtQualitypublic (static)Returns quality factor at which the client accepts content type.
getHeaderspublic (static)Get the headers as an array.
isAjaxpublic (static)Tests if the current request is an AJAX request by checking the X-Requested-With HTTP
methodpublic (static)Returns current request method.
parseAcceptHeaderprotected (static)Parses client's HTTP Accept request header, and builds array structure representing it.
preferredAcceptpublic (static)Compare the q values for given array of content types and return the one with the highest value.
protocolpublic (static)Returns the current request protocol, based on $_SERVER['https']. In CLI
referrerpublic (static)Returns the HTTP referrer, or the default if the referrer is not set.
userIppublic (static)Returns the users IP address, accounting for proxy forwarding

public accepts

boolean Request::accepts ( [ string $type [, boolean $explicit_check ]] );

Returns boolean of whether client accepts content type.

public acceptsAtQuality

integer|float Request::acceptsAtQuality ( [ string $type [, boolean $explicit_check ]] );

Returns quality factor at which the client accepts content type.

public getHeaders

array Request::getHeaders ( );

Get the headers as an array.

All keys are lowercase.

public isAjax

boolean Request::isAjax ( );

Tests if the current request is an AJAX request by checking the X-Requested-With HTTP
request header that most popular JS frameworks now set for AJAX calls.

public method

string Request::method ( );

Returns current request method.

protected parseAcceptHeader

void Request::parseAcceptHeader ( );

Parses client's HTTP Accept request header, and builds array structure representing it.

public preferredAccept

mixed Request::preferredAccept ( array $types [, boolean $explicit_check ] );

Compare the q values for given array of content types and return the one with the highest value.
If items are found to have the same q value, the first one encountered in the given array wins.
If all items in the given array have a q value of 0, FALSE is returned.

public protocol

string Request::protocol ( );

Returns the current request protocol, based on $_SERVER['https']. In CLI
mode, NULL will be returned.

public referrer

string Request::referrer ( [ mixed $default ] );

Returns the HTTP referrer, or the default if the referrer is not set.

public userIp

unknown Request::userIp ( );

Returns the users IP address, accounting for proxy forwarding