Open Journal Systems  2.4.3
 All Classes Namespaces Functions Variables Groups Pages
PluginRegistry Class Reference

Public Member Functions

_instantiatePlugin ($category, $categoryDir, $file, $classToCheck=null)
 
getAllPlugins ()
 
 getCategories ()
 
getPlugin ($category, $name)
 
getPlugins ($category=null)
 
loadAllPlugins ($enabledOnly=false)
 
loadCategory ($category, $enabledOnly=false, $mainContextId=null)
 
loadPlugin ($category, $pathName)
 
 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

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

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

Referenced by loadCategory().

& PluginRegistry::getAllPlugins ( )

Get all plugins in a single array.

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

References getPlugins().

Referenced by loadAllPlugins().

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.

Returns
array

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

References HookRegistry\call(), and PKPApplication\getApplication().

Referenced by PluginManagementHandler\_deletePlugin(), Installer\addPluginVersions(), PKPLocale\installLocale(), loadAllPlugins(), and PluginHandler\plugins().

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

Get a plugin by name.

Parameters
$categoryString category name
$nameString plugin name

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

References getPlugins().

Referenced by LuceneFacetsBlockPlugin\_getLucenePlugin(), LuceneHandler\_getLucenePlugin(), SwordHandler\_getSwordPlugin(), ArticleXMLGalleyDAO\_getXMLGalleyFromId(), BookForReviewAuthorDAO\_returnAuthorFromRow(), BookForReviewDAO\_returnBookForReviewFromRow(), ExternalFeedDAO\_returnExternalFeedFromRow(), ThesisDAO\_returnThesisFromRow(), ArticleXMLGalley\_xsltCacheMiss(), ArticleXMLGalleyDAO\appendXMLGalleys(), BooksForReviewEditorHandler\assignBookForReviewAuthor(), BooksForReviewEditorHandler\assignBookForReviewSubmission(), BooksForReviewHandler\authorize(), BrowseHandler\authorize(), BooksForReviewAuthorHandler\authorize(), BooksForReviewEditorHandler\authorize(), BookForReviewForm\BookForReviewForm(), BooksForReviewAuthorHandler\booksForReview(), BooksForReviewEditorHandler\booksForReview(), BooksForReviewEditorHandler\booksForReviewSettings(), CopyAccessLogFileTool\CopyAccessLogFileTool(), CustomLocaleHandler\CustomLocaleHandler(), BooksForReviewEditorHandler\deleteBookForReview(), BooksForReviewEditorHandler\denyBookForReviewAuthor(), ThesisForm\display(), StudentThesisForm\display(), BooksForReviewEditorHandler\editBookForReview(), importExport\execute(), ThesisForm\execute(), StudentThesisForm\execute(), BookForReviewForm\execute(), ThesisDAO\getActiveThesesByJournalId(), AnnouncementFeedGatewayPlugin\getAnnouncementFeedPlugin(), AnnouncementFeedBlockPlugin\getAnnouncementFeedPlugin(), BookForReviewDAO\getBooksForReviewAssignedByAuthor(), BookForReviewDAO\getBooksForReviewByAuthor(), BookForReviewDAO\getBooksForReviewByDateDue(), BookForReviewDAO\getBooksForReviewStatusCount(), ExternalFeedBlockPlugin\getExternalFeedPlugin(), StatisticsHelper\getGeoLocationTool(), ArticleXMLGalley\getHTMLContents(), CustomBlockPlugin\getManagerPlugin(), DuraCloudImportExportPlugin\getNativeImportExportPlugin(), OpenAdsBlockPlugin\getOpenAdsPlugin(), BookForReviewDAO\getStatusCounts(), BookForReviewDAO\getSubmittedBookForReviewByArticle(), BookForReviewDAO\getSubmittedBookForReviewIdByArticle(), ThesisFeedGatewayPlugin\getThesisFeedPlugin(), ThesisFeedBlockPlugin\getThesisFeedPlugin(), WebFeedGatewayPlugin\getWebFeedPlugin(), WebFeedBlockPlugin\getWebFeedPlugin(), BrowseHandler\identifyTypes(), ImportExportHandler\importexport(), BooksForReviewHandler\index(), ThesisHandler\index(), FunctionalImportExportBaseTestCase\instantiatePlugin(), ThesisDAO\isThesisActive(), Upgrade\migrateTimedViewsUsageStatistics(), BooksForReviewEditorHandler\notifyBookForReviewMailed(), BooksForReviewEditorHandler\removeBookForReviewAuthor(), BooksForReviewEditorHandler\removeBookForReviewCoverPage(), BooksForReviewAuthorHandler\requestBookForReview(), ThesisHandler\save(), BrowseHandler\sections(), BooksForReviewEditorHandler\selectBookForReviewAuthor(), BooksForReviewEditorHandler\selectBookForReviewSubmission(), BooksForReviewReminder\sendJournalReminders(), LucenePluginTest\setUp(), BooksForReviewHandler\setupTemplate(), BooksForReviewAuthorHandler\setupTemplate(), BooksForReviewEditorHandler\setupTemplate(), StudentThesisForm\StudentThesisForm(), ThesisHandler\submit(), ThesisForm\ThesisForm(), BooksForReviewEditorHandler\updateBookForReview(), UsageStatsLoader\UsageStatsLoader(), ThesisHandler\view(), BooksForReviewHandler\viewBookForReview(), and ArticleXMLGalley\viewFileContents().

& 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.

Parameters
$categoryString the name of the category to retrieve

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

References Registry\get().

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

& PluginRegistry::loadAllPlugins (   $enabledOnly = false)

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

Parameters
$enabledOnlyboolean load only enabled plug-ins

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

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

Referenced by JournalSiteSettingsForm\execute(), Installer\Installer(), and TranslatorAction\testLocale().

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

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

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

Referenced by UsageEventPlugin\_buildUsageEvent(), DOIExportPlugin\_displayPluginHomePage(), Installer\addPluginVersions(), AuthSourcesHandler\auth(), AuthSourceDAO\AuthSourceDAO(), RTHandler\captureCite(), IssueHandler\current(), Dispatcher\dispatch(), SiteSettingsForm\display(), IssueForm\display(), ArticleGalleyForm\display(), JournalSetupStep5Form\display(), SuppFileForm\display(), MetadataForm\display(), importExport\execute(), PubIdPluginHelper\execute(), Dc11SchemaArticleAdapter\extractMetadataFromDataObject(), PubIdImportExportPlugin\generatePubId(), NativeExportDom\generatePubId(), StatisticsHelper\getAllMetricTypeStrings(), Application\getMetrics(), Application\getMetricTypes(), Journal\getMetricTypes(), OJSPaymentManager\getPaymentPlugin(), StatisticsHelper\getReportPluginByMetricType(), NativeImportDom\handlePubIds(), ImportExportHandler\importexport(), PubIdImportExportPlugin\importPubId(), PubIdPluginHelper\init(), PKPLocale\installLocale(), FunctionalImportExportBaseTestCase\instantiatePlugin(), loadAllPlugins(), Validation\login(), RTHandler\metadata(), PayMethodSettingsForm\PayMethodSettingsForm(), PaymentHandler\plugin(), PluginHandler\plugin(), GatewayHandler\plugin(), PluginHandler\plugins(), PubIdPluginHelper\readInputData(), StatisticsHandler\report(), LucenePluginTest\setUp(), FunctionalDoiExportTest\setUp(), StatisticsHandler\statistics(), RTHandler\suppFileMetadata(), FunctionalDoiExportTest\tearDown(), FunctionalDOIPubIdPluginTest\testCheckForDuplicateUrlSuffixesAcrossObjectTypes(), FunctionalDoiExportTest\testConfigurationError(), FunctionalDoiExportTest\testObjectsWithoutDOICannotBeSelectedForExport(), AdminJournalHandler\updateJournal(), UsageStatsLoader\UsageStatsLoader(), PubIdPluginHelper\validate(), ArticleHandler\view(), and IssueHandler\view().

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

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

References register().

Referenced by OJSSwordDeposit\setMetadata(), and TemplateManager\TemplateManager().

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

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: