Application/Module/Bootstrap.php

Show: PublicProtectedPrivateinherited
Table of Contents
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-2012 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  
Package
Zend_Application  
Subpackage
Module  
Version
$Id: Bootstrap.php 25024 2012-07-30 15:08:15Z rob $  

\Zend_Application_Module_Bootstrap

Package: Zend\Application\Module
Base bootstrap class for modules

Registers and utilizes Zend_Controller_Front by default.

Parent(s)
\Zend_Application_Bootstrap_Bootstrap < \Zend_Application_Bootstrap_BootstrapAbstract
Category
Zend  
Copyright
Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  
Uses
\global\Zend_Loader_Autoloader_Resource  
Uses
\global\Zend_Application_Bootstrap_Bootstrap  

Properties

>VPropertyprotectedfalse|string $_appNamespace = false
inherited
Application resource namespace
Inherited from: \Zend_Application_Bootstrap_Bootstrap::$$_appNamespace
Default valuefalseDetails
Type
false | string
Inherited_from
\Zend_Application_Bootstrap_Bootstrap::$$_appNamespace  
>VPropertyprotectedstring $_moduleName
Set this explicitly to reduce impact of determining module name
Details
Type
string
>VPropertyprotectedarray $_optionKeys = array()
inherited
Flattened (lowercase) option keys used for lookups
Inherited from: \Zend_Application_Bootstrap_BootstrapAbstract::$$_optionKeys\Zend_Application_Bootstrap_Bootstrap::$$_optionKeys
>VPropertyprotected\Zend_Loader_Autoloader_Resource $_resourceLoader
inherited
Application resource autoloader
Inherited from: \Zend_Application_Bootstrap_Bootstrap::$$_resourceLoader
>VPropertyprotectedarray $_run = array()
Default valuearray()Details
Type
array
Inherited_from
\Zend_Application_Bootstrap_BootstrapAbstract::$$_run  
Inherited_from
\Zend_Application_Bootstrap_Bootstrap::$$_run  
>VPropertyprotectedarray $_started = array()
inherited

Initializers that have been started but not yet completed (circular dependency detection)

Inherited from: \Zend_Application_Bootstrap_BootstrapAbstract::$$_started\Zend_Application_Bootstrap_Bootstrap::$$_started
Default valuearray()Details
Type
array
Inherited_from
\Zend_Application_Bootstrap_BootstrapAbstract::$$_started  
Inherited_from
\Zend_Application_Bootstrap_Bootstrap::$$_started  

Methods

methodpublic__call(string $method, array $args) : void
inherited

Overloading: intercept calls to bootstrap() methods

Inherited from: \Zend_Application_Bootstrap_BootstrapAbstract::__call()\Zend_Application_Bootstrap_Bootstrap::__call()
Parameters
NameTypeDescription
$methodstring
$argsarray
Throws
ExceptionDescription
\Zend_Application_Bootstrap_ExceptionOn invalid method name
methodpublic__construct(\Zend_Application | \Zend_Application_Bootstrap_Bootstrapper $application) : void

Constructor

Ensure FrontController resource is registered

Parameters
NameTypeDescription
$application\Zend_Application | \Zend_Application_Bootstrap_Bootstrapper
Throws
ExceptionDescription
\Zend_Application_Bootstrap_ExceptionWhen invalid application is provided
methodpublic__get(string $prop) : null | mixed
inherited

Implement PHP's magic to retrieve a ressource in the bootstrap

Inherited from: \Zend_Application_Bootstrap_BootstrapAbstract::__get()\Zend_Application_Bootstrap_Bootstrap::__get()
Parameters
NameTypeDescription
$propstring
Returns
TypeDescription
null | mixed
methodpublic__isset(string $prop) : bool
inherited

Implement PHP's magic to ask for the existence of a ressource in the bootstrap

Inherited from: \Zend_Application_Bootstrap_BootstrapAbstract::__isset()\Zend_Application_Bootstrap_Bootstrap::__isset()
Parameters
NameTypeDescription
$propstring
Returns
TypeDescription
bool
methodprotected_bootstrap(null | string | array $resource = null) : void

This method may be overridden to provide custom bootstrapping logic. It is the sole method called by bootstrap().

Parameters
NameTypeDescription
$resourcenull | string | array
Throws
ExceptionDescription
\Zend_Application_Bootstrap_ExceptionWhen invalid argument was passed
methodprotected_executeResource(string $resource) : void

Checks to see if the resource has already been run. If not, it searches first to see if a local method matches the resource, and executes that. If not, it checks to see if a plugin resource matches, and executes that if found.

Finally, if not found, it throws an exception.

Parameters
NameTypeDescription
$resourcestring
Throws
ExceptionDescription
\Zend_Application_Bootstrap_ExceptionWhen resource not found
methodprotected_loadPluginResource(string $resource, array | object | null $options) : string | false
Parameters
NameTypeDescription
$resourcestring
$optionsarray | object | null
Returns
TypeDescription
string | false
methodprotected_markRun(string $resource) : void
Parameters
NameTypeDescription
$resourcestring
methodprotected_resolvePluginResourceName(\Zend_Application_Resource_Resource $resource) : string

Uses, in order of preference - $_explicitType property of resource - Short name of resource (if a matching prefix path is found) - class name (if none of the above are true)

The name is then cast to lowercase.

Parameters
NameTypeDescription
$resource\Zend_Application_Resource_Resource
Returns
TypeDescription
string
methodpublicbootstrap(null | string | array $resource = null) : \Zend_Application_Bootstrap_BootstrapAbstract
finalinherited

Bootstrap individual, all, or multiple resources

Inherited from: \Zend_Application_Bootstrap_BootstrapAbstract::bootstrap()\Zend_Application_Bootstrap_Bootstrap::bootstrap()

Marked as final to prevent issues when subclassing and naming the child class 'Bootstrap' (in which case, overriding this method would result in it being treated as a constructor).

If you need to override this functionality, override the _bootstrap() method.

Parameters
NameTypeDescription
$resourcenull | string | array
Returns
TypeDescription
\Zend_Application_Bootstrap_BootstrapAbstract
Throws
ExceptionDescription
\Zend_Application_Bootstrap_ExceptionWhen invalid argument was passed
methodpublicgetAppNamespace() : string

Get default application namespace

Proxies to getModuleName(), and returns the current module name

Returns
TypeDescription
string
methodpublicgetClassResourceNames() : array
Returns
TypeDescription
array
methodpublicgetClassResources() : array

Uses get_class_methods() by default, reflection on prior to 5.2.6, as a bug prevents the usage of get_class_methods() there.

Returns
TypeDescription
array
methodpublicgetContainer() : object
Returns
TypeDescription
object
methodpublicgetEnvironment() : string
Returns
TypeDescription
string
methodpublicgetModuleName() : string

Retrieve module name

Returns
TypeDescription
string
methodpublicgetOption(string $key) : mixed
Parameters
NameTypeDescription
$keystring
Returns
TypeDescription
mixed
methodpublicgetOptions() : array
Returns
TypeDescription
array
methodpublicgetPluginResource( $resource) : \Zend_Application_Resource_Resource
Parameters
NameTypeDescription
$resource
Returns
TypeDescription
\Zend_Application_Resource_Resource
methodpublicgetPluginResourceNames() : array
Returns
TypeDescription
array
methodpublicgetPluginResources() : array
Returns
TypeDescription
array
methodpublicgetResource(string $name) : null | mixed

During bootstrap resource initialization, you may return a value. If you do, it will be stored in the container. You can use this method to retrieve that value.

If no value was returned, this will return a null value.

Parameters
NameTypeDescription
$namestring
Returns
TypeDescription
null | mixed
methodpublicgetResourceLoader() : \Zend_Loader_Autoloader_Resource
inherited

Retrieve module resource loader

Inherited from: \Zend_Application_Bootstrap_Bootstrap::getResourceLoader()
Returns
TypeDescription
\Zend_Loader_Autoloader_Resource
methodpublichasOption(string $key) : bool
Parameters
NameTypeDescription
$keystring
Returns
TypeDescription
bool
methodpublichasPluginResource(string $resource) : bool
Parameters
NameTypeDescription
$resourcestring
Returns
TypeDescription
bool
methodpublichasResource(string $name) : bool
inherited

Determine if a resource has been stored in the container

Inherited from: \Zend_Application_Bootstrap_BootstrapAbstract::hasResource()\Zend_Application_Bootstrap_Bootstrap::hasResource()

During bootstrap resource initialization, you may return a value. If you do, it will be stored in the container. You can use this method to determine if a value was stored.

Parameters
NameTypeDescription
$namestring
Returns
TypeDescription
bool
methodpublicinitResourceLoader() : void

Ensure resource loader is loaded

methodpublicmergeOptions(array $array1, mixed $array2 = null) : array
Parameters
NameTypeDescription
$array1array
$array2mixed
Returns
TypeDescription
array
methodpublicregisterPluginResource(string | \Zend_Application_Resource_Resource $resource, mixed $options = null) : \Zend_Application_Bootstrap_BootstrapAbstract
Parameters
NameTypeDescription
$resourcestring | \Zend_Application_Resource_Resource
$optionsmixed
Returns
TypeDescription
\Zend_Application_Bootstrap_BootstrapAbstract
Throws
ExceptionDescription
\Zend_Application_Bootstrap_ExceptionWhen invalid resource is provided
methodpublicrun() : mixed
inherited

Run the application

Inherited from: \Zend_Application_Bootstrap_Bootstrap::run()

Checks to see that we have a default controller directory. If not, an exception is thrown.

If so, it registers the bootstrap with the 'bootstrap' parameter of the front controller, and dispatches the front controller.

Returns
TypeDescription
mixed
Throws
ExceptionDescription
\Zend_Application_Bootstrap_Exception
methodpublicsetAppNamespace(string $value) : \Zend_Application_Bootstrap_Bootstrap
inherited

Set application namespace (for module autoloading)

Inherited from: \Zend_Application_Bootstrap_Bootstrap::setAppNamespace()
Parameters
NameTypeDescription
$valuestring
Returns
TypeDescription
\Zend_Application_Bootstrap_Bootstrap
methodpublicsetContainer(object $container) : \Zend_Application_Bootstrap_BootstrapAbstract

By default, if a resource callback has a non-null return value, this value will be stored in a container using the resource name as the key.

Containers must be objects, and must allow setting public properties.

Parameters
NameTypeDescription
$containerobject
Returns
TypeDescription
\Zend_Application_Bootstrap_BootstrapAbstract
methodpublicsetOptions(array $options) : \Zend_Application_Bootstrap_BootstrapAbstract
Parameters
NameTypeDescription
$optionsarray
Returns
TypeDescription
\Zend_Application_Bootstrap_BootstrapAbstract
methodpublicsetResourceLoader(\Zend_Loader_Autoloader_Resource $loader) : \Zend_Application_Module_Bootstrap
inherited

Set module resource loader

Inherited from: \Zend_Application_Bootstrap_Bootstrap::setResourceLoader()
Parameters
NameTypeDescription
$loader\Zend_Loader_Autoloader_Resource
Returns
TypeDescription
\Zend_Application_Module_Bootstrap
methodpublicunregisterPluginResource(string | \Zend_Application_Resource_Resource $resource) : \Zend_Application_Bootstrap_BootstrapAbstract
Parameters
NameTypeDescription
$resourcestring | \Zend_Application_Resource_Resource
Returns
TypeDescription
\Zend_Application_Bootstrap_BootstrapAbstract
Throws
ExceptionDescription
\Zend_Application_Bootstrap_ExceptionWhen unknown resource type is provided
Documentation was generated by phpDocumentor 2.0.0a12.