Loader/Autoloader.php
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-2012 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Package
- Zend_Loader
- Subpackage
- Autoloader
- Version
- $Id: Autoloader.php 25024 2012-07-30 15:08:15Z rob $
\Zend_Loader_Autoloader
- Copyright
- Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Uses
- \global\Zend_Loader_Autoloader
Properties


array $_autoloaders = array()
Concrete autoloader callback implementations
array()
Details- Type
- array


array $_defaultAutoloader = array('Zend_Loader', 'loadClass')
Default autoloader callback
array('Zend_Loader', 'loadClass')
Details- Type
- array


bool $_fallbackAutoloader = false
Whether or not to act as a fallback autoloader
false
Details- Type
- bool


array $_namespaceAutoloaders = array()
Namespace-specific autoloaders
array()
Details- Type
- array


array $_namespaces = array('Zend_' => true, 'ZendX_' => true)
Supported namespaces 'Zend' and 'ZendX' by default.
array('Zend_' => true, 'ZendX_' => true)
Details- Type
- array


bool $_suppressNotFoundWarnings = false
Whether or not to suppress file not found warnings
false
Details- Type
- bool
Methods


_autoload(string $class) : bool
Internal autoloader implementation
Name | Type | Description |
---|---|---|
$class | string |
Type | Description |
---|---|
bool |


_getAvailableVersions(string $path, string $version) : array
Get available versions for the version type requested
Name | Type | Description |
---|---|---|
$path | string | |
$version | string |
Type | Description |
---|---|
array |


_getVersionPath(string $path, string $version) : void
Retrieve the filesystem path for the requested ZF version
Name | Type | Description |
---|---|---|
$path | string | |
$version | string |


_getVersionType(string $version) : string
Retrieve the ZF version type
Name | Type | Description |
---|---|---|
$version | string |
Type | Description |
---|---|
string | "latest", "major", "minor", or "specific" |
Exception | Description |
---|---|
\Zend_Loader_Exception | if version string contains too many dots |


_setNamespaceAutoloaders(array $autoloaders, string $namespace = '') : \Zend_Loader_Autoloader
Set autoloaders for a specific namespace
Name | Type | Description |
---|---|---|
$autoloaders | array | |
$namespace | string |
Type | Description |
---|---|
\Zend_Loader_Autoloader |


autoload(string $class) : bool
Autoload a class
Name | Type | Description |
---|---|---|
$class | string |
Type | Description |
---|---|
bool |


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.
Name | Type | Description |
---|---|---|
$class | string |
Type | Description |
---|---|
array | Array of autoloaders to use |


getDefaultAutoloader() : string | array
Retrieve the default autoloader callback
Type | Description |
---|---|
string | array | PHP Callback |


getInstance() : \Zend_Loader_Autoloader
Retrieve singleton instance
Type | Description |
---|---|
\Zend_Loader_Autoloader |


getNamespaceAutoloaders(string $namespace) : array
Return all autoloaders for a given namespace
Name | Type | Description |
---|---|---|
$namespace | string |
Type | Description |
---|---|
array |


getRegisteredNamespaces() : array
Get a list of registered autoload namespaces
Type | Description |
---|---|
array |


isFallbackAutoloader() : bool
Is this instance acting as a fallback autoloader?
Type | Description |
---|---|
bool |


pushAutoloader(object | array | string $callback, string | array $namespace = '') : \Zend_Loader_Autoloader
Append an autoloader to the autoloader stack
Name | 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 |
Type | Description |
---|---|
\Zend_Loader_Autoloader |


registerNamespace(string | array $namespace) : \Zend_Loader_Autoloader
Register a namespace to autoload
Name | Type | Description |
---|---|---|
$namespace | string | array |
Type | Description |
---|---|
\Zend_Loader_Autoloader |


removeAutoloader(object | array | string $callback, null | string | array $namespace = null) : \Zend_Loader_Autoloader
Remove an autoloader from the autoloader stack
Name | 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 |
Type | Description |
---|---|
\Zend_Loader_Autoloader |


setAutoloaders(array $autoloaders) : \Zend_Loader_Autoloader
Set several autoloader callbacks at once
Name | Type | Description |
---|---|---|
$autoloaders | array | Array of PHP callbacks (or Zend_Loader_Autoloader_Interface implementations) to act as autoloaders |
Type | Description |
---|---|
\Zend_Loader_Autoloader |


setDefaultAutoloader(string | array $callback) : void
Set the default autoloader implementation
Name | Type | Description |
---|---|---|
$callback | string | array | PHP callback |


setFallbackAutoloader(bool $flag) : \Zend_Loader_Autoloader
Indicate whether or not this autoloader should be a fallback autoloader
Name | Type | Description |
---|---|---|
$flag | bool |
Type | Description |
---|---|
\Zend_Loader_Autoloader |


suppressNotFoundWarnings(null | bool $flag = null) : bool | \Zend_Loader_Autoloader
Get or set the value of the "suppress not found warnings" flag
Name | Type | Description |
---|---|---|
$flag | null | bool |
Type | Description |
---|---|
bool | \Zend_Loader_Autoloader | Returns boolean if no argument is passed, object instance otherwise |


unregisterNamespace(string | array $namespace) : \Zend_Loader_Autoloader
Unload a registered autoload namespace
Name | Type | Description |
---|---|---|
$namespace | string | array |
Type | Description |
---|---|
\Zend_Loader_Autoloader |


unshiftAutoloader(object | array | string $callback, string | array $namespace = '') : \Zend_Loader_Autoloader
Add an autoloader to the beginning of the stack
Name | 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 |
Type | Description |
---|---|
\Zend_Loader_Autoloader |