Static Public Member Functions | Private Member Functions | Static Private Member Functions | Static Private Attributes

request Class Reference

Static Public Member Functions

static init ()
static parseParam ($param)
static createParam ($param, $urlify=true)
static forward ($request)
static forceSecure ()
static get ($get=null)
static getRequested ($get=null)
static getCfg ($key=null)
static hasPrm ($key)
static getPrm ($key, $default=null)
static getPathControllerUri ($forceController=false)
static uri ($prm=array())
static uploadedUri ($file, array $prm=array())
static uriDef (array $prm=array(), array $use=array('lang', 'module', 'action', 'param', 'out'))
static uriString ($uri)
static webUri ($uri)
static isAbsolutizeAllUris ()
static getIp ()
static isPost ()
static isLocal ()
static isAjax ()
static isMobile ($test=null)
static isScaffolded ()
static extractGet (&$request, $affectGet=false)
static analyseRequest ($request, $alias=true)
static alias ($request)
static removeLangOutUrl ($request)
static getModule ()
static execModule ()
static publishModule ()
static isLang ($lang)
static avlLang ($withName=false)
static getDefaultLang ()
static isOut ($out)
static getResponseName ()

Private Member Functions

 __construct ()

Static Private Member Functions

static fixFiles ()
static initModule ()

Static Private Attributes

static $cfg
static $requestedUriInfo
static $uriInfo
static $module
static $scaffold
static $mobileStatus = false

Detailed Description

Store the client request Singleton

Definition at line 11 of file request.class.php.


Constructor & Destructor Documentation

__construct (  )  [private]

No instanciation for this class

Definition at line 86 of file request.class.php.


Member Function Documentation

static alias ( request  )  [static]

Parse a request to find an alias match

Parameters:
string $request The request to parse
Returns:
string the real request

Definition at line 839 of file request.class.php.

static analyseRequest ( request,
alias = true 
) [static]

Analyse a request. If some element are empty, the default is replaced

Parameters:
string $request The requested string
bool $alias Indicate if alias should be used
Returns:
array Array with the key lang, module, action, param, text and out

Definition at line 797 of file request.class.php.

static avlLang ( withName = false  )  [static]

Get the available langs

Parameters:
bool $withName If the language name are needed
Returns:
array

Definition at line 939 of file request.class.php.

static createParam ( param,
urlify = true 
) [static]

Create the param string

Parameters:
array|string $param
Returns:
string

Definition at line 325 of file request.class.php.

static execModule (  )  [static]

Execute the action requested

Returns:
mixed Return from the executed action

Definition at line 908 of file request.class.php.

static extractGet ( &$  request,
affectGet = false 
) [static]

Analyse a request to extract the get information (after the ?) The $request variable will be modified to remove the get information

Parameters:
string $request
bool $affectGet Affect the information found to the $_GET array
Returns:
array

Definition at line 771 of file request.class.php.

static fixFiles (  )  [static, private]

Fix the arraye $_FILES with multiple uploads

Definition at line 261 of file request.class.php.

static forceSecure (  )  [static]

Force the request to be secure, by redirting to the same url with https

Definition at line 359 of file request.class.php.

static forward ( request  )  [static]

USed to forward the actual request to an other

Parameters:
string $request The new request
Returns:
mixed The executed action return

Definition at line 350 of file request.class.php.

static get ( get = null  )  [static]

Element requested

Parameters:
null|string get Element you want. Possible value:

  • uri
  • pathUri
  • rootUri
  • secure
  • protocol
  • controller
  • domain
  • path
  • pathWithController
  • request
  • lang
  • module
  • action
  • param
  • paramA
  • text
  • out
Returns:
array|mixed uriInfo if $get parameter is null, the whole array

Definition at line 387 of file request.class.php.

static getCfg ( key = null  )  [static]

Get a request config or the whole config array

Parameters:
string|null $key Key to retrieve or null to retrieve the array
Returns:
mixed

Definition at line 426 of file request.class.php.

static getDefaultLang (  )  [static]

Get the default lang defined

Returns:
string The default lang

Definition at line 950 of file request.class.php.

static getIp (  )  [static]

Get the IP address of the user

Returns:
string

Definition at line 659 of file request.class.php.

static getModule (  )  [static]

Get the module requested

Returns:
module_abstract

Definition at line 898 of file request.class.php.

static getPathControllerUri ( forceController = false  )  [static]

Get the URL part between the domain and the request, with the controller name if it's on the current request

Parameters:
bool $forceController Force the Controller script name on the return
Returns:
string

Definition at line 461 of file request.class.php.

static getPrm ( key,
default = null 
) [static]

Get a request parameter

Parameters:
string $key Parameter name
mixed $default Default value if not defined
Returns:
mixed

Definition at line 450 of file request.class.php.

static getRequested ( get = null  )  [static]

Get an element requested in the url

Parameters:
null|string $get
Returns:
array|mixed
See also:
get

Definition at line 409 of file request.class.php.

static getResponseName (  )  [static]

Get the reponse name associate to the request out

Returns:
string

Definition at line 969 of file request.class.php.

static hasPrm ( key  )  [static]

Check if the current request has the $key parameter

Parameters:
string $key parameter name
Returns:
bool

Definition at line 439 of file request.class.php.

static init (  )  [static]

Initialize the request object Call by the init function from nyro class

Definition at line 92 of file request.class.php.

static initModule (  )  [static, private]

Init the module requested

Definition at line 864 of file request.class.php.

static isAbsolutizeAllUris (  )  [static]

Indicates if it's configured to absolutiez all URIs

Returns:
boolean

Definition at line 650 of file request.class.php.

static isAjax (  )  [static]

Check if the current request is an Ajax

Returns:
bool

Definition at line 686 of file request.class.php.

static isLang ( lang  )  [static]

Check if it's an available lang

Parameters:
string $lang
Returns:
bool

Definition at line 929 of file request.class.php.

static isLocal (  )  [static]

Check if the request is local

Returns:
bool

Definition at line 677 of file request.class.php.

static isMobile ( test = null  )  [static]

Check if the current request is mobile

Parameters:
null|string|array $test 3 differents options:

  • null: no more test are done
  • string: the mobileStatus has to be the same
  • array: mobileStatus has to be in this array
Returns:
boolean

Definition at line 699 of file request.class.php.

static isOut ( out  )  [static]

Check if it's an available out

Parameters:
string $out
Returns:
bool

Definition at line 960 of file request.class.php.

static isPost (  )  [static]

Check if informations are posted

Returns:
bool

Definition at line 668 of file request.class.php.

static isScaffolded (  )  [static]

Check if the module requested was scaffolded

Returns:
bool

Definition at line 759 of file request.class.php.

static parseParam ( param  )  [static]

Extract the param

Parameters:
string $param
Returns:
array Parameters in array

Definition at line 306 of file request.class.php.

static publishModule (  )  [static]

Publish the module requested

Returns:
string The module published

Definition at line 918 of file request.class.php.

static removeLangOutUrl ( request  )  [static]

Get the translated

Parameters:
unknown_type $request
Returns:
unknown

Definition at line 856 of file request.class.php.

static uploadedUri ( file,
array $  prm = array() 
) [static]

Make a valid URI for an uploaded File

Parameters:
string $file The filepath
array $prm Array to overwritte default uri construction
Returns:
string The valid URI

Definition at line 559 of file request.class.php.

static uri ( prm = array()  )  [static]

Create an URI starting with /, regarding the current request By default, the controller will stay the same

Parameters:
string|array $prm URL Parameters:

  • bool absolute If the url should be absolute
  • string sep Seperator if needed (default: cfg config empty)
  • strong controller
  • string lang (if not valid it will be ignored)
  • string module
  • string action
  • array paramA
  • string param (using only if paramA doesn't exist)
  • string text
  • string out (if not valid it will be ignored)
Returns:
string the URL

Definition at line 483 of file request.class.php.

static uriDef ( array $  prm = array(),
array $  use = array('lang', 'module', 'action', 'param', 'out') 
) [static]

Create an array to create an uri with the requested value by default, overwritten by $prm

Parameters:
array $prm Array to use in the uri
array $use Element to use by default in the uri
Returns:
string the uri
See also:
uri

Definition at line 577 of file request.class.php.

static uriString ( uri  )  [static]

Convert a string uri to an array usuable for request::uri. Starting with // will remove the controller. Starting with /// will remove the controller and absolutize the URI.

Parameters:
string $uri
Returns:
array

Definition at line 594 of file request.class.php.

static webUri ( uri  )  [static]

Create a Web uri from a string (starting at the www folder)

Parameters:
string $uri
Returns:
string

Definition at line 641 of file request.class.php.


Field Documentation

$cfg [static, private]

Definition at line 18 of file request.class.php.

$mobileStatus = false [static, private]

Definition at line 81 of file request.class.php.

$module [static, private]

Definition at line 67 of file request.class.php.

$requestedUriInfo [static, private]

Definition at line 39 of file request.class.php.

$scaffold [static, private]

Definition at line 74 of file request.class.php.

$uriInfo [static, private]

Definition at line 60 of file request.class.php.


The documentation for this class was generated from the following file:
 All Data Structures Files Functions Variables Enumerations
Generated on Tue May 8 2012 16:02:25 for nyroFwk by doxygen 1.7.1