eZPublish  3.9
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())
 
 getDataByURL ($url, $justCheckURL=false, $userAgent=false)
 
 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)
Returns
the value for the attribute $attr or null if the attribute does not exist.
eZHTTPTool::attributes ( )
Returns
the attributes for this object.

Referenced by hasAttribute().

eZHTTPTool::createPostVarsFromImageButtons ( )
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.

Referenced by redirect().

eZHTTPTool::eZHTTPTool ( )

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

Referenced by instance().

eZHTTPTool::getDataByURL (   $url,
  $justCheckURL = false,
  $userAgent = false 
)
static
Parameters
$url
$justCheckURLif true, we should check url only not downloading data.
Returns
data from $url, false if invalid URL

Referenced by eZRSSImport\getRSSVersion().

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

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

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

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

Note
Calls PHPs header() with a constructed string.

Referenced by redirect().

& eZHTTPTool::instance ( )
Returns
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(), eZStaticCache\executeActions(), 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(), sectionEditActionCheck(), eZUserLoginHandler\sessionCleanup(), eZPreferences\sessionCleanup(), eZUser\setCurrentlyLoggedInUser(), eZContentUpload\setResult(), eZStaticCache\storeCache(), eZPreferences\storedSessionValue(), eZPreferences\storeInSession(), storeNodeAssignments(), templateOperatorBasicFetchData(), templateOperatorDescribeFetchData(), eZContentUpload\upload(), eZURLOperator\urlTransformation(), eZContentObject\validateInput(), eZPreferences\value(), and eZPreferences\values().

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

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

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

Parameters
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
port,default80
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
Returns
result if http request, or return false if an error occurs. If pipetrough, program will end here.

Referenced by eZStepSiteTypes\downloadFile(), and eZECBHandler\requestRates().

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

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

eZHTTPTool::setGetVariable (   $var,
  $value 
)

Sets the get variable $var to $value.

See Also
getVariable
eZHTTPTool::setPostVariable (   $var,
  $value 
)

Sets the post variable $var to $value.

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

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