Loader/StandardAutoloader.php

Show: PublicProtectedPrivateinherited
Table of Contents
Zend Framework
LICENSE This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to license@zend.com so we can send you a copy immediately.
Category
Zend  
Copyright
Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  
Package
Zend_Loader  

\Zend_Loader_StandardAutoloader

Package: Zend_Loader
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().
Implements
Copyright
Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD {@link http://framework.zend.com/license/new-bsd}  

Constants

>VConstant  NS_SEPARATOR = '\\'
>VConstant  PREFIX_SEPARATOR = '_'
>VConstant  LOAD_NS = 'namespaces'
>VConstant  LOAD_PREFIX = 'prefixes'
>VConstant  ACT_AS_FALLBACK = 'fallback_autoloader'
>VConstant  AUTOREGISTER_ZF = 'autoregister_zf'

Properties

>VPropertyprotectedbool $error
Details
Type
bool
>VPropertyprotectedbool $fallbackAutoloaderFlag = false

Whether or not the autoloader should also act as a fallback autoloader

Default valuefalseDetails
Type
bool
>VPropertyprotectedarray $namespaces = array()

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

Default valuearray()Details
Type
array
>VPropertyprotectedarray $prefixes = array()

Prefix/directory pairs to search

Default valuearray()Details
Type
array

Methods

methodpublic__construct(null | array | \Traversable $options = null) : void

Constructor

Parameters
NameTypeDescription
$optionsnull | array | \Traversable
methodpublicautoload(string $class) : false | string

Defined by Autoloadable; autoload a class

Parameters
NameTypeDescription
$classstring
Returns
TypeDescription
false | string
methodpublichandleError(mixed $errno, mixed $errstr) : void

Error handler

Used by {@link loadClass} during fallback autoloading in PHP versions prior to 5.3.0.
Parameters
NameTypeDescription
$errnomixed
$errstrmixed
methodpublicisFallbackAutoloader() : bool

Is this autoloader acting as a fallback autoloader?

Returns
TypeDescription
bool
methodprotectedloadClass(string $class, string $type) : void

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

Parameters
NameTypeDescription
$classstring
$typestring
methodprotectednormalizeDirectory(string $directory) : string

Normalize the directory to include a trailing directory separator

Parameters
NameTypeDescription
$directorystring
Returns
TypeDescription
string
methodpublicregister() : void

Register the autoloader with spl_autoload

methodpublicregisterNamespace(string $namespace, string $directory) : \Zend_Loader_StandardAutoloader

Register a namespace/directory pair

Parameters
NameTypeDescription
$namespacestring
$directorystring
Returns
TypeDescription
\Zend_Loader_StandardAutoloader
methodpublicregisterNamespaces(array $namespaces) : \Zend_Loader_StandardAutoloader

Register many namespace/directory pairs at once

Parameters
NameTypeDescription
$namespacesarray
Returns
TypeDescription
\Zend_Loader_StandardAutoloader
methodpublicregisterPrefix(string $prefix, string $directory) : \Zend_Loader_StandardAutoloader

Register a prefix/directory pair

Parameters
NameTypeDescription
$prefixstring
$directorystring
Returns
TypeDescription
\Zend_Loader_StandardAutoloader
methodpublicregisterPrefixes(array $prefixes) : \Zend_Loader_StandardAutoloader

Register many namespace/directory pairs at once

Parameters
NameTypeDescription
$prefixesarray
Returns
TypeDescription
\Zend_Loader_StandardAutoloader
methodpublicsetFallbackAutoloader(bool $flag) : \Zend_Loader_StandardAutoloader

Set flag indicating fallback autoloader status

Parameters
NameTypeDescription
$flagbool
Returns
TypeDescription
\Zend_Loader_StandardAutoloader
methodpublicsetOptions(array | \Traversable $options) : \Zend_Loader_StandardAutoloader

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, )
Parameters
NameTypeDescription
$optionsarray | \Traversable
Returns
TypeDescription
\Zend_Loader_StandardAutoloader
methodprotectedtransformClassNameToFilename(string $class, string $directory) : string

Transform the class name to a filename

Parameters
NameTypeDescription
$classstring
$directorystring
Returns
TypeDescription
string
Documentation was generated by phpDocumentor 2.2.0 .