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
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
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.
Variable Summary
Method Summary
jRequest __construct ()
string getDomainName ()
jResponse getErrorResponse ( $currentResponse)
string getIP ()
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 $authorizedResponseClass = '' (line 44)
  • var: the name of the base class for an allowed response for the current request
  • access: public

Redefined in descendants as:
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 72)

the pathinfo part of the url

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

  • access: public
string $urlScript (line 65)

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

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

  • 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 74)
jRequest __construct ()

Redefined in descendants as:
  • 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.
  • jSoapRequest::__construct()
getDomainName (line 275)

return the application domain name

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

Redefined in descendants as:
getIP (line 219)

return the ip address of the user

  • return: the ip
string getIP ()

Redefined in descendants as:
getParam (line 133)

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 ""
getPort (line 316)

return the server port of the application

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

return the protocol

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

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 296)

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 406)
  • access: public
void header ( $name)
  • $name
headers (line 414)
  • access: public
void headers ()
init (line 79)

initialize the request : analyse of http request etc..

  • access: public
void init ()

Redefined in descendants as:
isAjax (line 263)

says if this is an ajax request

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

Redefined in descendants as:
readHttpBody (line 350)

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 87)

analyse the http request and sets the params property

  • abstract:
  • access: protected
void _initParams ()

Redefined in descendants as:
_initUrlData (line 92)

init the url* properties

  • access: protected
void _initUrlData ()

Redefined in descendants as:

Documentation generated on Mon, 19 Sep 2011 14:13:19 +0200 by phpDocumentor 1.4.3