API Documentation

Controller/Request/Apache404.php

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.

category
Zend  
copyright
Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)  
license
New BSD License  
package
Zend_Controller  
version
$Id: Apache404.php 23988 2011-05-04 02:39:04Z ralph $  

\Zend_Controller_Request_Apache404

Zend_Controller_Request_Apache404

HTTP request object for use with Zend_Controller family. Extends basic HTTP request object to allow for two edge cases when using Apache: - Using Apache's 404 handler instead of mod_rewrite to direct requests - Using the PT flag in rewrite rules

In each case, the URL to check against is found in REDIRECT_URL, not REQUEST_URI.

Extends from
\Zend_Controller_Request_Http
copyright
Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)  
package
Zend_Controller  
subpackage
Request  
uses
\Zend_Controller_Request_Http  

Methods

methodpublic__construct( string|\Zend_Uri $uri = null ) : void

Constructor

Inherited from: \Zend_Controller_Request_Http::__construct()

If a $uri is passed, the object will attempt to populate itself using that information.

Parameters
Name Type Description
$uri string|\Zend_Uri
Throws
Exception Description
\Zend_Controller_Request_Exception when invalid URI passed
methodpublic__get( string $key ) : mixed

Access values contained in the superglobals as public members Order of precedence: 1. GET, 2. POST, 3. COOKIE, 4. SERVER, 5. ENV

Inherited from: \Zend_Controller_Request_Http::__get()
Parameters
Name Type Description
$key string
Returns
Type Description
mixed
Details
see
\http://msdn.microsoft.com/en-us/library/system.web.httprequest.item.aspx  
methodpublic__isset( string $key ) : boolean

Check to see if a property is set

Inherited from: \Zend_Controller_Request_Http::__isset()
Parameters
Name Type Description
$key string
Returns
Type Description
boolean
methodpublic__set( string $key, mixed $value ) : void

Set values

Inherited from: \Zend_Controller_Request_Http::__set()

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.

Parameters
Name Type Description
$key string
$value mixed
Throws
Exception Description
\Zend_Controller_Request_Exception
methodpublicclearParams( ) : \Zend_Controller_Request_Abstract

Unset all user parameters

Inherited from: \Zend_Controller_Request_Abstract::clearParams()
Returns
Type Description
\Zend_Controller_Request_Abstract
methodpublicget( string $key ) : mixed

Alias to __get

Inherited from: \Zend_Controller_Request_Http::get()
Parameters
Name Type Description
$key string
Returns
Type Description
mixed
methodpublicgetActionKey( ) : string

Retrieve the action key

Inherited from: \Zend_Controller_Request_Abstract::getActionKey()
Returns
Type Description
string
methodpublicgetActionName( ) : string

Retrieve the action name

Inherited from: \Zend_Controller_Request_Abstract::getActionName()
Returns
Type Description
string
methodpublicgetAlias( string $name ) : string|null

Retrieve an alias

Inherited from: \Zend_Controller_Request_Http::getAlias()

Retrieve the actual key represented by the alias $name.

Parameters
Name Type Description
$name string
Returns
Type Description
stringnull Returns null when no alias exists
methodpublicgetAliases( ) : array

Retrieve the list of all aliases

Inherited from: \Zend_Controller_Request_Http::getAliases()
Returns
Type Description
array
methodpublicgetBasePath( ) : string

Everything in REQUEST_URI before PATH_INFO not including the filename

Inherited from: \Zend_Controller_Request_Http::getBasePath()
Returns
Type Description
string
methodpublicgetBaseUrl(  $raw = false ) : string

Everything in REQUEST_URI before PATH_INFO

Inherited from: \Zend_Controller_Request_Http::getBaseUrl()
Parameters
Name Type Description
$raw
Returns
Type Description
string
methodpublicgetClientIp( boolean $checkProxy = true ) : string

Get the client's IP addres

Inherited from: \Zend_Controller_Request_Http::getClientIp()
Parameters
Name Type Description
$checkProxy boolean
Returns
Type Description
string
methodpublicgetControllerKey( ) : string

Retrieve the controller key

Inherited from: \Zend_Controller_Request_Abstract::getControllerKey()
Returns
Type Description
string
methodpublicgetControllerName( ) : string

Retrieve the controller name

Inherited from: \Zend_Controller_Request_Abstract::getControllerName()
Returns
Type Description
string
methodpublicgetCookie( string $key = null, mixed $default = null ) : mixed

Retrieve a member of the $_COOKIE superglobal

Inherited from: \Zend_Controller_Request_Http::getCookie()

If no $key is passed, returns the entire $_COOKIE array.

Parameters
Name Type Description
$key string
$default mixed Default value to use if key not found
Returns
Type Description
mixed Returns null if key does not exist
Details
todo
How to retrieve from nested arrays  
methodpublicgetEnv( string $key = null, mixed $default = null ) : mixed

Retrieve a member of the $_ENV superglobal

Inherited from: \Zend_Controller_Request_Http::getEnv()

If no $key is passed, returns the entire $_ENV array.

Parameters
Name Type Description
$key string
$default mixed Default value to use if key not found
Returns
Type Description
mixed Returns null if key does not exist
methodpublicgetHeader( string $header ) : string|false

Return 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.

Inherited from: \Zend_Controller_Request_Http::getHeader()
Parameters
Name Type Description
$header string HTTP header name
Returns
Type Description
stringfalse HTTP header value, or false if not found
Throws
Exception Description
\Zend_Controller_Request_Exception
methodpublicgetHttpHost( ) : string

Get the HTTP host.

Inherited from: \Zend_Controller_Request_Http::getHttpHost()

"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.

Returns
Type Description
string
methodpublicgetMethod( ) : string

Return the method by which the request was made

Inherited from: \Zend_Controller_Request_Http::getMethod()
Returns
Type Description
string
methodpublicgetModuleKey( ) : string

Retrieve the module key

Inherited from: \Zend_Controller_Request_Abstract::getModuleKey()
Returns
Type Description
string
methodpublicgetModuleName( ) : string

Retrieve the module name

Inherited from: \Zend_Controller_Request_Abstract::getModuleName()
Returns
Type Description
string
methodpublicgetParam( mixed $key, mixed $default = null ) : mixed

Retrieve a parameter

Inherited from: \Zend_Controller_Request_Http::getParam()

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.

Parameters
Name Type Description
$key mixed
$default mixed Default value to use if key not found
Returns
Type Description
mixed
methodpublicgetParamSources( ) : array

Get list of allowed parameter sources

Inherited from: \Zend_Controller_Request_Http::getParamSources()
Returns
Type Description
array
methodpublicgetParams( ) : array

Retrieve an array of parameters

Inherited from: \Zend_Controller_Request_Http::getParams()

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

Returns
Type Description
array
methodpublicgetPathInfo( ) : string

Returns everything between the BaseUrl and QueryString.

Inherited from: \Zend_Controller_Request_Http::getPathInfo()

This value is calculated instead of reading PATH_INFO directly from $_SERVER due to cross-platform differences.

Returns
Type Description
string
methodpublicgetPost( string $key = null, mixed $default = null ) : mixed

Retrieve a member of the $_POST superglobal

Inherited from: \Zend_Controller_Request_Http::getPost()

If no $key is passed, returns the entire $_POST array.

Parameters
Name Type Description
$key string
$default mixed Default value to use if key not found
Returns
Type Description
mixed Returns null if key does not exist
Details
todo
How to retrieve from nested arrays  
methodpublicgetQuery( string $key = null, mixed $default = null ) : mixed

Retrieve a member of the $_GET superglobal

Inherited from: \Zend_Controller_Request_Http::getQuery()

If no $key is passed, returns the entire $_GET array.

Parameters
Name Type Description
$key string
$default mixed Default value to use if key not found
Returns
Type Description
mixed Returns null if key does not exist
Details
todo
How to retrieve from nested arrays  
methodpublicgetRawBody( ) : string|false

Return the raw body of the request, if present

Inherited from: \Zend_Controller_Request_Http::getRawBody()
Returns
Type Description
stringfalse Raw body, or false if not present
methodpublicgetRequestUri( ) : string

Returns the REQUEST_URI taking into account platform differences between Apache and IIS

Inherited from: \Zend_Controller_Request_Http::getRequestUri()
Returns
Type Description
string
methodpublicgetScheme( ) : string

Get the request URI scheme

Inherited from: \Zend_Controller_Request_Http::getScheme()
Returns
Type Description
string
methodpublicgetServer( string $key = null, mixed $default = null ) : mixed

Retrieve a member of the $_SERVER superglobal

Inherited from: \Zend_Controller_Request_Http::getServer()

If no $key is passed, returns the entire $_SERVER array.

Parameters
Name Type Description
$key string
$default mixed Default value to use if key not found
Returns
Type Description
mixed Returns null if key does not exist
methodpublicgetUserParam( string $key, string $default = null ) : mixed

Retrieve a single user param (i.e, a param specific to the object and not the environment)

Inherited from: \Zend_Controller_Request_Abstract::getUserParam()
Parameters
Name Type Description
$key string
$default string Default value to use if key not found
Returns
Type Description
mixed
methodpublicgetUserParams( ) : array

Retrieve only user params (i.e, any param specific to the object and not the environment)

Inherited from: \Zend_Controller_Request_Abstract::getUserParams()
Returns
Type Description
array
methodpublichas( string $key ) : boolean

Alias to __isset()

Inherited from: \Zend_Controller_Request_Http::has()
Parameters
Name Type Description
$key string
Returns
Type Description
boolean
methodpublicisDelete( ) : boolean

Was the request made by DELETE?

Inherited from: \Zend_Controller_Request_Http::isDelete()
Returns
Type Description
boolean
methodpublicisDispatched( ) : boolean

Determine if the request has been dispatched

Inherited from: \Zend_Controller_Request_Abstract::isDispatched()
Returns
Type Description
boolean
methodpublicisFlashRequest( ) : boolean

Is this a Flash request?

Inherited from: \Zend_Controller_Request_Http::isFlashRequest()
Returns
Type Description
boolean
methodpublicisGet( ) : boolean

Was the request made by GET?

Inherited from: \Zend_Controller_Request_Http::isGet()
Returns
Type Description
boolean
methodpublicisHead( ) : boolean

Was the request made by HEAD?

Inherited from: \Zend_Controller_Request_Http::isHead()
Returns
Type Description
boolean
methodpublicisOptions( ) : boolean

Was the request made by OPTIONS?

Inherited from: \Zend_Controller_Request_Http::isOptions()
Returns
Type Description
boolean
methodpublicisPost( ) : boolean

Was the request made by POST?

Inherited from: \Zend_Controller_Request_Http::isPost()
Returns
Type Description
boolean
methodpublicisPut( ) : boolean

Was the request made by PUT?

Inherited from: \Zend_Controller_Request_Http::isPut()
Returns
Type Description
boolean
methodpublicisSecure( ) : boolean

Is https secure request

Inherited from: \Zend_Controller_Request_Http::isSecure()
Returns
Type Description
boolean
methodpublicisXmlHttpRequest( ) : boolean

Is the request a Javascript XMLHttpRequest?

Inherited from: \Zend_Controller_Request_Http::isXmlHttpRequest()

Should work with Prototype/Script.aculo.us, possibly others.

Returns
Type Description
boolean
methodpublicset( string $key, mixed $value ) : void

Alias to __set()

Inherited from: \Zend_Controller_Request_Http::set()
Parameters
Name Type Description
$key string
$value mixed
methodpublicsetActionKey( string $key ) : \Zend_Controller_Request_Abstract

Set the action key

Inherited from: \Zend_Controller_Request_Abstract::setActionKey()
Parameters
Name Type Description
$key string
Returns
Type Description
\Zend_Controller_Request_Abstract
methodpublicsetActionName( string $value ) : \Zend_Controller_Request_Abstract

Set the action name

Inherited from: \Zend_Controller_Request_Abstract::setActionName()
Parameters
Name Type Description
$value string
Returns
Type Description
\Zend_Controller_Request_Abstract
methodpublicsetAlias( string $name, string $target ) : \Zend_Controller_Request_Http

Set a key alias

Inherited from: \Zend_Controller_Request_Http::setAlias()

Set an alias used for key lookups. $name specifies the alias, $target specifies the actual key to use.

Parameters
Name Type Description
$name string
$target string
Returns
Type Description
\Zend_Controller_Request_Http
methodpublicsetBasePath( string|null $basePath = null ) : \Zend_Controller_Request_Http

Set the base path for the URL

Inherited from: \Zend_Controller_Request_Http::setBasePath()
Parameters
Name Type Description
$basePath string|null
Returns
Type Description
\Zend_Controller_Request_Http
methodpublicsetBaseUrl( mixed $baseUrl = null ) : \Zend_Controller_Request_Http

Set the base URL of the request; i.e., the segment leading to the script name

Inherited from: \Zend_Controller_Request_Http::setBaseUrl()

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.

Parameters
Name Type Description
$baseUrl mixed
Returns
Type Description
\Zend_Controller_Request_Http
methodpublicsetControllerKey( string $key ) : \Zend_Controller_Request_Abstract

Set the controller key

Inherited from: \Zend_Controller_Request_Abstract::setControllerKey()
Parameters
Name Type Description
$key string
Returns
Type Description
\Zend_Controller_Request_Abstract
methodpublicsetControllerName( string $value ) : \Zend_Controller_Request_Abstract

Set the controller name to use

Inherited from: \Zend_Controller_Request_Abstract::setControllerName()
Parameters
Name Type Description
$value string
Returns
Type Description
\Zend_Controller_Request_Abstract
methodpublicsetDispatched( boolean $flag = true ) : \Zend_Controller_Request_Abstract

Set flag indicating whether or not request has been dispatched

Inherited from: \Zend_Controller_Request_Abstract::setDispatched()
Parameters
Name Type Description
$flag boolean
Returns
Type Description
\Zend_Controller_Request_Abstract
methodpublicsetModuleKey( string $key ) : \Zend_Controller_Request_Abstract

Set the module key

Inherited from: \Zend_Controller_Request_Abstract::setModuleKey()
Parameters
Name Type Description
$key string
Returns
Type Description
\Zend_Controller_Request_Abstract
methodpublicsetModuleName( string $value ) : \Zend_Controller_Request_Abstract

Set the module name to use

Inherited from: \Zend_Controller_Request_Abstract::setModuleName()
Parameters
Name Type Description
$value string
Returns
Type Description
\Zend_Controller_Request_Abstract
methodpublicsetParam( mixed $key, mixed $value ) : \Zend_Controller_Request_Http

Set a userland parameter

Inherited from: \Zend_Controller_Request_Http::setParam()

Uses $key to set a userland parameter. If $key is an alias, the actual key will be retrieved and used to set the parameter.

Parameters
Name Type Description
$key mixed
$value mixed
Returns
Type Description
\Zend_Controller_Request_Http
methodpublicsetParamSources(  $paramSources = array ) : \Zend_Controller_Request_Http

Set allowed parameter sources

Inherited from: \Zend_Controller_Request_Http::setParamSources()

Can be empty array, or contain one or more of '_GET' or '_POST'.

Parameters
Name Type Description
$paramSources
Returns
Type Description
\Zend_Controller_Request_Http
methodpublicsetParams( array $params ) : \Zend_Controller_Request_Http

Set parameters

Inherited from: \Zend_Controller_Request_Http::setParams()

Set one or more parameters. Parameters are set as userland parameters, using the keys specified in the array.

Parameters
Name Type Description
$params array
Returns
Type Description
\Zend_Controller_Request_Http
methodpublicsetPathInfo( string|null $pathInfo = null ) : \Zend_Controller_Request_Http

Set the PATH_INFO string

Inherited from: \Zend_Controller_Request_Http::setPathInfo()
Parameters
Name Type Description
$pathInfo string|null
Returns
Type Description
\Zend_Controller_Request_Http
methodpublicsetPost( string|array $spec, null|mixed $value = null ) : \Zend_Controller_Request_Http

Set POST values

Inherited from: \Zend_Controller_Request_Http::setPost()
Parameters
Name Type Description
$spec string|array
$value null|mixed
Returns
Type Description
\Zend_Controller_Request_Http
methodpublicsetQuery( string|array $spec, null|mixed $value = null ) : \Zend_Controller_Request_Http

Set GET values

Inherited from: \Zend_Controller_Request_Http::setQuery()
Parameters
Name Type Description
$spec string|array
$value null|mixed
Returns
Type Description
\Zend_Controller_Request_Http
methodpublicsetRequestUri( string $requestUri = null ) : \Zend_Controller_Request_Http

Set 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'].

Parameters
Name Type Description
$requestUri string
Returns
Type Description
\Zend_Controller_Request_Http
Documentation was generated by DocBlox 0.13.3.