Properties

$_autoloaders

$_autoloaders : array

Type

array — Concrete autoloader callback implementations

$_defaultAutoloader

$_defaultAutoloader : array

Type

array — Default autoloader callback

$_fallbackAutoloader

$_fallbackAutoloader : boolean

Type

boolean — Whether or not to act as a fallback autoloader

$_internalAutoloader

$_internalAutoloader : array

Type

array — Callback for internal autoloader implementation

$_namespaces

$_namespaces : array

Type

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

$_namespaceAutoloaders

$_namespaceAutoloaders : array

Type

array — Namespace-specific autoloaders

$_suppressNotFoundWarnings

$_suppressNotFoundWarnings : boolean

Type

boolean — Whether or not to suppress file not found warnings

$_zfPath

$_zfPath : null|string

Type

null|string

Methods

getInstance()

getInstance() : \Zend_Loader_Autoloader

Retrieve singleton instance

Returns

\Zend_Loader_Autoloader

resetInstance()

resetInstance() : void

Reset the singleton instance

autoload()

autoload(string  $class) : boolean

Autoload a class

Parameters

string $class

Returns

boolean

setDefaultAutoloader()

setDefaultAutoloader(string|array  $callback) : void

Set the default autoloader implementation

Parameters

string|array $callback

PHP callback

getDefaultAutoloader()

getDefaultAutoloader() : string|array

Retrieve the default autoloader callback

Returns

string|array —

PHP Callback

setAutoloaders()

setAutoloaders(array  $autoloaders) : \Zend_Loader_Autoloader

Set several autoloader callbacks at once

Parameters

array $autoloaders

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

Returns

\Zend_Loader_Autoloader

getAutoloaders()

getAutoloaders() : array

Get attached autoloader implementations

Returns

array

getNamespaceAutoloaders()

getNamespaceAutoloaders(string  $namespace) : array

Return all autoloaders for a given namespace

Parameters

string $namespace

Returns

array

registerNamespace()

registerNamespace(string|array  $namespace) : \Zend_Loader_Autoloader

Register a namespace to autoload

Parameters

string|array $namespace

Returns

\Zend_Loader_Autoloader

unregisterNamespace()

unregisterNamespace(string|array  $namespace) : \Zend_Loader_Autoloader

Unload a registered autoload namespace

Parameters

string|array $namespace

Returns

\Zend_Loader_Autoloader

getRegisteredNamespaces()

getRegisteredNamespaces() : array

Get a list of registered autoload namespaces

Returns

array

setZfPath()

setZfPath(  $spec,   $version = 'latest') 

Parameters

$spec
$version

getZfPath()

getZfPath() 

suppressNotFoundWarnings()

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

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

Parameters

null|boolean $flag

Returns

boolean|\Zend_Loader_Autoloader

Returns boolean if no argument is passed, object instance otherwise

setFallbackAutoloader()

setFallbackAutoloader(boolean  $flag) : \Zend_Loader_Autoloader

Indicate whether or not this autoloader should be a fallback autoloader

Parameters

boolean $flag

Returns

\Zend_Loader_Autoloader

isFallbackAutoloader()

isFallbackAutoloader() : boolean

Is this instance acting as a fallback autoloader?

Returns

boolean

getClassAutoloaders()

getClassAutoloaders(string  $class) : array

Get autoloaders to use when matching class

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

string $class

Returns

array —

Array of autoloaders to use

unshiftAutoloader()

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

Add an autoloader to the beginning of the stack

Parameters

object|array|string $callback

PHP callback or Zend_Loader_Autoloader_Interface implementation

string|array $namespace

Specific namespace(s) under which to register callback

Returns

\Zend_Loader_Autoloader

pushAutoloader()

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

Append an autoloader to the autoloader stack

Parameters

object|array|string $callback

PHP callback or Zend_Loader_Autoloader_Interface implementation

string|array $namespace

Specific namespace(s) under which to register callback

Returns

\Zend_Loader_Autoloader

removeAutoloader()

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

Remove an autoloader from the autoloader stack

Parameters

object|array|string $callback

PHP callback or Zend_Loader_Autoloader_Interface implementation

null|string|array $namespace

Specific namespace(s) from which to remove autoloader

Returns

\Zend_Loader_Autoloader

__construct()

__construct() : void

Constructor

Registers instance with spl_autoload stack

_autoload()

_autoload(string  $class) : boolean

Internal autoloader implementation

Parameters

string $class

Returns

boolean

_setNamespaceAutoloaders()

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

Set autoloaders for a specific namespace

Parameters

array $autoloaders
string $namespace

Returns

\Zend_Loader_Autoloader

_getVersionPath()

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

Retrieve the filesystem path for the requested ZF version

Parameters

string $path
string $version

_getVersionType()

_getVersionType(string  $version) : string

Retrieve the ZF version type

Parameters

string $version

Throws

\Zend_Loader_Exception

if version string contains too many dots

Returns

string —

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

_getAvailableVersions()

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

Get available versions for the version type requested

Parameters

string $path
string $version

Returns

array