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.
Abstract base class for bootstrap classes
Zend_Application|Zend_Application_Bootstrap_Bootstrapper $_application = ''
array $_classResources = ''
object $_container = ''
string $_environment = ''
array $_optionKeys = 'array'
Flattened (lowercase) option keys used for lookups
array $_options = 'array'
Zend_Loader_PluginLoader_Interface $_pluginLoader = ''
array $_pluginResources = 'array'
array $_run = 'array'
array $_started = 'array'
__call(
string $method, array $args
)
:
void
Overloading: intercept calls to bootstrap<resourcename>() methods
__construct(
Zend_Application|Zend_Application_Bootstrap_Bootstrapper $application
)
:
void
Constructor
Sets application object, initializes options, and prepares list of initializer methods.
__get(
string $prop
)
:
null|mixed
Implement PHP's magic to retrieve a ressource in the bootstrap
__isset(
string $prop
)
:
bool
Implement PHP's magic to ask for the existence of a ressource in the bootstrap
_bootstrap(
null|string|array $resource
=
null
)
:
void
Bootstrap implementation
This method may be overridden to provide custom bootstrapping logic. It is the sole method called by {@link bootstrap()}.
_executeResource(
string $resource
)
:
void
Execute a resource
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.
_loadPluginResource(
string $resource, array|object|null $options
)
:
string|false
Load a plugin resource
_markRun(
string $resource
)
:
void
Mark a resource as having run
_resolvePluginResourceName(
Zend_Application_Resource_Resource $resource
)
:
string
Resolve a plugin resource name
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.
bootstrap(
null|string|array $resource
=
null
)
:
Zend_Application_Bootstrap_BootstrapAbstract
Bootstrap individual, all, or multiple resources
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 {@link _bootstrap()} method.
getApplication(
)
:
Zend_Application|Zend_Application_Bootstrap_Bootstrapper
Retrieve parent application instance
getClassResourceNames(
)
:
array
Get class resource names
getClassResources(
)
:
array
Get class resources (as resource/method pairs)
Uses get_class_methods() by default, reflection on prior to 5.2.6, as a bug prevents the usage of get_class_methods() there.
getContainer(
)
:
object
Retrieve resource container
getEnvironment(
)
:
string
Retrieve application environment
getOption(
string $key
)
:
mixed
Retrieve a single option
getOptions(
)
:
array
Get current options from bootstrap
getPluginLoader(
)
:
Zend_Loader_PluginLoader_Interface
Get the plugin loader for resources
getPluginResource(
$resource
)
:
Zend_Application_Resource_Resource
Get a registered plugin resource
getPluginResourceNames(
)
:
array
Retrieve plugin resource names
getPluginResources(
)
:
array
Retrieve all plugin resources
getResource(
string $name
)
:
null|mixed
Retrieve a resource from the container
During bootstrap resource initialization, you may return a value. If you do, it will be stored in the {@link setContainer() container}. You can use this method to retrieve that value.
If no value was returned, this will return a null value.
hasOption(
string $key
)
:
bool
Is an option present?
hasPluginResource(
string $resource
)
:
bool
Is the requested plugin resource registered?
hasResource(
string $name
)
:
bool
Determine if a resource has been stored in the container
During bootstrap resource initialization, you may return a value. If you do, it will be stored in the {@link setContainer() container}. You can use this method to determine if a value was stored.
mergeOptions(
array $array1, mixed $array2
=
null
)
:
array
Merge options recursively
registerPluginResource(
string|Zend_Application_Resource_Resource $resource, mixed $options
=
null
)
:
Zend_Application_Bootstrap_BootstrapAbstract
Register a new resource plugin
setApplication(
Zend_Application|Zend_Application_Bootstrap_Bootstrapper $application
)
:
Zend_Application_Bootstrap_BootstrapAbstract
Set application/parent bootstrap
setContainer(
object $container
)
:
Zend_Application_Bootstrap_BootstrapAbstract
Set resource container
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.
setOptions(
array $options
)
:
Zend_Application_Bootstrap_BootstrapAbstract
Set class state
setPluginLoader(
Zend_Loader_PluginLoader_Interface $loader
)
:
Zend_Application_Bootstrap_BootstrapAbstract
Set plugin loader for loading resources
unregisterPluginResource(
string|Zend_Application_Resource_Resource $resource
)
:
Zend_Application_Bootstrap_BootstrapAbstract
Unregister a resource from the bootstrap