PSR-0 compliant autoloader

Allows autoloading both namespaced and vendor-prefixed classes. Class lookups are performed on the filesystem. If a class file for the referenced class is not found, a PHP warning will be raised by include().

package Zend_Loader

 Methods

Constructor

__construct(null | array | \Traversable $options) 

Allow configuration of the autoloader via the constructor.

Parameters

$options

nullarray\Traversable

Defined by Autoloadable; autoload a class

autoload(string $class) : false | string

Parameters

$class

string

Returns

falsestring

Is this autoloader acting as a fallback autoloader?

isFallbackAutoloader() : bool

Returns

bool

Register the autoloader with spl_autoload

register() : void

Typically, the body of this will simply be:

spl_autoload_register(array($this, 'autoload'));

Register a namespace/directory pair

registerNamespace(string $namespace, string $directory) : \Zend\Loader\StandardAutoloader

Parameters

$namespace

string

$directory

string

Returns

Register many namespace/directory pairs at once

registerNamespaces(array $namespaces) : \Zend\Loader\StandardAutoloader

Register a prefix/directory pair

registerPrefix(string $prefix, string $directory) : \Zend\Loader\StandardAutoloader

Parameters

$prefix

string

$directory

string

Returns

Register many namespace/directory pairs at once

registerPrefixes(array $prefixes) : \Zend\Loader\StandardAutoloader

Set flag indicating fallback autoloader status

setFallbackAutoloader(bool $flag) : \Zend\Loader\StandardAutoloader

Parameters

$flag

bool

Returns

Configure autoloader

setOptions(array | \Traversable $options) : \Zend\Loader\StandardAutoloader

Allows specifying both "namespace" and "prefix" pairs, using the following structure:

array(
    'namespaces' => array(
        'Zend'     => '/path/to/Zend/library',
        'Doctrine' => '/path/to/Doctrine/library',
    ),
    'prefixes' => array(
        'Phly_'     => '/path/to/Phly/library',
    ),
    'fallback_autoloader' => true,
)

Parameters

$options

array\Traversable

Exceptions

\Zend\Loader\Exception\InvalidArgumentException

Returns

Load a class, based on its type (namespaced or prefixed)

loadClass(string $class, string $type) : bool | string

Parameters

$class

string

$type

string

Exceptions

\Zend\Loader\Exception\InvalidArgumentException

Returns

boolstring

Normalize the directory to include a trailing directory separator

normalizeDirectory(string $directory) : string

Parameters

$directory

string

Returns

string

Transform the class name to a filename

transformClassNameToFilename(string $class, string $directory) : string

Parameters

$class

string

$directory

string

Returns

string

 Properties

 

<p>Whether or not the autoloader should also act as a fallback autoloader</p>

$fallbackAutoloaderFlag : bool

 

<p>Namespace/directory pairs to search; ZF library added by default</p>

$namespaces : array

 

<p>Prefix/directory pairs to search</p>

$prefixes : array

 Constants

 

ACT_AS_FALLBACK

ACT_AS_FALLBACK 

 

AUTOREGISTER_ZF

AUTOREGISTER_ZF 

 

LOAD_NS

LOAD_NS 

 

LOAD_PREFIX

LOAD_PREFIX 

 

NS_SEPARATOR

NS_SEPARATOR 

 

PREFIX_SEPARATOR

PREFIX_SEPARATOR