Zend_Application provides the base functionality of the
component, and the entry point to your Zend Framework application. It's
purpose is two-fold: to setup the PHP environment (including
autoloading), and to execute your application bootstrap.
Typically, you will pass all configuration to the
Zend_Application constructor, but you can also configure
the object entirely using its own methods. This reference is intended to
illustrate both use cases.
Table 2. Zend_Application options
| Option | Description |
|---|---|
| phpSettings |
Array of |
| includePaths |
Additional paths to prepend to the include_path. Should be an array of paths. |
| autoloaderNamespaces |
Array of additional namespaces to register with the
|
| bootstrap |
Either the string path to the bootstrap class, or an array with elements for the 'path' and 'class' for the application bootstrap. |
Option names
Please note that option names are case insensitive.
Table 3. Zend_Application Methods
| Method | Return Value | Parameters | Description |
|---|---|---|---|
__construct($environment, $options = null)
|
Void |
|
Constructor. Arguments are as described, and will be
used to set initial object state. An instance of
|
getEnvironment() |
String | N/A |
Retrieve the environment string passed to the constructor. |
getAutoloader() |
Zend_Loader_Autoloader |
N/A |
Retrieve the |
setOptions(array $options) |
Zend_Application |
|
All options are stored internally, and calling the
method multiple times will merge options. Options
matching the various setter methods will be passed
to those methods. As an example, the option
"phpSettings" will then be passed to
|
getOptions() |
Array | N/A |
Retrieve all options used to initialize the object;
could be used to cache |
hasOption($key) |
Boolean |
|
Determine whether or not an option with the specified key has been registered. Keys are case insensitive. |
getOption($key) |
Mixed |
|
Retrieve the option value of a given key. Returns
|
setPhpSettings(array $settings, $prefix = '')
|
Zend_Application |
|
Set run-time |
setAutoloaderNamespaces(array $namespaces)
|
Zend_Application |
|
Register namespaces with the
|
setBootstrap($path, $class = null) |
Zend_Application |
|
|
getBootstrap() |
NULL |
Zend_Application_Bootstrap_Bootstrapper
|
N/A | Retrieve the registered bootstrap instance. |
bootstrap() |
Void | N/A |
Call the bootstrap's |
run() |
Void | N/A |
Call the bootstrap's |




