Zend Framework  3.0
Static Public Member Functions | Public Attributes | Static Protected Member Functions | Static Protected Attributes | List of all members
AutoloaderFactory Class Reference

Static Public Member Functions

static factory ($options=null)
 Factory for autoloaders.
 
static getRegisteredAutoloaders ()
 Get a list of all autoloaders registered with the factory.
 
static getRegisteredAutoloader ($class)
 Retrieves an autoloader by class name.
 
static unregisterAutoloaders ()
 Unregisters all autoloaders that have been registered via the factory.
 
static unregisterAutoloader ($autoloaderClass)
 Unregister a single autoloader by class name.
 

Public Attributes

const STANDARD_AUTOLOADER = 'Zend\Loader\StandardAutoloader'
 

Static Protected Member Functions

static getStandardAutoloader ()
 Get an instance of the standard autoloader.
 
static isSubclassOf ($className, $type)
 Checks if the object has this class as one of its parents.
 

Static Protected Attributes

static $loaders = array()
 
static $standardAutoloader
 

Member Function Documentation

array All autoloaders registered using the factory (   $options = null)
static

Factory for autoloaders.

Options should be an array or Traversable object of the following structure: array( '<autoloader class="" name>="">' => $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
array | Traversable$options(optional) options to use. Defaults to Zend
Returns
void
Exceptions
Exception\InvalidArgumentExceptionfor invalid options
Exception\InvalidArgumentExceptionfor unloadable autoloader classes
Exception\DomainExceptionfor autoloader classes not implementing SplAutoloader
static getRegisteredAutoloader (   $class)
static

Retrieves an autoloader by class name.

Parameters
string$class
Returns
SplAutoloader
Exceptions
Exception\InvalidArgumentExceptionfor non-registered class
static getRegisteredAutoloaders ( )
static

Get a list of all autoloaders registered with the factory.

Returns an array of autoloader instances.

Returns
array
static getStandardAutoloader ( )
staticprotected

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

Returns
SplAutoloader
static isSubclassOf (   $className,
  $type 
)
staticprotected

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

See Also
https://bugs.php.net/bug.php?id=53727
https://github.com/zendframework/zf2/pull/1807
Deprecated:
since zf 2.3 requires PHP >= 5.3.23
Parameters
string$className
string$type
Returns
bool
static unregisterAutoloader (   $autoloaderClass)
static

Unregister a single autoloader by class name.

Parameters
string$autoloaderClass
Returns
bool
static unregisterAutoloaders ( )
static

Unregisters all autoloaders that have been registered via the factory.

This will NOT unregister autoloaders registered outside of the fctory.

Returns
void

Member Data Documentation

$loaders = array()
staticprotected
$standardAutoloader
staticprotected
const STANDARD_AUTOLOADER = 'Zend\Loader\StandardAutoloader'