Loader/Autoloader.php
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
- Subpackage
- Autoloader
- Version
- $Id$
\Zend_Loader_Autoloader
Package: Zend_Loader\AutoloaderAutoloader stack and namespace autoloader
- Copyright
- Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Uses
-
Properties
array $_autoloaders = array()
Concrete autoloader callback implementations
Default valuearray()
Details- Type
- array
array $_defaultAutoloader = array('Zend_Loader', 'loadClass')
Default autoloader callback
Default valuearray('Zend_Loader', 'loadClass')
Details- Type
- array
bool $_fallbackAutoloader = false
Whether or not to act as a fallback autoloader
Default valuefalse
Details- Type
- bool
array $_namespaceAutoloaders = array()
Namespace-specific autoloaders
Default valuearray()
Details- Type
- array
array $_namespaces = array('Zend_' => true, 'ZendX_' => true)
Supported namespaces 'Zend' and 'ZendX' by default.
Default valuearray('Zend_' => true, 'ZendX_' => true)
Details- Type
- array
bool $_suppressNotFoundWarnings = false
Whether or not to suppress file not found warnings
Default valuefalse
Details- Type
- bool
Methods
_autoload(string $class) : bool
Internal autoloader implementation
ParametersName | Type | Description |
---|
$class | string | |
---|
Returns _getAvailableVersions(string $path, string $version) : array
Get available versions for the version type requested
ParametersName | Type | Description |
---|
$path | string | |
---|
$version | string | |
---|
Returns _getVersionPath(string $path, string $version) : void
Retrieve the filesystem path for the requested ZF version
ParametersName | Type | Description |
---|
$path | string | |
---|
$version | string | |
---|
_getVersionType(string $version) : string
Retrieve the ZF version type
ParametersName | Type | Description |
---|
$version | string | |
---|
ReturnsType | Description |
---|
string | "latest", "major", "minor", or "specific" |
Throws _setNamespaceAutoloaders(array $autoloaders, string $namespace = '') : \Zend_Loader_Autoloader
Set autoloaders for a specific namespace
ParametersName | Type | Description |
---|
$autoloaders | array | |
---|
$namespace | string | |
---|
Returns 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.
ParametersName | Type | Description |
---|
$class | string | |
---|
ReturnsType | Description |
---|
array | Array of autoloaders to use |
getDefaultAutoloader() : string | array
Retrieve the default autoloader callback
ReturnsType | Description |
---|
string | array | PHP Callback |
getNamespaceAutoloaders(string $namespace) : array
Return all autoloaders for a given namespace
ParametersName | Type | Description |
---|
$namespace | string | |
---|
Returns pushAutoloader(object | array | string $callback, string | array $namespace = '') : \Zend_Loader_Autoloader
Append an autoloader to the autoloader stack
ParametersName | Type | Description |
---|
$callback | object | array | string | PHP callback or Zend_Loader_Autoloader_Interface implementation |
---|
$namespace | string | array | Specific namespace(s) under which to register callback |
---|
Returns registerNamespace(string | array $namespace) : \Zend_Loader_Autoloader
Register a namespace to autoload
ParametersName | Type | Description |
---|
$namespace | string | array | |
---|
Returns removeAutoloader(object | array | string $callback, null | string | array $namespace = null) : \Zend_Loader_Autoloader
Remove an autoloader from the autoloader stack
ParametersName | Type | Description |
---|
$callback | object | array | string | PHP callback or Zend_Loader_Autoloader_Interface implementation |
---|
$namespace | null | string | array | Specific namespace(s) from which to remove autoloader |
---|
Returns setAutoloaders(array $autoloaders) : \Zend_Loader_Autoloader
Set several autoloader callbacks at once
ParametersName | Type | Description |
---|
$autoloaders | array | Array of PHP callbacks (or Zend_Loader_Autoloader_Interface implementations) to act as autoloaders |
---|
Returns setDefaultAutoloader(string | array $callback) : void
Set the default autoloader implementation
ParametersName | Type | Description |
---|
$callback | string | array | PHP callback |
---|
setFallbackAutoloader(bool $flag) : \Zend_Loader_Autoloader
Indicate whether or not this autoloader should be a fallback autoloader
ParametersName | Type | Description |
---|
$flag | bool | |
---|
Returns suppressNotFoundWarnings(null | bool $flag = null) : bool | \Zend_Loader_Autoloader
Get or set the value of the "suppress not found warnings" flag
ParametersName | Type | Description |
---|
$flag | null | bool | |
---|
Returns unregisterNamespace(string | array $namespace) : \Zend_Loader_Autoloader
Unload a registered autoload namespace
ParametersName | Type | Description |
---|
$namespace | string | array | |
---|
Returns unshiftAutoloader(object | array | string $callback, string | array $namespace = '') : \Zend_Loader_Autoloader
Add an autoloader to the beginning of the stack
ParametersName | Type | Description |
---|
$callback | object | array | string | PHP callback or Zend_Loader_Autoloader_Interface implementation |
---|
$namespace | string | array | Specific namespace(s) under which to register callback |
---|
Returns