Loader/AutoloaderFactory.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-2014 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Package
- Zend_Loader
\Zend_Loader_AutoloaderFactory
Package: Zend_Loader
Throws
- Copyright
- Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
Constants
Properties
array $loaders = array()
static
All autoloaders registered using the factory
Default value
array()
Details- Type
- array
Methods
factory(array | \Traversable $options = null) : void
static
Factory for autoloaders
Options should be an array or Traversable object of the following structure:
Parameters
array(
'' => $autoloaderOptions,
)
The factory will then loop through and instantiate each autoloader with
the specified options, and register each with the spl_autoloader.
You may retrieve the concrete autoloader instances later using
{@link getRegisteredAutoloaders()}.
Note that the class names must be resolvable on the include_path or via
the Zend library, using PSR-0 rules (unless the class has already been
loaded).Name | Type | Description |
---|---|---|
$options | array | \Traversable | (optional) options to use. Defaults to Zend_Loader_StandardAutoloader |
Exception | Description |
---|---|
\Zend_Loader_Exception_InvalidArgumentException | for invalid options |
\Zend_Loader_Exception_InvalidArgumentException | for unloadable autoloader classes |
getRegisteredAutoloader(string $class) : \Zend_Loader_SplAutoloader
static
Retrieves an autoloader by class name
Parameters
Returns
Throws
Name | Type | Description |
---|---|---|
$class | string |
Type | Description |
---|---|
\Zend_Loader_SplAutoloader |
Exception | Description |
---|---|
\Zend_Loader_Exception_InvalidArgumentException | for non-registered class |
getRegisteredAutoloaders() : array
static
Get an list of all autoloaders registered with the factory
Returns an array of autoloader instances.
ReturnsType | Description |
---|---|
array |
getStandardAutoloader() : \Zend_Loader_SplAutoloader
static
Get an instance of the standard autoloader
Used to attempt to resolve autoloader classes, using the
StandardAutoloader. The instance is marked as a fallback autoloader, to
allow resolving autoloaders not under the "Zend" or "Zend" namespaces.
ReturnsType | Description |
---|---|
\Zend_Loader_SplAutoloader |
unregisterAutoloader(string $autoloaderClass) : bool
static
Unregister a single autoloader by class name
Parameters
Returns
Name | Type | Description |
---|---|---|
$autoloaderClass | string |
Type | Description |
---|---|
bool |