API Documentation

Zend/Loader/Autoloader.php

Show: inherited
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-2012 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  
Package
Zend_Loader  
Subpackage
Autoloader  
Version
$Id: Autoloader.php 24594 2012-01-05 21:27:01Z matthew $  

\Zend_Loader_Autoloader

Package: Zend\Loader\Autoloader

Autoloader stack and namespace autoloader

Copyright
Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  
Used_by
\Zend_Loader_Autoloader  
Uses
\Zend_Loader_Autoloader  

Properties

Propertyprotectedarray  $_autoloaders= 'array()'

Concrete autoloader callback implementations
Default valuearray()Details
Type
array
Propertyprotectedarray  $_defaultAutoloader= 'array('Zend_Loader''

Default autoloader callback
Default valuearray('Zend_Loader'Details
Type
array
Propertyprotectedbool  $_fallbackAutoloader= 'false'

Whether or not to act as a fallback autoloader
Default valuefalseDetails
Type
bool
Propertyprotected\Zend_Loader_Autoloader  $_instance= ''
static

Singleton instance
Propertyprotectedarray  $_internalAutoloader= ''

Callback for internal autoloader implementation
Details
Type
array
Propertyprotectedarray  $_namespaceAutoloaders= 'array()'

Namespace-specific autoloaders
Default valuearray()Details
Type
array
Propertyprotectedarray  $_namespaces= 'array( 'Zend_' => true'

Supported namespaces 'Zend' and 'ZendX' by default.
Default valuearray( 'Zend_' => trueDetails
Type
array
Propertyprotectedbool  $_suppressNotFoundWarnings= 'false'

Whether or not to suppress file not found warnings
Default valuefalseDetails
Type
bool
Propertyprotectednull|string  $_zfPath= ''

Details
Type
nullstring

Methods

methodprotected__construct( ) : void

Constructor

Registers instance with spl_autoload stack

methodprotected_autoload( string $class ) : bool

Internal autoloader implementation

Parameters
Name Type Description
$class string
Returns
Type Description
bool
methodprotected_getAvailableVersions( string $path, string $version ) : array

Get available versions for the version type requested

Parameters
Name Type Description
$path string
$version string
Returns
Type Description
array
methodprotected_getVersionPath( string $path, string $version ) : void

Retrieve the filesystem path for the requested ZF version

Parameters
Name Type Description
$path string
$version string
methodprotected_getVersionType( string $version ) : string

Retrieve the ZF version type

Parameters
Name Type Description
$version string
Returns
Type Description
string "latest", "major", "minor", or "specific"
Throws
Exception Description
\Zend_Loader_Exception if version string contains too many dots
methodprotected_setNamespaceAutoloaders( array $autoloaders, string $namespace = '' ) : \Zend_Loader_Autoloader

Set autoloaders for a specific namespace

Parameters
Name Type Description
$autoloaders array
$namespace string
Returns
Type Description
\Zend_Loader_Autoloader
methodpublicautoload( string $class ) : bool
static

Autoload a class

Parameters
Name Type Description
$class string
Returns
Type Description
bool
methodpublicgetAutoloaders( ) : array

Get attached autoloader implementations

Returns
Type Description
array
methodpublicgetClassAutoloaders( 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.

Parameters
Name Type Description
$class string
Returns
Type Description
array Array of autoloaders to use
methodpublicgetDefaultAutoloader( ) : string|array

Retrieve the default autoloader callback

Returns
Type Description
string|array PHP Callback
methodpublicgetInstance( ) : \Zend_Loader_Autoloader
static

Retrieve singleton instance

Returns
Type Description
\Zend_Loader_Autoloader
methodpublicgetNamespaceAutoloaders( string $namespace ) : array

Return all autoloaders for a given namespace

Parameters
Name Type Description
$namespace string
Returns
Type Description
array
methodpublicgetRegisteredNamespaces( ) : array

Get a list of registered autoload namespaces

Returns
Type Description
array
methodpublicgetZfPath( ) : void

methodpublicisFallbackAutoloader( ) : bool

Is this instance acting as a fallback autoloader?

Returns
Type Description
bool
methodpublicpushAutoloader( object|array|string $callback, string|array $namespace = '' ) : \Zend_Loader_Autoloader

Append an autoloader to the autoloader stack

Parameters
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

Returns
Type Description
\Zend_Loader_Autoloader
methodpublicregisterNamespace( string|array $namespace ) : \Zend_Loader_Autoloader

Register a namespace to autoload

Parameters
Name Type Description
$namespace string|array
Returns
Type Description
\Zend_Loader_Autoloader
methodpublicremoveAutoloader( object|array|string $callback, null|string|array $namespace = null ) : \Zend_Loader_Autoloader

Remove an autoloader from the autoloader stack

Parameters
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

Returns
Type Description
\Zend_Loader_Autoloader
methodpublicresetInstance( ) : void
static

Reset the singleton instance

methodpublicsetAutoloaders( array $autoloaders ) : \Zend_Loader_Autoloader

Set several autoloader callbacks at once

Parameters
Name Type Description
$autoloaders array

Array of PHP callbacks (or Zend_Loader_Autoloader_Interface implementations) to act as autoloaders

Returns
Type Description
\Zend_Loader_Autoloader
methodpublicsetDefaultAutoloader( string|array $callback ) : void

Set the default autoloader implementation

Parameters
Name Type Description
$callback string|array

PHP callback

methodpublicsetFallbackAutoloader( bool $flag ) : \Zend_Loader_Autoloader

Indicate whether or not this autoloader should be a fallback autoloader

Parameters
Name Type Description
$flag bool
Returns
Type Description
\Zend_Loader_Autoloader
methodpublicsetZfPath(  $spec,  $version = 'latest' ) : void

Parameters
Name Type Description
$spec
$version
methodpublicsuppressNotFoundWarnings( null|bool $flag = null ) : bool|\Zend_Loader_Autoloader

Get or set the value of the "suppress not found warnings" flag

Parameters
Name Type Description
$flag null|bool
Returns
Type Description
bool|\Zend_Loader_Autoloader Returns boolean if no argument is passed, object instance otherwise
methodpublicunregisterNamespace( string|array $namespace ) : \Zend_Loader_Autoloader

Unload a registered autoload namespace

Parameters
Name Type Description
$namespace string|array
Returns
Type Description
\Zend_Loader_Autoloader
methodpublicunshiftAutoloader( object|array|string $callback, string|array $namespace = '' ) : \Zend_Loader_Autoloader

Add an autoloader to the beginning of the stack

Parameters
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

Returns
Type Description
\Zend_Loader_Autoloader
Documentation was generated by DocBlox 0.15.1.