Loader/AutoloaderFactory.php

Show: inherited
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 [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

Package: Zend\Loader

Copyright
Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  

Constants

Constant  STANDARD_AUTOLOADER = 'Zend_Loader_StandardAutoloader'

Properties

Propertyprotectedarray $loaders = array()
static

<p>All autoloaders registered using the factory</p>
Default valuearray()Details
Type
array
Propertyprotected\Zend_Loader_StandardAutoloader $standardAutoloader =
static

<p>StandardAutoloader instance for resolving autoloader classes via the include_path</p>

Methods

methodpublicfactory(array | \Traversable $options = null) : void
static

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).

Parameters
Name Type Description
$options array | \Traversable

(optional) options to use. Defaults to Zend_Loader_StandardAutoloader

Throws
Exception Description
\Zend_Loader_Exception_InvalidArgumentException for invalid options
\Zend_Loader_Exception_InvalidArgumentException for unloadable autoloader classes
methodpublicgetRegisteredAutoloader(string $class) : \Zend_Loader_SplAutoloader
static

Retrieves an autoloader by class name

Parameters
Name Type Description
$class string
Returns
Type Description
\Zend_Loader_SplAutoloader
Throws
Exception Description
\Zend_Loader_Exception_InvalidArgumentException for non-registered class
methodpublicgetRegisteredAutoloaders() : array
static

Get an list of all autoloaders registered with the factory

Returns an array of autoloader instances.

Returns
Type Description
array
methodprotectedgetStandardAutoloader() : \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.

Returns
Type Description
\Zend_Loader_SplAutoloader
methodpublicunregisterAutoloader(string $autoloaderClass) : bool
static

Unregister a single autoloader by class name

Parameters
Name Type Description
$autoloaderClass string
Returns
Type Description
bool
methodpublicunregisterAutoloaders() : void
static

Unregisters all autoloaders that have been registered via the factory.

This will NOT unregister autoloaders registered outside of the fctory.

Documentation was generated by phpDocumentor 2.0.0a8.