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

Definition at line 20 of file

Member Function Documentation

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

Instantiate a plugin.

This method can be called statically.

$classToCheckstring set null to maintain pre-2.3.x backwards compatibility

Definition at line 210 of file

Referenced by loadCategory().

static& PluginRegistry::getAllPlugins ( )

Get all plugins in a single array.

Definition at line 39 of file

References getPlugins().

Referenced by loadAllPlugins().

static PluginRegistry::getCategories ( )

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.


Definition at line 175 of file

References HookRegistry\call().

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

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

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.

$categoryString the name of the category to retrieve

Definition at line 30 of file

References Registry\get().

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

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

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

$enabledOnlyboolean load only enabled plug-ins

Definition at line 186 of file

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

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

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

Load all plugins for a given category.

$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

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,

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.


Definition at line 153 of file

References register().

static PluginRegistry::register (   $category,

Register a plugin with the registry in the given category.

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

Definition at line 55 of file

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

Referenced by loadCategory(), and loadPlugin().

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