eZPublish  3.8
eZHTTPTool Class Reference

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

Public Member Functions

attribute ($attr)
 attributes ()
 createPostVarsFromImageButtons ()
 eZHTTPTool ()
 getSessionKey ()
 getVariable ($var)
 hasAttribute ($attr)
 hasGetVariable ($var)
 hasPostVariable ($var)
 hasSessionVariable ($name)
 hasVariable ($var)
instance ()
 postVariable ($var)
 redirect ($path, $parameters=array(), $status=false)
 removeMagicQuotes ()
 removeSessionVariable ($name)
 sessionID ()
sessionVariable ($name)
 setGetVariable ($var, $value)
 setPostVariable ($var, $value)
 setSessionKey ($sessionKey)
 setSessionVariable ($name, $value)
 variable ($var)

Static Public Member Functions

 createRedirectUrl ($path, $parameters=array())
 headerVariable ($headerName, $headerData)
 parseHTTPResponse (&$response, &$header, &$body)
 sendHTTPRequest ($uri, $port=80, $postParameters=false, $userAgent= 'eZ publish', $passtrough=true)

Detailed Description

Provides access to HTTP post,get and session variables.

See PHP manual on Predefined Variables for more information.

Member Function Documentation

& eZHTTPTool::attribute (   $attr)
the value for the attribute $attr or null if the attribute does not exist.
eZHTTPTool::attributes ( )
the attributes for this object.

Referenced by hasAttribute().

eZHTTPTool::createPostVarsFromImageButtons ( )
eZHTTPTool::createRedirectUrl (   $path,
  $parameters = array() 

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.

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

Referenced by redirect().

eZHTTPTool::eZHTTPTool ( )

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

Referenced by instance().

eZHTTPTool::getSessionKey ( )
eZHTTPTool::getVariable (   $var)
a reference to the HTTP get variable $var, or null if it does not exist.
See Also
eZHTTPTool::hasAttribute (   $attr)
true if the attribute $attr exist.
eZHTTPTool::hasGetVariable (   $var)
true if the HTTP get variable $var exist.
See Also
eZHTTPTool::hasPostVariable (   $var)
true if the HTTP post variable $var exist.
See Also
eZHTTPTool::hasSessionVariable (   $name)
true if the session variable $name exist.

Referenced by eZSection\globalID(), eZSection\initGlobalID(), and eZSection\setGlobalID().

eZHTTPTool::hasVariable (   $var)
true if the HTTP post/get variable $var exists.
See Also
eZHTTPTool::headerVariable (   $headerName,

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

Calls PHPs header() with a constructed string.

Referenced by redirect().

& eZHTTPTool::instance ( )
the unique instance of the HTTP tool

Referenced by eZUser\accessArray(), eZModule\actionParameter(), eZURLOperator\applyQuotes(), eZContentBrowse\browse(), eZSearch\buildSearchArray(), eZContentClass\canInstantiateClasses(), eZContentClass\canInstantiateClassList(), checkNodeActions(), checkNodeAssignments(), checkNodeMovements(), checkRelationActions(), checkRelationAssignments(), eZUserLoginHandler\checkUser(), eZUser\checkUser(), eZUser\cleanup(), eZContentUpload\cleanup(), eZContentUpload\cleanupAll(), eZTemplateCompiler\compilationFilename(), eZWizardBaseClassLoader\createClass(), eZModule\currentAction(), eZBasket\currentBasket(), eZWishList\currentWishList(), eZCollaborationItemHandler\customInput(), eZObjectRelationListType\customObjectAttributeHTTPAction(), datatypeBasicFetchData(), datatypeDescribeFetchData(), eZXMLInputType\editorName(), eZContentObjectEditHandler\executeInputHandlers(), eZCheckUser(), eZContentBrowse\eZContentBrowse(), eZContentUpload\eZContentUpload(), eZSetupCheckExecutable(), eZSetupFetchPersistenceList(), eZSetupRunTests(), eZSetupSetPersistencePostVariable(), eZWizardBase\eZWizardBase(), eZShopFunctionCollection\fetchBasket(), eZUserDiscountRule\fetchIDListByUserID(), eZContentObject\fetchInput(), eZContentObject\fixupInput(), eZUserLoginHandler\forceLogin(), eZPaymentGatewayType\getCurrentGatewayType(), eZUser\groups(), eZContentObject\handleAllCustomHTTPActions(), eZContentObject\handleCustomHTTPActions(), eZModule\hasActionParameter(), eZCollaborationItemHandler\hasCustomInput(), eZXMLInputType\instance(), eZUser\instance(), eZCollaborationItemHandler\isCustomAction(), eZPreferences\isStoredInSession(), eZUser\limitValueList(), eZLDAPUser\loginUser(), eZTextFileUser\loginUser(), eZUser\loginUser(), eZUser\logoutCurrent(), eZURLOperator\modify(), eZRedirectManager\redirectURI(), eZContentBrowse\result(), eZUser\roleIDList(), eZUserLoginHandler\sessionCleanup(), eZPreferences\sessionCleanup(), eZUser\setCurrentlyLoggedInUser(), eZContentUpload\setResult(), eZPreferences\storedSessionValue(), eZPreferences\storeInSession(), storeNodeAssignments(), templateOperatorBasicFetchData(), templateOperatorDescribeFetchData(), eZContentUpload\upload(), eZURLOperator\urlTransformation(), eZContentObject\validateInput(), eZPreferences\value(), and eZPreferences\values().

eZHTTPTool::parseHTTPResponse ( $response,
eZHTTPTool::postVariable (   $var)
a reference to the HTTP post variable $var, or null if it does not exist.
See Also

Referenced by eZImageType\fetchObjectAttributeHTTPInput().

eZHTTPTool::redirect (   $path,
  $parameters = array(),
  $status = false 
eZHTTPTool::removeMagicQuotes ( )

Referenced by eZHTTPTool().

eZHTTPTool::removeSessionVariable (   $name)

Removes the session variable $name.

eZHTTPTool::sendHTTPRequest (   $uri,
  $port = 80,
  $postParameters = false,
  $userAgent = 'eZ publish',
  $passtrough = true 

Sends a http request to the specified host. Using https:// requires PHP 4.3.0, and compiled in OpenSSL support.

http/httpsaddress, only path to send request to eZ publish. examples: http://ez.no, https://secure.ez.no, ssl://secure.ez.no, content/view/full/2
postparameters array (optional), if no post parameters are present, a get request will be send.
useragent, default will be eZ publish
passtrough,willsend result directly to client, default false
result if http request, or return false if an error occurs. If pipetrough, program will end here.

Referenced by eZECBHandler\requestRates().

eZHTTPTool::sessionID ( )
the session id
& eZHTTPTool::sessionVariable (   $name)
the session variable $name.

Referenced by eZSection\globalID(), eZSection\initGlobalID(), and eZSection\setGlobalID().

eZHTTPTool::setGetVariable (   $var,

Sets the get variable $var to $value.

See Also
eZHTTPTool::setPostVariable (   $var,

Sets the post variable $var to $value.

See Also
eZHTTPTool::setSessionKey (   $sessionKey)
eZHTTPTool::setSessionVariable (   $name,
eZHTTPTool::variable (   $var)
a reference to the HTTP post/get variable $var, or null if it does not exist.
See Also

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