eZHTTPTool Class Reference
[HTTP utilities]

Provides access to HTTP post,get and session variables. More...

List of all members.


Public Methods

 eZHTTPTool ()
 setPostVariable ($var,$value)
postVariable ($var)
hasPostVariable ($var)
 setGetVariable ($var,$value)
getVariable ($var)
hasGetVariable ($var)
 hasVariable ($var)
 variable ($var)
attributes ()
 hasAttribute ($attr)
attribute ($attr)
instance ()
 getSessionKey ()
 removeSessionVariable ($name)
 hasSessionVariable ($name)
sessionVariable ($name)
 sessionID ()

Static Public Methods

 createRedirectUrl ($path,$parameters=array())
 headerVariable ($headerName,$headerData)

Detailed Description

Provides access to HTTP post,get and session variables.

See PHP manual on Predefined Variables for more information.

Definition at line ezhttptool.php.


Constructor & Destructor Documentation

eZHTTPTool::eZHTTPTool  
 

Initializes the class. Use eZHTTPTool::instance to get a single instance.

Definition at line ezhttptool.php.

Referenced by instance().


Member Function Documentation

& eZHTTPTool::attribute   attr
 

Returns:
the value for the attribute $attr or null if the attribute does not exist.

Definition at line ezhttptool.php.

& eZHTTPTool::attributes  
 

Returns:
the attributes for this object.

Definition at line ezhttptool.php.

eZHTTPTool::createRedirectUrl   path,
  parameters = array()
[static]
 

Sends a redirect path to the browser telling it to load the new path. By default only $path is required, other parameters will be fetched automatically to create a HTTP/1.1 compatible header. The input $parameters may contain the following keys.

  • host - the name of the host, default will fetch the currenty hostname
  • protocol - which protocol to use, default will use HTTP
  • port - the port on the host
  • username - a username which is required to login on the site
  • password - if username is supplied this password will be used for authentication
The path may be specified relativily rel/ative, from root /a/root, with hostname change //myhost.com/a/root/rel/ative, with protocol http://myhost.com/a/root/rel/ative. Also port may be placed in the path string. It is recommended that the path only contain a plain root path and instead send the rest as optional parameters, the support for different kinds of paths is only incase you get URLs externally which contains any of the above cases.

Note:
The redirection does not happen immedietaly and the script execution will continue.

Definition at line ezhttptool.php.

References eZSys::serverVariable().

eZHTTPTool::getSessionKey  
 

Sets the session variable $name to value $value.

Definition at line ezhttptool.php.

& eZHTTPTool::getVariable   var
 

Returns:
a reference to the HTTP get variable $var, or null if it does not exist.
See also:
variable

Definition at line ezhttptool.php.

References eZDebug::writeWarning().

eZHTTPTool::hasAttribute   attr
 

Returns:
true if the attribute $attr exist.

Definition at line ezhttptool.php.

& eZHTTPTool::hasGetVariable   var
 

Returns:
true if the HTTP get variable $var exist.
See also:
hasVariable

Definition at line ezhttptool.php.

& eZHTTPTool::hasPostVariable   var
 

Returns:
true if the HTTP post variable $var exist.
See also:
hasVariable

Definition at line ezhttptool.php.

eZHTTPTool::hasSessionVariable   name
 

Returns:
true if the session variable $name exist.

Definition at line ezhttptool.php.

Referenced by eZSection::setGlobalID().

eZHTTPTool::hasVariable   var
 

Returns:
true if the HTTP post/get variable $var exist.
See also:
hasPostVariable

Definition at line ezhttptool.php.

eZHTTPTool::headerVariable   headerName,
  headerData
[static]
 

Sets the header variable $headerName to have the data $headerData.

Note:
Calls PHPs header() with a constructed string.

Definition at line ezhttptool.php.

& eZHTTPTool::instance  
 

Returns:
the unique instance of the HTTP tool

Definition at line ezhttptool.php.

References instance().

Referenced by eZUser::logoutCurrent().

& eZHTTPTool::postVariable   var
 

Returns:
a reference to the HTTP post variable $var, or null if it does not exist.
See also:
variable

Definition at line ezhttptool.php.

References eZDebug::writeWarning().

Referenced by eZImageType::fetchObjectAttributeHTTPInput().

eZHTTPTool::removeSessionVariable   name
 

Removes the session variable $name.

Definition at line ezhttptool.php.

eZHTTPTool::sessionID  
 

Returns:
the session id

Definition at line ezhttptool.php.

& eZHTTPTool::sessionVariable   name
 

Returns:
the session variable $name.

Definition at line ezhttptool.php.

Referenced by eZSection::setGlobalID().

eZHTTPTool::setGetVariable   var,
  value
 

Sets the get variable $var to $value.

See also:
getVariable

Definition at line ezhttptool.php.

eZHTTPTool::setPostVariable   var,
  value
 

Sets the post variable $var to $value.

See also:
postVariable

Definition at line ezhttptool.php.

eZHTTPTool::variable   var
 

Returns:
a reference to the HTTP post/get variable $var, or null if it does not exist.
See also:
postVariable

Definition at line ezhttptool.php.


The documentation for this class was generated from the following file:  

Exponential