lib/ezutils/classes/ezhttptool.php
\eZHTTPTool
Methods

createRedirectUrl(
$path, $parameters
=
array()
)
:
void| Name | Type | Description |
|---|---|---|
| $path | ||
| $parameters |

getDataByURL(
$url, $justCheckURL
=
false, $userAgent
=
false
)
:
void| Name | Type | Description |
|---|---|---|
| $url | ||
| $justCheckURL | ||
| $userAgent |

getSessionKey(
)
:
stringReturn the session id
| Type | Description |
|---|---|
| string |
- Deprecated
- Since 4.4, use ->sessionID instead!

getVariable(
$var, $fallbackValue
=
null
)
:
void| Name | Type | Description |
|---|---|---|
| $var | ||
| $fallbackValue |

hasSessionVariable(
string $name, bool $forceStart
=
true
)
:
bool | nullCheck if session variable $name exists
| Name | Type | Description |
|---|---|---|
| $name | string | |
| $forceStart | bool | Force session start if true (default) |
| Type | Description |
|---|---|
| bool | null | Null if session has not started and $forceStart is false |

headerVariable(
$headerName, $headerData
)
:
void| Name | Type | Description |
|---|---|---|
| $headerName | ||
| $headerData |

instance(
)
:
\eZHTTPToolReturn a unique instance of the eZHTTPTool class
| Type | Description |
|---|---|
| \eZHTTPTool |

parseHTTPResponse(
$response, $header, $body
)
:
void| Name | Type | Description |
|---|---|---|
| $response | ||
| $header | ||
| $body |

postVariable(
$var, $fallbackValue
=
null
)
:
void| Name | Type | Description |
|---|---|---|
| $var | ||
| $fallbackValue |

redirect(
$path, $parameters
=
array(), $status
=
false, $encodeURL
=
true
)
:
void\static Performs an HTTP redirect.
\param $path The path to redirect \param $parameters \see createRedirectUrl() \param $status The HTTP status code as a string \param $encodeURL Encode the URL. This should normally be true, but may be set to false to avoid double encoding when redirect() is called twice.
| Name | Type | Description |
|---|---|---|
| $path | ||
| $parameters | ||
| $status | ||
| $encodeURL |

removeSessionVariable(
string $name
)
:
boolUnset the session variable $name
| Name | Type | Description |
|---|---|---|
| $name | string |
| Type | Description |
|---|---|
| bool |

sendHTTPRequest(
string $uri, int | false $port
=
false, array | false $postParameters
=
false, string $userAgent
=
'eZ Publish', bool $passthrough
=
true, array $cookies
=
array()
)
:
string | falseSends a http request to the specified host. Using https:// requires compiled in OpenSSL support.
| Name | Type | Description |
|---|---|---|
| $uri | string | http/https address or only path to send request to current eZ Publish instance examples: http://ez.no, https://secure.ez.no or content/view/full/2 |
| $port | int | false | Which port to connect to, default 80, uses port in $uri if present when $port = false |
| $postParameters | array | false | Optional post parameters array, if no post parameters are present, a GET request will be sent |
| $userAgent | string | User agent string, default will be 'eZ Publish' |
| $passthrough | bool | Will send result directly to client, default: true |
| $cookies | array | Optional hash of cookie name => values to add to http header |
| Type | Description |
|---|---|
| string | false | String if http request, or false if an error occurs. If $passthrough = true, program will end here and send result directly to client. |

sessionVariable(
string $name, mixed $fallbackValue
=
null
)
:
mixedGet session variable $name
| Name | Type | Description |
|---|---|---|
| $name | string | |
| $fallbackValue | mixed | Return this if session has not started OR name is undefined if null(default), then force start session and return null if undefined. |
| Type | Description |
|---|---|
| mixed | ByRef |

setSessionID(
string $sessionKey
)
:
stringSets a new session id
| Name | Type | Description |
|---|---|---|
| $sessionKey | string | Allowed characters in the range a-z A-Z 0-9 , (comma) and - (minus) |
| Type | Description |
|---|---|
| string | Current(old) session id |

setSessionKey(
string $sessionKey
)
:
stringSets a new session id
| Name | Type | Description |
|---|---|---|
| $sessionKey | string | Allowed characters in the range a-z A-Z 0-9 , (comma) and - (minus) |
| Type | Description |
|---|---|
| string | Current(old) session id |
- Deprecated
- Since 4.4, use ->setSessionID instead!

setSessionVariable(
string $name, mixed $value
)
:
voidSets the session variable $name to value $value.
| Name | Type | Description |
|---|---|---|
| $name | string | |
| $value | mixed |