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
array $params
string $type
string $urlPathInfo
string $urlScript
Method Summary
jRequest __construct ()
string getDomainName ()
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 ()
void isAllowedResponse (string $respclass)
mixed readHttpBody ()
void _initParams ()
void _initUrlData ()
Variables
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 67)

the pathinfo part of the url

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

  • access: public
string $urlScript (line 60)

the path to the entry point in the url

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

  • access: public
string $urlScriptName (line 53)

the name of the entry point

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

  • access: public
string $urlScriptPath (line 46)

the path of the entry point in the url

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

  • access: public
Methods
Constructor __construct (line 69)
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 215)

return the application domain name

  • since: 1.2.3
string getDomainName ()
getIP (line 191)

return the ip address of the user

  • return: the ip
string getIP ()

Redefined in descendants as:
getParam (line 128)

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

return the server port of the application

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

return the protocol

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

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

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 346)
  • access: public
void header ( $name)
  • $name
headers (line 354)
  • access: public
void headers ()
init (line 74)

initialize the request : analyse of http request etc..

  • access: public
void init ()

Redefined in descendants as:
isAllowedResponse (line 144)
  • access: public
void isAllowedResponse (string $respclass)
  • string $respclass: the name of a response class

Redefined in descendants as:
readHttpBody (line 290)

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

analyse the http request and sets the params property

  • abstract:
  • access: protected
void _initParams ()

Redefined in descendants as:
_initUrlData (line 87)

init the url* properties

  • access: protected
void _initUrlData ()

Redefined in descendants as:

Documentation generated on Thu, 19 Sep 2013 00:06:28 +0200 by phpDocumentor 1.4.3