Open Monograph Press  1.1
 All Classes Namespaces Functions Variables Groups Pages
PluginRegistry Class Reference

Static Public Member Functions

static & _instantiatePlugin ($category, $categoryDir, $file, $classToCheck=null)
 
static & getAllPlugins ()
 
static getCategories ()
 
static & getPlugin ($category, $name)
 
static & getPlugins ($category=null)
 
static & loadAllPlugins ($enabledOnly=false)
 
static & loadCategory ($category, $enabledOnly=false, $mainContextId=null)
 
static & loadPlugin ($category, $pathName)
 
static register ($category, &$plugin, $path)
 

Detailed Description

Registry class for managing plugins.

See Also
Plugin

Definition at line 20 of file PluginRegistry.inc.php.

Member Function Documentation

static& PluginRegistry::_instantiatePlugin (   $category,
  $categoryDir,
  $file,
  $classToCheck = null 
)
static

Instantiate a plugin.

This method can be called statically.

Parameters
$categorystring
$categoryDirstring
$filestring
$classToCheckstring set null to maintain pre-2.3.x backwards compatibility
Returns
Plugin

Definition at line 210 of file PluginRegistry.inc.php.

Referenced by loadCategory().

static& PluginRegistry::getAllPlugins ( )
static

Get all plugins in a single array.

Definition at line 39 of file PluginRegistry.inc.php.

References getPlugins().

Referenced by loadAllPlugins().

static PluginRegistry::getCategories ( )
static

Get a list of the various plugin categories available.

NB: The categories are returned in the order in which they have to be registered and/or installed. Plug-ins in categories later in the list may depend on plug-ins in earlier categories.

Returns
array

Definition at line 175 of file PluginRegistry.inc.php.

References HookRegistry\call().

Referenced by PluginGridHandler\deletePlugin(), PKPLocale\installLocale(), loadAllPlugins(), and PluginGridHandler\loadData().

static& PluginRegistry::getPlugin (   $category,
  $name 
)
static
static& PluginRegistry::getPlugins (   $category = null)
static

Return all plugins in the given category as an array, or, if the category is not specified, all plugins in an associative array of arrays by category.

Parameters
$categoryString the name of the category to retrieve

Definition at line 30 of file PluginRegistry.inc.php.

References Registry\get().

Referenced by MetadataPluginTestCase\executeMetadataPluginTest(), getAllPlugins(), getPlugin(), ImportExportHandler\importexport(), loadCategory(), and register().

static& PluginRegistry::loadAllPlugins (   $enabledOnly = false)
static

Load all plugins in the system and return them in a single array.

Parameters
$enabledOnlyboolean load only enabled plug-ins

Definition at line 186 of file PluginRegistry.inc.php.

References getAllPlugins(), getCategories(), and loadCategory().

Referenced by PressSiteSettingsForm\execute(), and TranslatorAction\testLocale().

static& PluginRegistry::loadCategory (   $category,
  $enabledOnly = false,
  $mainContextId = null 
)
static

Load all plugins for a given category.

Parameters
$categorystring The name of the category to load
$enabledOnlyboolean if true load only enabled plug-ins (db-installation required), otherwise look on disk and load all available plug-ins (no db required).
$mainContextIdinteger To identify enabled plug-ins we need a context. This context is usually taken from the request but sometimes there is no context in the request (e.g. when executing CLI commands). Then the main context can be given as an explicit ID.

Definition at line 95 of file PluginRegistry.inc.php.

References _instantiatePlugin(), HookRegistry\call(), getPlugins(), Config\getVar(), and register().

Referenced by SubmissionNativeXmlFilter\addIdentifiers(), AuthSourceDAO\AuthSourceDAO(), CatalogBookHandler\book(), PKPUsageEventPlugin\buildUsageEvent(), MonographONIX30XmlFilter\createProductNode(), CatalogBookHandler\download(), importExport\execute(), PubIdPluginHelper\execute(), SiteSetupForm\execute(), SiteSetupForm\fetch(), CatalogEntryFormatMetadataForm\fetch(), IdentificationCodeForm\fetch(), PKPStatisticsHelper\getAllMetricTypeStrings(), PluginGridHandler\getCategoryData(), Context\getMetricTypes(), DistributionSettingsTabHandler\getPaymentFormContents(), DistributionSettingsTabHandler\getPaymentMethods(), OMPPaymentManager\getPaymentPlugin(), Submission\getPubId(), PKPStatisticsHelper\getReportPluginByMetricType(), ImportExportHandler\importexport(), OAIHandler\index(), PubIdPluginHelper\init(), PKPLocale\installLocale(), FunctionalImportExportBaseTestCase\instantiatePlugin(), loadAllPlugins(), PKPValidation\login(), PaymentHandler\plugin(), PubIdPluginHelper\readInputData(), PKPToolsHandler\report(), BlockPluginsListbuilderHandler\setListsData(), PKPToolsHandler\statisticcs(), PressGridHandler\updateContext(), and PubIdPluginHelper\validate().

static& PluginRegistry::loadPlugin (   $category,
  $pathName 
)
static

Load a specific plugin from a category by path name. Similar to loadCategory, except that it only loads a single plugin within a category rather than loading all.

Parameters
$categorystring
$pathNamestring
Returns
object

Definition at line 153 of file PluginRegistry.inc.php.

References register().

static PluginRegistry::register (   $category,
$plugin,
  $path 
)
static

Register a plugin with the registry in the given category.

Parameters
$categoryString the name of the category to extend
$pluginThe instantiated plugin to add
$pathThe path the plugin was found in
Returns
boolean True IFF the plugin was registered successfully

Definition at line 55 of file PluginRegistry.inc.php.

References getPlugins(), and Registry\set().

Referenced by loadCategory(), and loadPlugin().


The documentation for this class was generated from the following file: