Elgg  Version 3.0
Public Member Functions | Public Attributes | Protected Attributes | List of all members
Elgg\Http\Request Class Reference

Elgg HTTP request. More...

Inheritance diagram for Elgg\Http\Request:

Public Member Functions

 __construct (array $query=[], array $request=[], array $attributes=[], array $cookies=[], array $files=[], array $server=[], $content=null)
 {} More...
 
 initializeContext ()
 Initialize context stack. More...
 
 getContextStack ()
 Returns context stack. More...
 
 setRoute (Route $route)
 Sets the route matched for this request by the router. More...
 
 getRoute ()
 Returns the route matched for this request by the router. More...
 
 setParam ($key, $value, $override_request=false)
 Sets an input value that may later be retrieved by get_input. More...
 
 getParam ($key, $default=null, $filter_result=true)
 Get some input from variables passed submitted through GET or POST. More...
 
 getParams ($filter_result=true)
 Returns all values parsed from the request. More...
 
 getCurrentURL ()
 Returns current page URL. More...
 
 getUrlSegments ($raw=false)
 Get the Elgg URL segments. More...
 
 setUrlSegments (array $segments)
 Get a cloned request with new Elgg URL segments. More...
 
 getFirstUrlSegment ()
 Get first Elgg URL segment. More...
 
 getElggPath ()
 Get the Request URI minus querystring. More...
 
 getClientIp ()
 {} More...
 
 isXmlHttpRequest ()
 {} More...
 
 sniffElggUrl ()
 Sniff the Elgg site URL with trailing slash. More...
 
 isRewriteCheck ()
 Is the request for checking URL rewriting? More...
 
 isCliServer ()
 Is PHP running the CLI server front controller. More...
 
 isCliServable ($root)
 Is the request pointing to a file that the CLI server can handle? More...
 
 getFiles ($input_name)
 Returns an array of uploaded file objects regardless of upload status/errors. More...
 
 getFile ($input_name, $check_for_validity=true)
 Returns the first file found based on the input name. More...
 
 validate ()
 Validate the request. More...
 

Public Attributes

const REWRITE_TEST_TOKEN = '__testing_rewrite'
 
const REWRITE_TEST_OUTPUT = 'success'
 

Protected Attributes

 $context_stack
 
 $route
 
 $request_overrides
 @ var array More...
 

Detailed Description

Elgg HTTP request.

Definition at line 17 of file Request.php.

Constructor & Destructor Documentation

Elgg\Http\Request::__construct ( array  $query = [],
array  $request = [],
array  $attributes = [],
array  $cookies = [],
array  $files = [],
array  $server = [],
  $content = null 
)

{}

Definition at line 40 of file Request.php.

Member Function Documentation

Elgg\Http\Request::getClientIp ( )

{}

Definition at line 265 of file Request.php.

Elgg\Http\Request::getContextStack ( )

Returns context stack.

Returns
Context

Definition at line 71 of file Request.php.

Elgg\Http\Request::getCurrentURL ( )

Returns current page URL.

Returns
string

Definition at line 181 of file Request.php.

Elgg\Http\Request::getElggPath ( )

Get the Request URI minus querystring.

Returns
string

Definition at line 252 of file Request.php.

Elgg\Http\Request::getFile (   $input_name,
  $check_for_validity = true 
)

Returns the first file found based on the input name.

Parameters
string$input_nameForm input name
bool$check_for_validityIf there is an uploaded file, is it required to be valid
Returns
UploadedFile|false

Definition at line 390 of file Request.php.

Elgg\Http\Request::getFiles (   $input_name)

Returns an array of uploaded file objects regardless of upload status/errors.

Parameters
string$input_nameForm input name
Returns
UploadedFile[]

Definition at line 369 of file Request.php.

Elgg\Http\Request::getFirstUrlSegment ( )

Get first Elgg URL segment.

See also
::getUrlSegments()
Returns
string

Definition at line 238 of file Request.php.

Elgg\Http\Request::getParam (   $key,
  $default = null,
  $filter_result = true 
)

Get some input from variables passed submitted through GET or POST.

If using any data obtained from get_input() in a web page, please be aware that it is a possible vector for a reflected XSS attack. If you are expecting an integer, cast it to an int. If it is a string, escape quotes.

Note: this function does not handle nested arrays (ex: form input of param[m][n]) because of the filtering done in htmlawed from the filter_tags call.

Parameters
string$keyThe variable name we want.
mixed$defaultA default value for the variable if it is not found.
bool$filter_resultIf true, then the result is filtered for bad tags.
Returns
mixed

Definition at line 137 of file Request.php.

Elgg\Http\Request::getParams (   $filter_result = true)

Returns all values parsed from the request.

Parameters
bool$filter_resultSanitize input values
Returns
array

Definition at line 157 of file Request.php.

Elgg\Http\Request::getRoute ( )

Returns the route matched for this request by the router.

Returns
Route|null

Definition at line 95 of file Request.php.

Elgg\Http\Request::getUrlSegments (   $raw = false)

Get the Elgg URL segments.

Parameters
bool$rawIf true, the segments will not be HTML escaped
Returns
string[]

Definition at line 204 of file Request.php.

Elgg\Http\Request::initializeContext ( )

Initialize context stack.

Returns
static

Definition at line 60 of file Request.php.

Elgg\Http\Request::isCliServable (   $root)

Is the request pointing to a file that the CLI server can handle?

Parameters
string$rootRoot directory
Returns
bool

Definition at line 342 of file Request.php.

Elgg\Http\Request::isCliServer ( )

Is PHP running the CLI server front controller.

Returns
bool

Definition at line 331 of file Request.php.

Elgg\Http\Request::isRewriteCheck ( )

Is the request for checking URL rewriting?

Returns
bool

Definition at line 314 of file Request.php.

Elgg\Http\Request::isXmlHttpRequest ( )

{}

Definition at line 284 of file Request.php.

Elgg\Http\Request::setParam (   $key,
  $value,
  $override_request = false 
)

Sets an input value that may later be retrieved by get_input.

Note: this function does not handle nested arrays (ex: form input of param[m][n])

Parameters
string$keyThe name of the variable
string|string[]$value The value of the variable
bool$override_requestThe variable should override request values (default: false)
Returns
static

Definition at line 110 of file Request.php.

Elgg\Http\Request::setRoute ( Route  $route)

Sets the route matched for this request by the router.

Parameters
Route$routeRoute
Returns
static

Definition at line 82 of file Request.php.

Elgg\Http\Request::setUrlSegments ( array  $segments)

Get a cloned request with new Elgg URL segments.

Parameters
string[]$segments URL segments
Returns
Request

Definition at line 223 of file Request.php.

Elgg\Http\Request::sniffElggUrl ( )

Sniff the Elgg site URL with trailing slash.

Returns
string

Definition at line 296 of file Request.php.

Elgg\Http\Request::validate ( )

Validate the request.

Returns
void
Exceptions
HttpException

Definition at line 414 of file Request.php.

Member Data Documentation

Elgg\Http\Request::$context_stack
protected

Definition at line 25 of file Request.php.

Elgg\Http\Request::$request_overrides
protected

@ var array

Definition at line 35 of file Request.php.

Elgg\Http\Request::$route
protected

Definition at line 30 of file Request.php.

const Elgg\Http\Request::REWRITE_TEST_OUTPUT = 'success'

Definition at line 20 of file Request.php.

const Elgg\Http\Request::REWRITE_TEST_TOKEN = '__testing_rewrite'

Definition at line 19 of file Request.php.


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