Zend Framework  1.12
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
Zend_Loader_Autoloader Class Reference

Public Member Functions

 setDefaultAutoloader ($callback)
 Set the default autoloader implementation.
 
 getDefaultAutoloader ()
 Retrieve the default autoloader callback.
 
 setAutoloaders (array $autoloaders)
 Set several autoloader callbacks at once.
 
 getAutoloaders ()
 Get attached autoloader implementations.
 
 getNamespaceAutoloaders ($namespace)
 Return all autoloaders for a given namespace.
 
 registerNamespace ($namespace)
 Register a namespace to autoload.
 
 unregisterNamespace ($namespace)
 Unload a registered autoload namespace.
 
 getRegisteredNamespaces ()
 Get a list of registered autoload namespaces.
 
 setZfPath ($spec, $version= 'latest')
 
 getZfPath ()
 
 suppressNotFoundWarnings ($flag=null)
 Get or set the value of the "suppress not found warnings" flag.
 
 setFallbackAutoloader ($flag)
 Indicate whether or not this autoloader should be a fallback autoloader.
 
 isFallbackAutoloader ()
 Is this instance acting as a fallback autoloader?
 
 getClassAutoloaders ($class)
 Get autoloaders to use when matching class.
 
 unshiftAutoloader ($callback, $namespace= '')
 Add an autoloader to the beginning of the stack.
 
 pushAutoloader ($callback, $namespace= '')
 Append an autoloader to the autoloader stack.
 
 removeAutoloader ($callback, $namespace=null)
 Remove an autoloader from the autoloader stack.
 

Static Public Member Functions

static getInstance ()
 Retrieve singleton instance.
 
static resetInstance ()
 Reset the singleton instance.
 
static autoload ($class)
 Autoload a class.
 

Protected Member Functions

 __construct ()
 Constructor.
 
 _autoload ($class)
 Internal autoloader implementation.
 
 _setNamespaceAutoloaders (array $autoloaders, $namespace= '')
 Set autoloaders for a specific namespace.
 
 _getVersionPath ($path, $version)
 Retrieve the filesystem path for the requested ZF version.
 
 _getVersionType ($version)
 Retrieve the ZF version type.
 
 _getAvailableVersions ($path, $version)
 Get available versions for the version type requested.
 

Protected Attributes

 $_autoloaders = array()
 
 $_defaultAutoloader = array('Zend_Loader', 'loadClass')
 
 $_fallbackAutoloader = false
 
 $_internalAutoloader
 
 $_namespaces
 
 $_namespaceAutoloaders = array()
 
 $_suppressNotFoundWarnings = false
 
 $_zfPath
 

Static Protected Attributes

static $_instance
 

Constructor & Destructor Documentation

__construct ( )
protected

Constructor.

Registers instance with spl_autoload stack

Returns
void

Member Function Documentation

_autoload (   $class)
protected

Internal autoloader implementation.

Parameters
string$class
Returns
bool
_getAvailableVersions (   $path,
  $version 
)
protected

Get available versions for the version type requested.

Parameters
string$path
string$version
Returns
array
_getVersionPath (   $path,
  $version 
)
protected

Retrieve the filesystem path for the requested ZF version.

Parameters
string$path
string$version
Returns
void
_getVersionType (   $version)
protected

Retrieve the ZF version type.

Parameters
string$version
Returns
string "latest", "major", "minor", or "specific"
Exceptions
Zend_Loader_Exceptionif version string contains too many dots
_setNamespaceAutoloaders ( array  $autoloaders,
  $namespace = '' 
)
protected

Set autoloaders for a specific namespace.

Parameters
array$autoloaders
string$namespace
Returns
Zend_Loader_Autoloader
static autoload (   $class)
static

Autoload a class.

Parameters
string$class
Returns
bool
getAutoloaders ( )

Get attached autoloader implementations.

Returns
array
getClassAutoloaders (   $class)

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
string$class
Returns
array Array of autoloaders to use
getDefaultAutoloader ( )

Retrieve the default autoloader callback.

Returns
string|array PHP Callback
static getInstance ( )
static

Retrieve singleton instance.

Returns
Zend_Loader_Autoloader
getNamespaceAutoloaders (   $namespace)

Return all autoloaders for a given namespace.

Parameters
string$namespace
Returns
array
getRegisteredNamespaces ( )

Get a list of registered autoload namespaces.

Returns
array
getZfPath ( )
isFallbackAutoloader ( )

Is this instance acting as a fallback autoloader?

Returns
bool
pushAutoloader (   $callback,
  $namespace = '' 
)

Append an autoloader to the autoloader stack.

Parameters
object | array | string$callbackPHP callback or Zend_Loader_Autoloader_Interface implementation
string | array$namespaceSpecific namespace(s) under which to register callback
Returns
Zend_Loader_Autoloader
registerNamespace (   $namespace)

Register a namespace to autoload.

Parameters
string | array$namespace
Returns
Zend_Loader_Autoloader
removeAutoloader (   $callback,
  $namespace = null 
)

Remove an autoloader from the autoloader stack.

Parameters
object | array | string$callbackPHP callback or Zend_Loader_Autoloader_Interface implementation
null | string | array$namespaceSpecific namespace(s) from which to remove autoloader
Returns
Zend_Loader_Autoloader
static resetInstance ( )
static

Reset the singleton instance.

Returns
void
setAutoloaders ( array  $autoloaders)

Set several autoloader callbacks at once.

Parameters
array$autoloadersArray of PHP callbacks (or Zend_Loader_Autoloader_Interface implementations) to act as autoloaders
Returns
Zend_Loader_Autoloader
setDefaultAutoloader (   $callback)

Set the default autoloader implementation.

Parameters
string | array$callbackPHP callback
Returns
void
setFallbackAutoloader (   $flag)

Indicate whether or not this autoloader should be a fallback autoloader.

Parameters
bool$flag
Returns
Zend_Loader_Autoloader
setZfPath (   $spec,
  $version = 'latest' 
)
suppressNotFoundWarnings (   $flag = null)

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

Parameters
null | bool$flag
Returns
bool|Zend_Loader_Autoloader Returns boolean if no argument is passed, object instance otherwise
unregisterNamespace (   $namespace)

Unload a registered autoload namespace.

Parameters
string | array$namespace
Returns
Zend_Loader_Autoloader
unshiftAutoloader (   $callback,
  $namespace = '' 
)

Add an autoloader to the beginning of the stack.

Parameters
object | array | string$callbackPHP callback or Zend_Loader_Autoloader_Interface implementation
string | array$namespaceSpecific namespace(s) under which to register callback
Returns
Zend_Loader_Autoloader

Member Data Documentation

$_autoloaders = array()
protected
$_defaultAutoloader = array('Zend_Loader', 'loadClass')
protected
$_fallbackAutoloader = false
protected
$_instance
staticprotected
$_internalAutoloader
protected
$_namespaceAutoloaders = array()
protected
$_namespaces
protected
Initial value:
= array(
'Zend_' => true,
'ZendX_' => true,
)
$_suppressNotFoundWarnings = false
protected
$_zfPath
protected