Loader/PluginLoader.php

Show: PublicProtectedPrivateinherited
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 [email protected] 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
PluginLoader  
Version
$Id$  

\Zend_Loader_PluginLoader

Package: Zend_Loader\PluginLoader
Generic plugin class loader
Implements
Category
Zend  
Copyright
Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  

Properties

>VPropertyprotectedstring $_includeFileCache
static
Class map cache file
Details
Type
string
>VPropertyprotectedarray $_loadedPluginPaths = array()
Instance loaded plugin paths
Default valuearray()Details
Type
array
>VPropertyprotectedarray $_loadedPlugins = array()
Instance loaded plugins
Default valuearray()Details
Type
array
>VPropertyprotectedarray $_prefixToPaths = array()
Instance registry property
Default valuearray()Details
Type
array
>VPropertyprotectedarray $_staticLoadedPluginPaths = array()
static
Statically loaded plugin path mappings
Default valuearray()Details
Type
array
>VPropertyprotectedarray $_staticLoadedPlugins = array()
static
Statically loaded plugins
Default valuearray()Details
Type
array
>VPropertyprotectedarray $_staticPrefixToPaths = array()
static
Static registry property
Default valuearray()Details
Type
array
>VPropertyprotectedstring|null $_useStaticRegistry = null
Whether to use a statically named registry for loading plugins
Default valuenullDetails
Type
string | null

Methods

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

Constructor

Parameters
NameTypeDescription
$prefixToPathsarray
$staticRegistryNamestring

OPTIONAL

methodprotected_appendIncFile(string $incFile) : void
static

Append an include_once statement to the class file cache

Parameters
NameTypeDescription
$incFilestring
methodprotected_formatName(string $name) : string

Normalize plugin name

Parameters
NameTypeDescription
$namestring
Returns
TypeDescription
string
methodprotected_formatPrefix(string $prefix) : string

Format prefix for internal use

Parameters
NameTypeDescription
$prefixstring
Returns
TypeDescription
string
methodpublicaddPrefixPath(string $prefix, string $path) : \Zend_Loader_PluginLoader

Add prefixed paths to the registry of paths

Parameters
NameTypeDescription
$prefixstring
$pathstring
Returns
TypeDescription
\Zend_Loader_PluginLoader
methodpublicclearPaths(string $prefix = null) : bool

Clear path stack

Parameters
NameTypeDescription
$prefixstring
Returns
TypeDescription
boolFalse only if $prefix does not exist
methodpublicgetClassName(string $name) : string | false

Return full class name for a named plugin

Parameters
NameTypeDescription
$namestring
Returns
TypeDescription
string | falseFalse if class not found, class name otherwise
methodpublicgetClassPath(mixed $name) : string | false

Get path to plugin class

Parameters
NameTypeDescription
$namemixed
Returns
TypeDescription
string | falseFalse if not found
methodpublicgetIncludeFileCache() : string | null
static

Retrieve class file cache path

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

Get path stack

Parameters
NameTypeDescription
$prefixstring
Returns
TypeDescription
false | arrayFalse 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
NameTypeDescription
$namestring
Returns
TypeDescription
\Zend_Loader_PluginLoader
methodpublicload(string $name, bool $throwExceptions = true) : string | false

Load a plugin via the name provided

Parameters
NameTypeDescription
$namestring
$throwExceptionsbool

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

Returns
TypeDescription
string | falseClass name of loaded class; false if $throwExceptions if false and no class found
Throws
ExceptionDescription
\Zend_Loader_Exceptionif class not found
methodpublicremovePrefixPath(string $prefix, string $path = null) : \Zend_Loader_PluginLoader

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

Parameters
NameTypeDescription
$prefixstring
$pathstring

OPTIONAL

Returns
TypeDescription
\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
NameTypeDescription
$filestring
Throws
ExceptionDescription
\Zend_Loader_PluginLoader_Exceptionif file is not writeable or path does not exist
Documentation was generated by phpDocumentor 2.2.0 .