Zend Framework
2.4
|
PSR-0 compliant autoloader. More...
Public Member Functions | |
__construct ($options=null) | |
Constructor. | |
setOptions ($options) | |
Configure autoloader. | |
setFallbackAutoloader ($flag) | |
Set flag indicating fallback autoloader status. | |
isFallbackAutoloader () | |
Is this autoloader acting as a fallback autoloader? | |
registerNamespace ($namespace, $directory) | |
Register a namespace/directory pair. | |
registerNamespaces ($namespaces) | |
Register many namespace/directory pairs at once. | |
registerPrefix ($prefix, $directory) | |
Register a prefix/directory pair. | |
registerPrefixes ($prefixes) | |
Register many namespace/directory pairs at once. | |
autoload ($class) | |
Defined by Autoloadable; autoload a class. | |
register () | |
Register the autoloader with spl_autoload. | |
Public Attributes | |
const | NS_SEPARATOR = '\\' |
const | PREFIX_SEPARATOR = '_' |
const | LOAD_NS = 'namespaces' |
const | LOAD_PREFIX = 'prefixes' |
const | ACT_AS_FALLBACK = 'fallback_autoloader' |
const | AUTOREGISTER_ZF = 'autoregister_zf' |
Protected Member Functions | |
transformClassNameToFilename ($class, $directory) | |
Transform the class name to a filename. | |
loadClass ($class, $type) | |
Load a class, based on its type (namespaced or prefixed) | |
normalizeDirectory ($directory) | |
Normalize the directory to include a trailing directory separator. | |
Protected Attributes | |
$namespaces = array() | |
$prefixes = array() | |
$fallbackAutoloaderFlag = false | |
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().
__construct | ( | $options = null | ) |
autoload | ( | $class | ) |
Defined by Autoloadable; autoload a class.
string | $class |
Implements SplAutoloader.
isFallbackAutoloader | ( | ) |
Is this autoloader acting as a fallback autoloader?
|
protected |
Load a class, based on its type (namespaced or prefixed)
string | $class | |
string | $type |
Exception\InvalidArgumentException |
|
protected |
Normalize the directory to include a trailing directory separator.
string | $directory |
register | ( | ) |
registerNamespace | ( | $namespace, | |
$directory | |||
) |
Register a namespace/directory pair.
string | $namespace | |
string | $directory |
registerNamespaces | ( | $namespaces | ) |
Register many namespace/directory pairs at once.
array | $namespaces |
Exception\InvalidArgumentException |
registerPrefix | ( | $prefix, | |
$directory | |||
) |
Register a prefix/directory pair.
string | $prefix | |
string | $directory |
registerPrefixes | ( | $prefixes | ) |
Register many namespace/directory pairs at once.
array | $prefixes |
Exception\InvalidArgumentException |
setFallbackAutoloader | ( | $flag | ) |
setOptions | ( | $options | ) |
Configure autoloader.
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, )
array | \Traversable | $options |
Exception\InvalidArgumentException |
Implements SplAutoloader.
|
protected |
Transform the class name to a filename.
string | $class | |
string | $directory |
|
protected |
|
protected |
|
protected |
const ACT_AS_FALLBACK = 'fallback_autoloader' |
const AUTOREGISTER_ZF = 'autoregister_zf' |
const LOAD_NS = 'namespaces' |
const LOAD_PREFIX = 'prefixes' |
const NS_SEPARATOR = '\\' |
const PREFIX_SEPARATOR = '_' |