kernel/private/rest/classes/request/rest_request.php
File containing the ezpRestRequest class
- Copyright
- Copyright (C) 1999-2011 eZ Systems AS. All rights reserved.
- License
- eZ Proprietary Use License v1.0
- Package
- rest
\ezpRestRequest
Class mimicking ezcMvcRequest with distinct containers for GET and POST variables.
The current implementation is a tentative implementation, for long term usage, we are likely to use dedicated structs such as for cookie. This in addition or alternatively to a more selective parser, which could cherry pick variables depending on request type, context and so forth.
- Parent(s)
- \ezcMvcRequest
Properties

bool
$isEncrypted= ''
Signifies whether the request was made over an encrypted connection.
- Type
- bool
Methods

__construct(
\DateTime $date
=
null, string $protocol
=
'', string $host
=
'', string $uri
=
'', string $requestId
=
'', string $referrer
=
'', array $variables
=
array(), array $get
=
array(), array $post
=
array(), array $contentVariables
=
array(), bool $isEncrypted
=
false, string $body
=
'', \array(ezcMvcRequestFile) $files
=
null, \ezcMvcRequestAccept $accept
=
null, \ezcMvcRequestUserAgent $agent
=
null, \ezcMvcRequestAuthentication $authentication
=
null, \ezcMvcRawRequest $raw
=
null, \array(ezcMvcRequestCookie) $cookies
=
array(), bool $isFatal
=
false
)
:
voidConstructs a new ezpRestRequest.
| Name | Type | Description |
|---|---|---|
| $date | \DateTime | |
| $protocol | string | |
| $host | string | |
| $uri | string | |
| $requestId | string | |
| $referrer | string | |
| $variables | array | Containing request variables set by the router |
| $get | array | The GET variables which are available in the request |
| $post | array | The POST variables that are available in the request |
| $contentVariables | array | GET variables related to eZ Publish content |
| $isEncrypted | bool | Is the request made over an encrypted connection |
| $body | string | |
| $files | \array(ezcMvcRequestFile) | |
| $accept | \ezcMvcRequestAccept | |
| $agent | \ezcMvcRequestUserAgent | |
| $authentication | \ezcMvcRequestAuthentication | |
| $raw | \ezcMvcRawRequest | |
| $cookies | \array(ezcMvcRequestCookie) | |
| $isFatal | bool |

__set_state(
\array(string=>mixed) $array
)
:
\ezpRestRequestReturns a new instance of this class with the data specified by $array.
$array contains all the data members of this class in the form: array('member_name'=>value).
__set_state makes this class exportable with var_export. var_export() generates code, that calls this method when it is parsed with PHP.
| Name | Type | Description |
|---|---|---|
| $array | \array(string=>mixed) |
| Type | Description |
|---|---|
| \ezpRestRequest |

getBaseURI(
)
:
stringReturns base URI with protocol and host (e.g. http://myhost.com/foo/bar)
| Type | Description |
|---|---|
| string |

getContentQueryString(
bool $withQuestionMark
=
false
)
:
stringReturns current content variables as a regular query string (e.g. "foo=bar&this=that")
| Name | Type | Description |
|---|---|---|
| $withQuestionMark | bool | If true, the question mark ("?") will be added |
| Type | Description |
|---|---|
| string |