API Documentation

Zend/Loader/PluginLoader.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
PluginLoader  
Version
$Id: PluginLoader.php 24594 2012-01-05 21:27:01Z matthew $  

\Zend_Loader_PluginLoader

Package: Zend\Loader\PluginLoader

Generic plugin class loader

Implements
\Zend_Loader_PluginLoader_Interface
Category
Zend  
Copyright
Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  

Properties

Propertyprotectedstring  $_includeFileCache= ''
static

Class map cache file

Details
Type
string
Propertyprotectedarray  $_loadedPluginPaths= 'array()'

Instance loaded plugin paths

Default valuearray()Details
Type
array
Propertyprotectedarray  $_loadedPlugins= 'array()'

Instance loaded plugins

Default valuearray()Details
Type
array
Propertyprotectedarray  $_prefixToPaths= 'array()'

Instance registry property

Default valuearray()Details
Type
array
Propertyprotectedarray  $_staticLoadedPluginPaths= 'array()'
static

Statically loaded plugin path mappings

Default valuearray()Details
Type
array
Propertyprotectedarray  $_staticLoadedPlugins= 'array()'
static

Statically loaded plugins

Default valuearray()Details
Type
array
Propertyprotectedarray  $_staticPrefixToPaths= 'array()'
static

Static registry property

Default valuearray()Details
Type
array
Propertyprotectedstring|null  $_useStaticRegistry= 'null'

Whether to use a statically named registry for loading plugins

Default valuenullDetails
Type
stringnull

Methods

methodpublic__construct( array $prefixToPaths = array(), string $staticRegistryName = null ) : void

Constructor

Parameters
Name Type Description
$prefixToPaths array
$staticRegistryName string

OPTIONAL

methodprotected_appendIncFile( string $incFile ) : void
static

Append an include_once statement to the class file cache

Parameters
Name Type Description
$incFile string
methodprotected_formatName( string $name ) : string

Normalize plugin name

Parameters
Name Type Description
$name string
Returns
Type Description
string
methodprotected_formatPrefix( string $prefix ) : string

Format prefix for internal use

Parameters
Name Type Description
$prefix string
Returns
Type Description
string
methodpublicaddPrefixPath( string $prefix, string $path ) : \Zend_Loader_PluginLoader

Add prefixed paths to the registry of paths

Parameters
Name Type Description
$prefix string
$path string
Returns
Type Description
\Zend_Loader_PluginLoader
methodpublicclearPaths( string $prefix = null ) : bool

Clear path stack

Parameters
Name Type Description
$prefix string
Returns
Type Description
bool False only if $prefix does not exist
methodpublicgetClassName( string $name ) : string|false

Return full class name for a named plugin

Parameters
Name Type Description
$name string
Returns
Type Description
string|false False if class not found, class name otherwise
methodpublicgetClassPath( mixed $name ) : string|false

Get path to plugin class

Parameters
Name Type Description
$name mixed
Returns
Type Description
string|false False if not found
methodpublicgetIncludeFileCache( ) : string|null
static

Retrieve class file cache path

Returns
Type Description
string|null
methodpublicgetPaths( string $prefix = null ) : false|array

Get path stack

Parameters
Name Type Description
$prefix string
Returns
Type Description
false|array False if prefix does not exist, array otherwise
methodpublicisLoaded( string $name ) : \Zend_Loader_PluginLoader

Whether or not a Plugin by a specific name is loaded

Parameters
Name Type Description
$name string
Returns
Type Description
\Zend_Loader_PluginLoader
methodpublicload( string $name, bool $throwExceptions = true ) : string|false

Load a plugin via the name provided

Parameters
Name Type Description
$name string
$throwExceptions bool

Whether or not to throw exceptions if the class is not resolved

Returns
Type Description
string|false Class name of loaded class; false if $throwExceptions if false and no class found
Throws
Exception Description
\Zend_Loader_Exception if class not found
methodpublicremovePrefixPath( string $prefix, string $path = null ) : \Zend_Loader_PluginLoader

Remove a prefix (or prefixed-path) from the registry

Parameters
Name Type Description
$prefix string
$path string

OPTIONAL

Returns
Type Description
\Zend_Loader_PluginLoader
methodpublicsetIncludeFileCache( string $file ) : void
static

Set path to class file cache

Specify a path to a file that will add include_once statements for each plugin class loaded. This is an opt-in feature for performance purposes.

Parameters
Name Type Description
$file string
Throws
Exception Description
\Zend_Loader_PluginLoader_Exception if file is not writeable or path does not exist
Documentation was generated by DocBlox 0.15.1.