package Default

 Methods

Factory for autoloaders

factory(array|\Traversable $options = null) : void
Static

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

$options

array\Traversable

(optional) options to use. Defaults to Zend\Loader\StandardAutoloader

Exceptions

\Zend\Loader\Exception\InvalidArgumentException for invalid options
\Zend\Loader\Exception\InvalidArgumentException for unloadable autoloader classes
\Zend\Loader\Exception\DomainException for autoloader classes not implementing SplAutoloader

Retrieves an autoloader by class name

getRegisteredAutoloader(string $class) : \Zend\Loader\SplAutoloader
Static

Parameters

$class

string

Exceptions

\Zend\Loader\Exception\InvalidArgumentException for non-registered class

Returns

\Zend\Loader\SplAutoloader

Get a list of all autoloaders registered with the factory

getRegisteredAutoloaders() : array
Static

Returns an array of autoloader instances.

Returns

array

Unregister a single autoloader by class name

unregisterAutoloader(string $autoloaderClass) : boolean
Static

Parameters

$autoloaderClass

string

Returns

boolean

Unregisters all autoloaders that have been registered via the factory.

unregisterAutoloaders() : void
Static

This will NOT unregister autoloaders registered outside of the fctory.

Get an instance of the standard autoloader

getStandardAutoloader() : \Zend\Loader\SplAutoloader
Static

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" namespace.

Returns

\Zend\Loader\SplAutoloader

Checks if the object has this class as one of its parents

isSubclassOf(string $className, string $type) : boolean
Static
see
see
deprecated since zf 2.3 requires PHP >= 5.3.23

Parameters

$className

string

$type

string

Returns

boolean

 Properties

 

All autoloaders registered using the factory

$loaders : array

Default

array()
Static
 

StandardAutoloader instance for resolving autoloader classes via the include_path

$standardAutoloader : \Zend\Loader\StandardAutoloader

Default

Static

 Constants

 

STANDARD_AUTOLOADER

STANDARD_AUTOLOADER = 'Zend\Loader\StandardAutoloader'