Class jRequest

Description

base class for object which retrieve all parameters of an http request. The process depends on the type of request (ex: xmlrpc..)

  • abstract:

Located in /core/jRequest.class.php (line 20)


	
			
Direct descendents
Class Description
jXulRequest Handle a request which needs absolutely a XUL content as response.
jSoapRequest handle a soap call. The response has to be a soap response.
jClassicRequest handle "classical" request it just gets parameters from the url query and the post content. And responses can be in many format : text, html, xml...
jCmdLineRequest a request object for scripts used in a command line
jRdfRequest Handle a request which needs a RDF content as response.
jXmlRpcRequest handle XML-rpc call. The response has to be a xml-rpc response.
jJsonRpcRequest handle a JSON-rpc call. The response has to be a json rpc response.
jCssRequest handle classical request but only to control and produce css content
Variable Summary
string $action
string $module
array $params
string $type
string $urlPathInfo
string $urlScript
Method Summary
jRequest __construct ()
string getDomainName ()
jResponse getErrorResponse ( $currentResponse)
string getIP ()
void getModuleAction ()
mixed getParam (string $name, [mixed $defaultValue = null], [boolean $useDefaultIfEmpty = false])
string getPort ([ $forceHttps = null])
string getProtocol ()
jResponse getResponse ([ $type = ''], [boolean $useOriginal = false], string $name)
string getServerURI ([ $forceHttps = null])
void header ( $name)
void headers ()
void init ()
boolean isAjax ()
boolean isAllowedResponse (jResponse $response)
mixed readHttpBody ()
void _initParams ()
void _initUrlData ()
Variables
string $action = '' (line 87)

the action name ("controller:method")

  • access: public
string $authorizedResponseClass = '' (line 44)
  • var: the name of the base class for an allowed response for the current request
  • access: public

Redefined in descendants as:
string $module = '' (line 81)

the module name

  • access: public
array $params (line 27)

request parameters

could set from $_GET, $_POST, or from data processing of $HTTP_RAW_POST_DATA

  • access: public
string $urlPathInfo (line 75)

the pathinfo part of the url

if the url is /foo/index.php/bar, its value is /bar

  • access: public
string $urlScript (line 68)

the path to the entry point in the url if the url is /foo/index.php/bar, its value is /foo/index.php.

Warning: if the app is behind a proxy, the path includes the backendBasePath, not the basePath. Use urlScriptPath and urlScriptName to have the "public" url, as needed for the frontend HTTP server

  • access: public
string $urlScriptName (line 58)

the name of the entry point

if the url is /foo/index.php/bar, its value is index.php

  • access: public
string $urlScriptPath (line 51)

the path of the entry point in the url (basePath included)

if the url is /foo/index.php/bar, its value is /foo/

  • access: public
Methods
Constructor __construct (line 89)
jRequest __construct ()

Redefined in descendants as:
  • jSoapRequest::__construct()
  • jCmdLineRequest::__construct() : If you want to have a CLI script dedicated to the default action, tell it by given true, so you haven't to indicate the action on the command line. It means of course you couldn't execute any other actions with this script.
getDomainName (line 320)

return the application domain name

  • since: 1.2.3
string getDomainName ()
getErrorResponse (line 250)
  • access: public
jResponse getErrorResponse ( $currentResponse)
  • $currentResponse

Redefined in descendants as:
getIP (line 264)

return the ip address of the user

  • return: the ip
string getIP ()

Redefined in descendants as:
getModuleAction (line 145)

retrieve module and action

fills also $module and $action properties

  • access: public
void getModuleAction ()
getParam (line 175)

Gets the value of a request parameter. If not defined, gets its default value.

  • return: the request parameter value
  • access: public
mixed getParam (string $name, [mixed $defaultValue = null], [boolean $useDefaultIfEmpty = false])
  • string $name: the name of the request parameter
  • mixed $defaultValue: the default returned value if the parameter doesn't exists
  • boolean $useDefaultIfEmpty: true: says to return the default value if the parameter value is ""

Redefined in descendants as:
getPort (line 361)

return the server port of the application

  • return: the ":port" or empty string
  • since: 1.2.4
string getPort ([ $forceHttps = null])
  • $forceHttps
getProtocol (line 299)

return the protocol

  • return: http:// or https://
  • since: 1.2
string getProtocol ()
getResponse (line 205)

get a response object.

  • return: the response object
  • access: public
jResponse getResponse ([ $type = ''], [boolean $useOriginal = false], string $name)
  • string $name: the name of the response type (ex: "html")
  • boolean $useOriginal: true:don't use the response object redefined by the application
  • $type
getServerURI (line 341)

return the server URI of the application (protocol + server name + port)

  • return: the serveur uri
  • since: 1.2.4
string getServerURI ([ $forceHttps = null])
  • $forceHttps
header (line 451)
  • access: public
void header ( $name)
  • $name
headers (line 459)
  • access: public
void headers ()
init (line 94)

initialize the request : analyse of http request etc..

  • access: public
void init ()

Redefined in descendants as:
isAjax (line 308)

says if this is an ajax request

  • return: true if it is an ajax request
  • since: 1.3a1
boolean isAjax ()
isAllowedResponse (line 192)
  • return: true if the given class is allowed for the current request
  • access: public
boolean isAllowedResponse (jResponse $response)

Redefined in descendants as:
readHttpBody (line 395)

call it when you want to read the content of the body of a request

when the method is not GET or POST

  • return: array of parameters or a single string when the content-type is unknown
  • since: 1.2
  • access: public
mixed readHttpBody ()
_initParams (line 102)

analyse the http request and sets the params property

  • abstract:
  • access: protected
void _initParams ()

Redefined in descendants as:
_initUrlData (line 107)

init the url* properties

  • access: protected
void _initUrlData ()

Redefined in descendants as:

Documentation generated on Wed, 24 Sep 2014 22:01:13 +0200 by phpDocumentor 1.4.3