Autoloader stack and namespace autoloader

uses
package Zend_Loader
subpackage Autoloader
copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
license New BSD License

 Methods

Autoload a class

autoload(string $class) : boolean
Static

Parameters

$class

string

Returns

boolean

Get attached autoloader implementations

getAutoloaders() : array

Returns

array

Get autoloaders to use when matching class

getClassAutoloaders(string $class) : array

Determines if the class matches a registered namespace, and, if so, returns only the autoloaders for that namespace. Otherwise, it returns all non-namespaced autoloaders.

Parameters

$class

string

Returns

arrayArray of autoloaders to use

Retrieve the default autoloader callback

getDefaultAutoloader() : string | array

Returns

stringarrayPHP Callback

Retrieve singleton instance

getInstance() : \Zend_Loader_Autoloader
Static

Returns

\Zend_Loader_Autoloader

Return all autoloaders for a given namespace

getNamespaceAutoloaders(string $namespace) : array

Parameters

$namespace

string

Returns

array

Get a list of registered autoload namespaces

getRegisteredNamespaces() : array

Returns

array

getZfPath()

getZfPath() 

Is this instance acting as a fallback autoloader?

isFallbackAutoloader() : boolean

Returns

boolean

Append an autoloader to the autoloader stack

pushAutoloader(object|array|string $callback, string|array $namespace = '') : \Zend_Loader_Autoloader

Parameters

$callback

objectarraystring

PHP callback or Zend_Loader_Autoloader_Interface implementation

$namespace

stringarray

Specific namespace(s) under which to register callback

Returns

\Zend_Loader_Autoloader

Register a namespace to autoload

registerNamespace(string|array $namespace) : \Zend_Loader_Autoloader

Parameters

$namespace

stringarray

Returns

\Zend_Loader_Autoloader

Remove an autoloader from the autoloader stack

removeAutoloader(object|array|string $callback, null|string|array $namespace = null) : \Zend_Loader_Autoloader

Parameters

$callback

objectarraystring

PHP callback or Zend_Loader_Autoloader_Interface implementation

$namespace

nullstringarray

Specific namespace(s) from which to remove autoloader

Returns

\Zend_Loader_Autoloader

Reset the singleton instance

resetInstance() : void
Static

Set several autoloader callbacks at once

setAutoloaders(array $autoloaders) : \Zend_Loader_Autoloader

Parameters

$autoloaders

array

Array of PHP callbacks (or Zend_Loader_Autoloader_Interface implementations) to act as autoloaders

Returns

\Zend_Loader_Autoloader

Set the default autoloader implementation

setDefaultAutoloader(string|array $callback) : void

Parameters

$callback

stringarray

PHP callback

Indicate whether or not this autoloader should be a fallback autoloader

setFallbackAutoloader(boolean $flag) : \Zend_Loader_Autoloader

Parameters

$flag

boolean

Returns

\Zend_Loader_Autoloader

setZfPath()

setZfPath($spec, $version = 'latest'

Parameters

$spec

$version

Get or set the value of the "suppress not found warnings" flag

suppressNotFoundWarnings(null|boolean $flag = null) : boolean | \Zend_Loader_Autoloader

Parameters

$flag

nullboolean

Returns

boolean\Zend_Loader_AutoloaderReturns boolean if no argument is passed, object instance otherwise

Unload a registered autoload namespace

unregisterNamespace(string|array $namespace) : \Zend_Loader_Autoloader

Parameters

$namespace

stringarray

Returns

\Zend_Loader_Autoloader

Add an autoloader to the beginning of the stack

unshiftAutoloader(object|array|string $callback, string|array $namespace = '') : \Zend_Loader_Autoloader

Parameters

$callback

objectarraystring

PHP callback or Zend_Loader_Autoloader_Interface implementation

$namespace

stringarray

Specific namespace(s) under which to register callback

Returns

\Zend_Loader_Autoloader

Constructor

__construct() : void

Registers instance with spl_autoload stack

Internal autoloader implementation

_autoload(string $class) : boolean

Parameters

$class

string

Returns

boolean

Get available versions for the version type requested

_getAvailableVersions(string $path, string $version) : array

Parameters

$path

string

$version

string

Returns

array

Retrieve the filesystem path for the requested ZF version

_getVersionPath(string $path, string $version) : void

Parameters

$path

string

$version

string

Retrieve the ZF version type

_getVersionType(string $version) : string

Parameters

$version

string

Exceptions

\Zend_Loader_Exception if version string contains too many dots

Returns

string"latest", "major", "minor", or "specific"

Set autoloaders for a specific namespace

_setNamespaceAutoloaders(array $autoloaders, string $namespace = '') : \Zend_Loader_Autoloader

Parameters

$autoloaders

array

$namespace

string

Returns

\Zend_Loader_Autoloader

 Properties

 

Concrete autoloader callback implementations

$_autoloaders : array

Default

array()
 

Default autoloader callback

$_defaultAutoloader : array

Default

array('Zend_Loader', 'loadClass')
 

Whether or not to act as a fallback autoloader

$_fallbackAutoloader : boolean

Default

false
 

Singleton instance

$_instance : \Zend_Loader_Autoloader

Default

Static
 

Callback for internal autoloader implementation

$_internalAutoloader : array

Default

 

Namespace-specific autoloaders

$_namespaceAutoloaders : array

Default

array()
 

Supported namespaces 'Zend' and 'ZendX' by default.

$_namespaces : array

Default

array('Zend_' => true, 'ZendX_' => true)
 

Whether or not to suppress file not found warnings

$_suppressNotFoundWarnings : boolean

Default

false
 

$_zfPath

$_zfPath : null | string

Default