[ Index ]
 

Code source de LifeType 1.2.4

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/class/net/http/ -> httpvars.class.php (sommaire)

\defgroup Net_HTTP Package that contains several classes and code related to HTTP, such as code for making HTTP requests or code for dealing with certain HTTP headers

Poids: 281 lignes (8 kb)
Inclus ou requis:0 fois
Référencé: 30 fois
Nécessite: 0 fichiers

Définit 1 class

HttpVars:: (13 méthodes):
  getGet()
  getPost()
  getSession()
  setSession()
  getCookie()
  getRequest()
  getRequestValue()
  setRequest()
  setRequestValue()
  setGet()
  getServer()
  getFiles()
  getBaseUrl()


Classe: HttpVars  - X-Ref

\ingroup Net_HTTP

HttpVars compatibility package, which allows to fetch some of php's basic
global variables without having to worry about which version of php we're using.
The problem here is that since PHP 4.1.0 things like $_REQUEST, $_POST, $_GET, etc
are available, and before that their equivalents were $HTTP_GET_VARS,
$HTTP_POST_VARS and so on. By using this package and calling the functions
getPostVars, getGetVars, getSessionVars/setSessionVars we will get rid of any
incompatibility with the version of php we are running while having access to the
variables we most need.
getGet()   X-Ref
Returns an array with all the variables in the GET header, fetching them
either from $_GET (PHP >= 4.1.0) or $HTTP_GET_VARS (PHP < 4.1.0)

return: An associative array with the values of the GET header.

getPost()   X-Ref
Returns an array with all the variables in the GET header, fetching them
either from $_POST (PHP >= 4.1.0) or $HTTP_POST_VARS (PHP < 4.1.0)

return: An associative array with the values of the POST header.

getSession()   X-Ref
Returns an array with all the variables in the session, fetching them
either from $_SESSION (PHP >= 4.1.0) or $HTTP_SESSION_VARS (PHP < 4.1.0)

return: An associative array with the values of the session.

setSession( $sessionVars )   X-Ref
Saves the array in the session.

param: sessionVars An array that will be used as the values for the http session.
return: Always returns true.

getCookie()   X-Ref
Returns an array with the contents of the $_COOKIE global variable, if PHP version >= 4.1.0
or the values of the array HTTP_COOKIE_VARS if we're using a lower version.

return: An associative array with all the cookies created by our application.

getRequest()   X-Ref
Returns the value of the $_REQUEST array. In PHP >= 4.1.0 it is defined as a mix
of the $_POST, $_GET and $_COOKIE arrays, but it didn't exist in earlier versions.
If we are running PHP < 4.1.0, then we will manually create it by merging the needed
arrays.

return: An associative array containing the variables in the GET, POST and COOKIES header.

getRequestValue( $key )   X-Ref
returns the value of a certain key from the request

param: key
return: The value, or empty if not found

setRequest( $requestArray )   X-Ref
Sets the value of the $_REQUEST array in PHP 4.1.0 or higher. If using a lower version,
then the content of this array will be copied into $HTTP_GET_VARS

param: requestArray An associative array with the contents of our future $_REQUEST
return: Returns always true.

setRequestValue( $key, $value )   X-Ref
sets a value in the request

param: key
param: value
return: true

setGet( $getArray )   X-Ref
Sets the value of the $_GET array in PHP 4.1.0 or higher and of the
$HTTP_GET_VARS if lower.

param: getArray An associative array with the contents of our future $_GET
return: Returns always true.

getServer()   X-Ref
Returns the $_SERVER array, otherwise known as $HTTP_SERVER_VARS in versions older
than PHP 4.1.0

return: An associative array with the contents of the $_SERVER array, or equivalent.

getFiles()   X-Ref
Pas de description

getBaseUrl()   X-Ref
Returns the base URL of the script

return: A string containing the base URL of the script



Généré le : Mon Nov 26 21:04:15 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics