Open Journal Systems  3.3.0
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, $mainContextId=null)
 
static register ($category, $plugin, $path, $mainContextId=null)
 

Detailed Description

Registry class for managing plugins.

See also
Plugin

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

Member Function Documentation

◆ _instantiatePlugin()

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 231 of file PluginRegistry.inc.php.

References instantiate().

Referenced by loadCategory().

◆ getAllPlugins()

static PluginRegistry::getAllPlugins ( )
static

Get all plugins in a single array.

Returns
array

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

References getPlugins().

Referenced by loadAllPlugins().

◆ getCategories()

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 196 of file PluginRegistry.inc.php.

References $application, HookRegistry\call(), and PKPApplication\get().

Referenced by Installer\addPluginVersions(), PluginGridHandler\deletePlugin(), PKPLocale\installLocale(), PluginGridHandler\loadData(), and PluginGalleryGridHandler\renderFilter().

◆ getPlugin()

static PluginRegistry::getPlugin (   $category,
  $name 
)
static

Get a plugin by name.

Parameters
$categoryString category name
$nameString plugin name
Returns
Plugin?

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

References getPlugins().

Referenced by SwordHandler\__construct(), SwordSettingsTabHandler\__construct(), MarkupBatchConversionHandler\__construct(), MarkupHandler\__construct(), PLNStatusGridHandler\__construct(), TextureHandler\__construct(), Depositor\__construct(), CustomBlockGridHandler\__construct(), MarkupSettingsTabHandler\__construct(), DataciteInfoSender\__construct(), MedraInfoSender\__construct(), CrossrefInfoSender\__construct(), DOAJInfoSender\__construct(), CopyAccessLogFileTool\__construct(), MarkupBatchGatewayPlugin\__construct(), UsageStatsLoader\__construct(), MarkupGatewayPlugin\__construct(), UsageStatsHandler\_getPlugin(), PLNHandler\_getPlugin(), OrcidHandler\about(), OrcidProfilePlugin\buildOrcidWork(), SettingsHandler\distribution(), CitationStyleLanguageHandler\download(), importExport\execute(), InstallPluginVersionTool\execute(), UploadPluginForm\execute(), CustomBlockForm\execute(), DepositPackage\generateAtomDocument(), DepositPackage\generatePackage(), CitationStyleLanguageHandler\get(), PKPStatisticsHelper\getGeoLocationTool(), PLNGatewayPlugin\getPLNPlugin(), PKPToolsHandler\importexport(), OrcidHandler\orcidAuthorize(), OrcidHandler\orcidVerify(), ThemePlugin\setParent(), PLNHandler\status(), OAIMetadataFormat_MARC21\toXml(), OAIMetadataFormat_MARC\toXml(), DepositPackage\transferDeposit(), DepositPackage\updateDepositStatus(), and BrowseBySectionHandler\view().

◆ getPlugins()

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
Returns
array

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

References Registry\get().

Referenced by Installer\addPluginVersions(), IssueGridHandler\editIssue(), MetadataPluginTestCase\executeMetadataPluginTest(), NavigationMenuForm\fetch(), getAllPlugins(), PKPTemplateManager\getManager(), getPlugin(), PKPToolsHandler\importexport(), PKPWorkflowHandler\index(), PKPTemplateManager\initialize(), loadCategory(), register(), and PKPTemplateManager\smartyLoadNavigationMenuArea().

◆ loadAllPlugins()

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
Returns
array Set of all plugins

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

References getAllPlugins(), and loadCategory().

Referenced by Installer\__construct(), PKPAcronPlugin\_parseCrontab(), and PKP\Services\PKPContextService\add().

◆ loadCategory()

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.
Returns
array Set of plugins, sorted in sequence.

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

References $application, _instantiatePlugin(), HookRegistry\call(), PKPApplication\get(), getPlugins(), Config\getVar(), and register().

Referenced by AuthSourceDAO\__construct(), GatewayHandler\__construct(), Depositor\__construct(), CrossrefInfoSender\__construct(), DOAJInfoSender\__construct(), DataciteInfoSender\__construct(), MedraInfoSender\__construct(), PKP\components\forms\context\PKPPaymentSettingsForm\__construct(), PKP\components\forms\site\PKPSiteAppearanceForm\__construct(), PKP\components\forms\context\PKPAppearanceSetupForm\__construct(), PKP\components\forms\context\PKPThemeForm\__construct(), CommandLineTool\__construct(), MedraSettingsForm\__construct(), UsageStatsLoader\__construct(), DataciteSettingsForm\__construct(), CrossRefSettingsForm\__construct(), CrossrefInfoSender\_getJournals(), MedraInfoSender\_getJournals(), DataciteInfoSender\_getJournals(), CitationStyleLanguageHandler\_setupRequest(), PKPPublicationNativeXmlFilter\addIdentifiers(), RepresentationNativeXmlFilter\addIdentifiers(), IssueNativeXmlFilter\addIdentifiers(), SubmissionFileNativeXmlFilter\addIdentifiers(), PKPPubIdPluginHelper\addJavaScripts(), Installer\addPluginVersions(), PKPPubIdPluginHelper\assignPubId(), OrcidProfilePlugin\buildOrcidWork(), PKPUsageEventPlugin\buildUsageEvent(), PublicIdentifiersForm\clearIssueObjectsPubIds(), PKPPubIdPluginHelper\clearPubId(), PageHandler\css(), IssueHandler\current(), Dispatcher\dispatch(), DOIPubIdExportPlugin\display(), PKPTemplateManager\displaySidebar(), PKPBackendPaymentsSettingsHandler\edit(), ArticleGalleyGridHandler\editGalley(), PKPSiteHandler\editTheme(), PKPContextHandler\editTheme(), PluginRequiredPolicy\effect(), importExport\execute(), PKPPubIdPluginHelper\execute(), MedraInfoSender\executeActions(), CrossrefInfoSender\executeActions(), DataciteInfoSender\executeActions(), CrossRefExportPlugin\executeCLICommand(), Dc11SchemaArticleAdapter\extractMetadataFromDataObject(), NavigationMenuForm\fetch(), PKPAssignPublicIdentifiersForm\fetch(), PKPPublicIdentifiersForm\fetch(), DepositPackage\generatePackage(), PKPStatisticsHelper\getAllMetricTypeStrings(), PKP\Services\PKPSubmissionService\getBackendListProperties(), PKPTemplateManager\getManager(), PKPApplication\getMetrics(), Journal\getMetricTypes(), Context\getMetricTypes(), PKPApplication\getMetricTypes(), OJSPaymentManager\getPaymentPlugin(), APP\Services\IssueService\getProperties(), PKPStatisticsHelper\getReportPluginByMetricType(), PKPSiteHandler\getTheme(), PKPContextHandler\getTheme(), PKPToolsHandler\importexport(), OAIHandler\index(), PKPPubIdPluginHelper\init(), PKPLocale\installLocale(), loadAllPlugins(), PluginGridHandler\loadCategoryData(), Installer\migrateSidebarBlocks(), NativeXmlRepresentationFilter\parseIdentifier(), NativeXmlIssueFilter\parseIdentifier(), NativeXmlPKPPublicationFilter\parseIdentifier(), NativeXmlSubmissionFileFilter\parseIdentifier(), PaymentHandler\plugin(), PKPPubIdPluginHelper\readAssignInputData(), PKPPubIdPluginHelper\readInputData(), PKPToolsHandler\report(), PKPPubIdPluginHelper\setLinkActions(), PKPTemplateManager\smartyLoadNavigationMenuArea(), PKPToolsHandler\statistics(), PKPPubIdPluginHelper\validate(), IssueHandler\view(), and ArticleHandler\view().

◆ loadPlugin()

static PluginRegistry::loadPlugin (   $category,
  $pathName,
  $mainContextId = null 
)
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
$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.
Returns
Plugin?

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

References register().

Referenced by ExportPublishedSubmissionsListGridHandler\initialize(), PubIdExportRepresentationsListGridHandler\initialize(), and PubIdExportIssuesListGridHandler\initialize().

◆ register()

static PluginRegistry::register (   $category,
  $plugin,
  $path,
  $mainContextId = null 
)
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
$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.
Returns
boolean True IFF the plugin was registered successfully

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

References getPlugins().

Referenced by InstallPluginVersionTool\execute(), loadCategory(), loadPlugin(), AnnouncementFeedPlugin\register(), CustomBlockManagerPlugin\register(), WebFeedPlugin\register(), and UsageStatsPlugin\register().


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