public
|
#
__construct( string $uri )
Construct the request object setting the base URI.
Construct the request object setting the base URI.
This is the URI excluding the domain name to the installation, e.g. if not using mod_rewrite
and installed at http://www.example.com/testing/index.php then the base URI will be
'/testing/index.php'. The same address using mod_rewrite would be http://www.example.com/testing/
therefore the base URI should be set to '/testing/';
Parameters
|
protected
|
#
_parseURI( string $uri )
Private function to parse the request URI.
Private function to parse the request URI.
Process the request URI to extract the segments that are the path relative to the install.
Parameters
|
public
string
|
#
getBaseUri( boolean $absolute = false, boolean $secure = null )
Get the base URI for generating action URIs.
Get the base URI for generating action URIs.
Parameters
- $absolute
- true to create an absolute URI else false for relative
- $secure
- tue to use https, false for http or null for as per request.
Returns
string The URI.
|
public
string
|
#
getBasePath( boolean $absolute = false, boolean $secure = null )
Get the base URI for generating resource URIs.
Get the base URI for generating resource URIs.
Parameters
- $absolute
- true to create an absolute URI else false for relative
- $secure
- tue to use https, false for http or null for as per request.
Returns
string The URI.
|
public
mixed
|
#
getQuery( string $key, mixed $default = null )
Get the value of a query parameter.
Get the value of a query parameter.
Parameters
- $key
- The parameter to get.
- $default
- The default value to use if the key is not present.
Returns
mixed The value assigned to the key or the value of $default.
|
public
string
|
#
getSelf( boolean $absolute = false, boolean $secure = null )
Get the address of the page.
Get the address of the page.
Parameters
- $absolute
- true to create an absolute URI else false for relative.
- $secure
- tue to use https, false for http or null for as per request.
Returns
string The page address.
|
public
boolean
|
#
hasQuery( string $key )
Test if a query parameter is present.
Test if a query parameter is present.
Parameters
- $key
- The parameter to test.
Returns
boolean true if the parameter is present else false.
|
public
mixed
|
#
getPost( string $key, mixed $default = null )
Get the value of a post parameter.
Get the value of a post parameter.
Parameters
- $key
- The parameter to get.
- $default
- The default value to use if the key is not present.
Returns
mixed The value assigned to the key or the value of $default.
|
public
boolean
|
#
hasPost( string $key )
Test if a post parameter is present.
Test if a post parameter is present.
Parameters
- $key
- The parameter to test.
Returns
boolean true if the parameter is present else false.
|
public
string
|
#
getPutData( )
Get the PUT data.
Returns
string The data sent via PUT.
|
public
mixed
|
#
getParam( string $key, mixed $default = null )
Get the value of a parameter, checks in the order: internal, $_POST, $_GET
Get the value of a parameter, checks in the order: internal, $_POST, $_GET
Parameters
- $key
- The parameter to get.
- $default
- The default value to use if the key is not present.
Returns
mixed The value assigned to the key or the value of $default.
|
public
array
|
#
getParams( )
Get all the parameters.
Returns
array Associative array of parameters and their values.
|
public
flRequest
|
#
setParam( string $key, mixed $value )
Set the value of a parameter.
Set the value of a parameter.
Parameters
- $key
- The parameter to set.
- $value
- The value to set.
Returns
|
public
boolean
|
#
hasParam( string $key )
Test if a parameter is present.
Test if a parameter is present.
Parameters
- $key
- The parameter to test.
Returns
boolean true if the parameter is present else false.
|
public
string
|
#
getCookie( string $key, string $default = null )
Get the value of a cookie.
Get the value of a cookie.
Parameters
- $key
- The cookie to get.
- $default
- The default value to return if the cookie isn't available.
Returns
string The value of the cookie or $default.
|
public
boolean
|
#
hasCookie( string $key )
Test if the cookie exists.
Test if the cookie exists.
Parameters
- $key
- The cookie to test for.
Returns
boolean true if the cookie is present else false.
|
public
string
|
#
getServerName( )
Get the name of the server.
Get the name of the server.
This is the name of the virtual server that received the request, this may not be the name of the physical server.
Returns
string The server name.
|
public
string
|
#
getServerIp( )
Get the IP of the server.
Get the IP of the server.
Returns
string The server IP.
|
public
string
|
#
getClientIp( )
Get the IP address of the client.
Get the IP address of the client.
Returns
string The client IP address.
|
public
string
|
#
getUserAgent( )
Get the browsers user agent string.
Get the browsers user agent string.
Returns
string The user agent string.
|
public
boolean
|
#
isModRewrite( )
Tests if the install is using mod_rewrite.
Tests if the install is using mod_rewrite.
Returns
boolean true if using mod_rewrite; else false.
|
public
boolean
|
#
isGet( )
Test if GET request.
Returns
boolean true if the request is GET else false.
|
public
boolean
|
#
isPost( )
Test if POST request.
Returns
boolean true if the request is POST else false.
|
public
boolean
|
#
isPut( )
Test if PUT request.
Returns
boolean true if the request is PUT else false.
|
public
boolean
|
#
isDelete( )
Test if DELETE request.
Returns
boolean true if the request is DELETE else false.
|
public
boolean
|
#
isOptions( )
Test if OPTIONS request.
Returns
boolean true if the request is OPTIONS else false.
|
public
boolean
|
#
isHead( )
Test if HEAD request.
Returns
boolean true if the request is HEAD else false.
|
public
boolean
|
#
isSecure( )
Test if the request is over https rather than http.
Test if the request is over https rather than http.
Returns
boolean true if the request is over HTTPS or false for HTTP.
|
public
boolean
|
#
isXmlHttpRequest( )
Test if the request if via AJAX.
Test if the request if via AJAX.
Returns
boolean true if AJAX request else false.
|
public
string
|
#
getReferrer( )
Retrieve the referrer string.
Retrieve the referrer string.
Returns
string The referrer string if any.
|
public
boolean
|
#
isMobile( )
Test if the request came from a mobile device.
Test if the request came from a mobile device.
Returns
boolean true if the request is from a mobile device; else false.
|
public
boolean
|
#
hasFile( string $name )
Test if the named file has been uploaded.
Test if the named file has been uploaded.
Parameters
- $name
- The name of the file to test for.
Returns
boolean true if the file was uploaded or false if the file was not uploaded for any reason.
|
public
integer
|
#
getFileError( string $name )
Get the error if any for an uploaded file.
Get the error if any for an uploaded file.
Parameters
- $name
- The name of the file to return information for.
Returns
integer The error code one of flRequest::UPLOAD*
|
public
string
|
#
getTmpFileName( string $name )
Get the temporary file name an uploaded file.
Get the temporary file name an uploaded file.
Parameters
- $name
- The name of the file to return.
Returns
string The name of the temporary file or false if the file was not uploaded.
|
public
string
|
#
getFileName( string $name )
Get the file name an uploaded file.
Get the file name an uploaded file.
Parameters
- $name
- The name of the file to return.
Returns
string The name of the file or false if the file was not uploaded.
|
public
boolean
|
#
moveUploadedFile( string $name, string $to, string $default = null )
Move the uploaded file to a permanent location.
Move the uploaded file to a permanent location.
Parameters
- $name
- The name of the uploaded file to move.
- $to
- The path and name to move the file to.
- $default
- The file to copy as a default if the named file is not available.
Returns
boolean true if the file was moved or false if it failed.
|
public
string
|
#
getSegment( integer $num, string $default = null )
Get the segment from the request URI.
Get the segment from the request URI.
Parameters
- $num
- The zero based index to the segment to return.
- $default
- The value to return if the segment isn't present.
Returns
string The requested segment or the default value.
|
public
array
|
#
getSegments( )
Get the array of segments from the request URI.
Get the array of segments from the request URI.
Returns
array Array of URI segments.
|