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 [email protected] 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_Loader
\Zend_Loader_AutoloaderFactory
- Copyright
- Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
Constants
Properties


array $loaders = array()
array()
Details- Type
- array
Methods


factory(array | \Traversable $options = null) : void
Factory for autoloaders
Options should be an array or Traversable object of the following structure:
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 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
Retrieves an autoloader by class name
Name | Type | Description |
---|---|---|
$class | string |
Type | Description |
---|---|
\Zend_Loader_SplAutoloader |
Exception | Description |
---|---|
\Zend_Loader_Exception_InvalidArgumentException | for non-registered class |


getRegisteredAutoloaders() : array
Get an list of all autoloaders registered with the factory
Returns an array of autoloader instances.
Type | Description |
---|---|
array |


getStandardAutoloader() : \Zend_Loader_SplAutoloader
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.
Type | Description |
---|---|
\Zend_Loader_SplAutoloader |


unregisterAutoloader(string $autoloaderClass) : bool
Unregister a single autoloader by class name
Name | Type | Description |
---|---|---|
$autoloaderClass | string |
Type | Description |
---|---|
bool |