__construct()
autoload()
isFallbackAutoloader()
register()
registerNamespace()
registerNamespaces()
registerPrefix()
registerPrefixes()
setFallbackAutoloader()
setOptions()
loadClass()
normalizeDirectory()
transformClassNameToFilename()
$fallbackAutoloaderFlag
$namespaces
$prefixes
ACT_AS_FALLBACK
AUTOREGISTER_ZF
LOAD_NS
LOAD_PREFIX
NS_SEPARATOR
PREFIX_SEPARATOR
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(null | array | \Traversable $options)
Allow configuration of the autoloader via the constructor.
nullarray\Traversable
autoload(string $class) : false | string
string
false
string
isFallbackAutoloader() : bool
bool
register() : void
Typically, the body of this will simply be:
spl_autoload_register(array($this, 'autoload'));
registerNamespace(string $namespace, string $directory) : \Zend\Loader\StandardAutoloader
registerNamespaces(array $namespaces) : \Zend\Loader\StandardAutoloader
registerPrefix(string $prefix, string $directory) : \Zend\Loader\StandardAutoloader
registerPrefixes(array $prefixes) : \Zend\Loader\StandardAutoloader
setFallbackAutoloader(bool $flag) : \Zend\Loader\StandardAutoloader
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,
)
array\Traversable
\Zend\Loader\Exception\InvalidArgumentException |
---|
loadClass(string $class, string $type) : bool | string
string
string
\Zend\Loader\Exception\InvalidArgumentException |
---|
bool
string
normalizeDirectory(string $directory) : string
string
string
transformClassNameToFilename(string $class, string $directory) : string
string
string
string
$fallbackAutoloaderFlag : bool
$namespaces : array
$prefixes : array
ACT_AS_FALLBACK
AUTOREGISTER_ZF
LOAD_NS
LOAD_PREFIX
NS_SEPARATOR
PREFIX_SEPARATOR