Zend Framework
LICENSE
This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to license@zend.com so we can send you a copy immediately.
Zend_Controller_Request_Http
HTTP request object for use with Zend_Controller family.
SCHEME_HTTP = 'http'
Scheme for http
Details SCHEME_HTTPS = 'https'
Scheme for https
Detailsarray $_aliases = 'array'Alias keys for request parameters
Detailsstring $_basePath = 'null'Base path of request
Detailsstring $_baseUrl = 'null'Base URL of request
Detailsarray $_paramSources = 'array'Allowed parameter sources
Detailsarray $_params = 'array'Instance parameters
Detailsstring $_pathInfo = ''PATH_INFO
Detailsstring|false $_rawBody = ''Raw request body
Detailsstring; $_requestUri = ''REQUEST_URI
Details__construct(
string|Zend_Uri $uri
=
null
)
:
voidConstructor
If a $uri is passed, the object will attempt to populate itself using that information.
Details__get(
string $key
)
:
mixedAccess values contained in the superglobals as public members Order of precedence: 1. GET, 2. POST, 3. COOKIE, 4. SERVER, 5. ENV
Details__isset(
string $key
)
:
booleanCheck to see if a property is set
Details__set(
string $key, mixed $value
)
:
voidSet values
In order to follow {@link __get()}, which operates on a number of superglobals, setting values through overloading is not allowed and will raise an exception. Use setParam() instead.
Detailsget(
string $key
)
:
mixedAlias to __get
DetailsgetAlias(
string $name
)
:
string|nullRetrieve an alias
Retrieve the actual key represented by the alias $name.
DetailsgetAliases(
)
:
arrayRetrieve the list of all aliases
DetailsgetBasePath(
)
:
stringEverything in REQUEST_URI before PATH_INFO not including the filename <img src="<?=$basePath?>/images/zend.png"/>
DetailsgetBaseUrl(
)
:
stringEverything in REQUEST_URI before PATH_INFO <form action="<?=$baseUrl?>/news/submit" method="POST"/>
DetailsgetClientIp(
boolean $checkProxy
=
true
)
:
stringGet the client's IP addres
DetailsgetCookie(
string $key
=
null, mixed $default
=
null
)
:
mixedRetrieve a member of the $_COOKIE superglobal
If no $key is passed, returns the entire $_COOKIE array.
DetailsgetEnv(
string $key
=
null, mixed $default
=
null
)
:
mixedRetrieve a member of the $_ENV superglobal
If no $key is passed, returns the entire $_ENV array.
DetailsgetHeader(
string $header
)
:
string|falseReturn the value of the given HTTP header. Pass the header name as the plain, HTTP-specified header name. Ex.: Ask for 'Accept' to get the Accept header, 'Accept-Encoding' to get the Accept-Encoding header.
DetailsgetHttpHost(
)
:
stringGet the HTTP host.
"Host" ":" host [ ":" port ] ; Section 3.2.2 Note the HTTP Host header is not the same as the URI host. It includes the port while the URI host doesn't.
DetailsgetMethod(
)
:
stringReturn the method by which the request was made
DetailsgetParam(
mixed $key, mixed $default
=
null
)
:
mixedRetrieve a parameter
Retrieves a parameter from the instance. Priority is in the order of userland parameters (see {@link setParam()}), $_GET, $_POST. If a parameter matching the $key is not found, null is returned.
If the $key is an alias, the actual key aliased will be used.
DetailsgetParamSources(
)
:
arrayGet list of allowed parameter sources
DetailsgetParams(
)
:
arrayRetrieve an array of parameters
Retrieves a merged array of parameters, with precedence of userland params (see {@link setParam()}), $_GET, $_POST (i.e., values in the userland params will take precedence over all others).
DetailsgetPathInfo(
)
:
stringReturns everything between the BaseUrl and QueryString.
This value is calculated instead of reading PATH_INFO directly from $_SERVER due to cross-platform differences.
DetailsgetPost(
string $key
=
null, mixed $default
=
null
)
:
mixedRetrieve a member of the $_POST superglobal
If no $key is passed, returns the entire $_POST array.
DetailsgetQuery(
string $key
=
null, mixed $default
=
null
)
:
mixedRetrieve a member of the $_GET superglobal
If no $key is passed, returns the entire $_GET array.
DetailsgetRawBody(
)
:
string|falseReturn the raw body of the request, if present
DetailsgetRequestUri(
)
:
stringReturns the REQUEST_URI taking into account platform differences between Apache and IIS
DetailsgetScheme(
)
:
stringGet the request URI scheme
DetailsgetServer(
string $key
=
null, mixed $default
=
null
)
:
mixedRetrieve a member of the $_SERVER superglobal
If no $key is passed, returns the entire $_SERVER array.
Detailshas(
string $key
)
:
booleanAlias to __isset()
DetailsisDelete(
)
:
booleanWas the request made by DELETE?
DetailsisFlashRequest(
)
:
booleanIs this a Flash request?
DetailsisGet(
)
:
booleanWas the request made by GET?
DetailsisHead(
)
:
booleanWas the request made by HEAD?
DetailsisOptions(
)
:
booleanWas the request made by OPTIONS?
DetailsisPost(
)
:
booleanWas the request made by POST?
DetailsisPut(
)
:
booleanWas the request made by PUT?
DetailsisSecure(
)
:
booleanIs https secure request
DetailsisXmlHttpRequest(
)
:
booleanIs the request a Javascript XMLHttpRequest?
Should work with Prototype/Script.aculo.us, possibly others.
Detailsset(
string $key, mixed $value
)
:
voidAlias to __set()
DetailssetAlias(
string $name, string $target
)
:
Zend_Controller_Request_HttpSet a key alias
Set an alias used for key lookups. $name specifies the alias, $target specifies the actual key to use.
DetailssetBasePath(
string|null $basePath
=
null
)
:
Zend_Controller_Request_HttpSet the base path for the URL
DetailssetBaseUrl(
mixed $baseUrl
=
null
)
:
Zend_Controller_Request_HttpSet the base URL of the request; i.e., the segment leading to the script name
E.g.: - /admin - /myapp - /subdir/index.php
Do not use the full URI when providing the base. The following are examples of what not to use: - http://example.com/admin (should be just /admin) - http://example.com/subdir/index.php (should be just /subdir/index.php)
If no $baseUrl is provided, attempts to determine the base URL from the environment, using SCRIPT_FILENAME, SCRIPT_NAME, PHP_SELF, and ORIG_SCRIPT_NAME in its determination.
DetailssetParam(
mixed $key, mixed $value
)
:
Zend_Controller_Request_HttpSet a userland parameter
Uses $key to set a userland parameter. If $key is an alias, the actual key will be retrieved and used to set the parameter.
DetailssetParamSources(
$paramSources
=
array
)
:
Zend_Controller_Request_HttpSet allowed parameter sources
Can be empty array, or contain one or more of '_GET' or '_POST'.
DetailssetParams(
array $params
)
:
Zend_Controller_Request_HttpSet parameters
Set one or more parameters. Parameters are set as userland parameters, using the keys specified in the array.
DetailssetPathInfo(
string|null $pathInfo
=
null
)
:
Zend_Controller_Request_HttpSet the PATH_INFO string
DetailssetPost(
string|array $spec, null|mixed $value
=
null
)
:
Zend_Controller_Request_HttpSet POST values
DetailssetQuery(
string|array $spec, null|mixed $value
=
null
)
:
Zend_Controller_Request_HttpSet GET values
DetailssetRequestUri(
string $requestUri
=
null
)
:
Zend_Controller_Request_HttpSet the REQUEST_URI on which the instance operates
If no request URI is passed, uses the value in $_SERVER['REQUEST_URI'], $_SERVER['HTTP_X_REWRITE_URL'], or $_SERVER['ORIG_PATH_INFO'] + $_SERVER['QUERY_STRING'].
Details