Automatically generated hook interfaces

Add hook interfaces which were generated by a script which parses
hooks.txt and identifies caller namespaces and directories.

Hook interfaces are mostly placed in a Hook/ subdirectory
relative to the caller location. When there are callers in multiple
directories, a "primary" caller was manually selected. The exceptions to
this are:

* The source root, maintenance and tests, which use includes/Hook. Test
  hooks need to be autoloadable in a non-test request so that
  implementing test interfaces in a generic handler will not fail.
* resources uses includes/resourceloader/Hook
* The following third-level subdirectories had their hooks placed in
  the parent ../Hook:
    * includes/filerepo/file
    * includes/search/searchwidgets
    * includes/specials/forms
    * includes/specials/helpers
    * includes/specials/pagers

Parameters marked as legacy references in hooks.txt are passed
by value in the interfaces.

Bug: T240307
Change-Id: I6efe2e7dd1f0c6a3d0f4d100a4c34e41f8428720
This commit is contained in:
Tim Starling 2020-03-04 09:50:34 +11:00
parent cedee2b620
commit f5aaf75ad1
568 changed files with 13375 additions and 0 deletions

View file

@ -860,9 +860,245 @@ $wgAutoloadLocalClasses = [
'MediaWikiTitleCodec' => __DIR__ . '/includes/title/MediaWikiTitleCodec.php',
'MediaWikiVersionFetcher' => __DIR__ . '/includes/MediaWikiVersionFetcher.php',
'MediaWiki\\FileBackend\\FSFile\\TempFSFileFactory' => __DIR__ . '/includes/libs/filebackend/fsfile/TempFSFileFactory.php',
'MediaWiki\\Hook\\AbortEmailNotificationHook' => __DIR__ . '/includes/changes/Hook/AbortEmailNotificationHook.php',
'MediaWiki\\Hook\\AbortTalkPageEmailNotificationHook' => __DIR__ . '/includes/mail/Hook/AbortTalkPageEmailNotificationHook.php',
'MediaWiki\\Hook\\ActionBeforeFormDisplayHook' => __DIR__ . '/includes/actions/Hook/ActionBeforeFormDisplayHook.php',
'MediaWiki\\Hook\\ActionModifyFormFieldsHook' => __DIR__ . '/includes/actions/Hook/ActionModifyFormFieldsHook.php',
'MediaWiki\\Hook\\AddNewAccountHook' => __DIR__ . '/includes/specials/Hook/AddNewAccountHook.php',
'MediaWiki\\Hook\\AfterImportPageHook' => __DIR__ . '/includes/import/Hook/AfterImportPageHook.php',
'MediaWiki\\Hook\\AfterParserFetchFileAndTitleHook' => __DIR__ . '/includes/parser/Hook/AfterParserFetchFileAndTitleHook.php',
'MediaWiki\\Hook\\AlternateUserMailerHook' => __DIR__ . '/includes/mail/Hook/AlternateUserMailerHook.php',
'MediaWiki\\Hook\\AncientPagesQueryHook' => __DIR__ . '/includes/specials/Hook/AncientPagesQueryHook.php',
'MediaWiki\\Hook\\ArticleRevisionVisibilitySetHook' => __DIR__ . '/includes/revisiondelete/Hook/ArticleRevisionVisibilitySetHook.php',
'MediaWiki\\Hook\\BaseTemplateAfterPortletHook' => __DIR__ . '/includes/skins/Hook/BaseTemplateAfterPortletHook.php',
'MediaWiki\\Hook\\BaseTemplateToolboxHook' => __DIR__ . '/includes/skins/Hook/BaseTemplateToolboxHook.php',
'MediaWiki\\Hook\\BeforeParserFetchFileAndTitleHook' => __DIR__ . '/includes/parser/Hook/BeforeParserFetchFileAndTitleHook.php',
'MediaWiki\\Hook\\BeforeParserFetchTemplateAndtitleHook' => __DIR__ . '/includes/parser/Hook/BeforeParserFetchTemplateAndtitleHook.php',
'MediaWiki\\Hook\\BeforeParserrenderImageGalleryHook' => __DIR__ . '/includes/parser/Hook/BeforeParserrenderImageGalleryHook.php',
'MediaWiki\\Hook\\BeforeResetNotificationTimestampHook' => __DIR__ . '/includes/watcheditem/Hook/BeforeResetNotificationTimestampHook.php',
'MediaWiki\\Hook\\BeforeWelcomeCreationHook' => __DIR__ . '/includes/specials/Hook/BeforeWelcomeCreationHook.php',
'MediaWiki\\Hook\\BitmapHandlerCheckImageAreaHook' => __DIR__ . '/includes/media/Hook/BitmapHandlerCheckImageAreaHook.php',
'MediaWiki\\Hook\\BitmapHandlerTransformHook' => __DIR__ . '/includes/media/Hook/BitmapHandlerTransformHook.php',
'MediaWiki\\Hook\\BlockIpCompleteHook' => __DIR__ . '/includes/specials/Hook/BlockIpCompleteHook.php',
'MediaWiki\\Hook\\BlockIpHook' => __DIR__ . '/includes/specials/Hook/BlockIpHook.php',
'MediaWiki\\Hook\\BookInformationHook' => __DIR__ . '/includes/specials/Hook/BookInformationHook.php',
'MediaWiki\\Hook\\CanonicalNamespacesHook' => __DIR__ . '/includes/title/Hook/CanonicalNamespacesHook.php',
'MediaWiki\\Hook\\ChangeUserGroupsHook' => __DIR__ . '/includes/specials/Hook/ChangeUserGroupsHook.php',
'MediaWiki\\Hook\\ChangesListInitRowsHook' => __DIR__ . '/includes/changes/Hook/ChangesListInitRowsHook.php',
'MediaWiki\\Hook\\ChangesListInsertArticleLinkHook' => __DIR__ . '/includes/changes/Hook/ChangesListInsertArticleLinkHook.php',
'MediaWiki\\Hook\\Collation__factoryHook' => __DIR__ . '/includes/collation/Hook/Collation__factoryHook.php',
'MediaWiki\\Hook\\ContribsPager__getQueryInfoHook' => __DIR__ . '/includes/specials/Hook/ContribsPager__getQueryInfoHook.php',
'MediaWiki\\Hook\\ContribsPager__reallyDoQueryHook' => __DIR__ . '/includes/specials/Hook/ContribsPager__reallyDoQueryHook.php',
'MediaWiki\\Hook\\ContributionsLineEndingHook' => __DIR__ . '/includes/specials/Hook/ContributionsLineEndingHook.php',
'MediaWiki\\Hook\\ContributionsToolLinksHook' => __DIR__ . '/includes/specials/Hook/ContributionsToolLinksHook.php',
'MediaWiki\\Hook\\CustomEditorHook' => __DIR__ . '/includes/actions/Hook/CustomEditorHook.php',
'MediaWiki\\Hook\\DeletedContribsPager__reallyDoQueryHook' => __DIR__ . '/includes/specials/Hook/DeletedContribsPager__reallyDoQueryHook.php',
'MediaWiki\\Hook\\DeletedContributionsLineEndingHook' => __DIR__ . '/includes/specials/Hook/DeletedContributionsLineEndingHook.php',
'MediaWiki\\Hook\\EmailUserCCHook' => __DIR__ . '/includes/specials/Hook/EmailUserCCHook.php',
'MediaWiki\\Hook\\EmailUserCompleteHook' => __DIR__ . '/includes/specials/Hook/EmailUserCompleteHook.php',
'MediaWiki\\Hook\\EmailUserFormHook' => __DIR__ . '/includes/specials/Hook/EmailUserFormHook.php',
'MediaWiki\\Hook\\EmailUserHook' => __DIR__ . '/includes/specials/Hook/EmailUserHook.php',
'MediaWiki\\Hook\\EmailUserPermissionsErrorsHook' => __DIR__ . '/includes/specials/Hook/EmailUserPermissionsErrorsHook.php',
'MediaWiki\\Hook\\EnhancedChangesListModifyBlockLineDataHook' => __DIR__ . '/includes/changes/Hook/EnhancedChangesListModifyBlockLineDataHook.php',
'MediaWiki\\Hook\\EnhancedChangesListModifyLineDataHook' => __DIR__ . '/includes/changes/Hook/EnhancedChangesListModifyLineDataHook.php',
'MediaWiki\\Hook\\EnhancedChangesList__getLogTextHook' => __DIR__ . '/includes/changes/Hook/EnhancedChangesList__getLogTextHook.php',
'MediaWiki\\Hook\\ExtensionTypesHook' => __DIR__ . '/includes/specials/Hook/ExtensionTypesHook.php',
'MediaWiki\\Hook\\FetchChangesListHook' => __DIR__ . '/includes/changes/Hook/FetchChangesListHook.php',
'MediaWiki\\Hook\\FileTransformedHook' => __DIR__ . '/includes/filerepo/Hook/FileTransformedHook.php',
'MediaWiki\\Hook\\FileUndeleteCompleteHook' => __DIR__ . '/includes/specials/Hook/FileUndeleteCompleteHook.php',
'MediaWiki\\Hook\\FileUploadHook' => __DIR__ . '/includes/filerepo/Hook/FileUploadHook.php',
'MediaWiki\\Hook\\GalleryGetModesHook' => __DIR__ . '/includes/gallery/Hook/GalleryGetModesHook.php',
'MediaWiki\\Hook\\GetExtendedMetadataHook' => __DIR__ . '/includes/media/Hook/GetExtendedMetadataHook.php',
'MediaWiki\\Hook\\GetHumanTimestampHook' => __DIR__ . '/languages/Hook/GetHumanTimestampHook.php',
'MediaWiki\\Hook\\GetLangPreferredVariantHook' => __DIR__ . '/languages/Hook/GetLangPreferredVariantHook.php',
'MediaWiki\\Hook\\GetLinkColoursHook' => __DIR__ . '/includes/parser/Hook/GetLinkColoursHook.php',
'MediaWiki\\Hook\\GetLogTypesOnUserHook' => __DIR__ . '/includes/specials/Hook/GetLogTypesOnUserHook.php',
'MediaWiki\\Hook\\GetMetadataVersionHook' => __DIR__ . '/includes/media/Hook/GetMetadataVersionHook.php',
'MediaWiki\\Hook\\GetNewMessagesAlertHook' => __DIR__ . '/includes/skins/Hook/GetNewMessagesAlertHook.php',
'MediaWiki\\Hook\\HistoryPageToolLinksHook' => __DIR__ . '/includes/actions/Hook/HistoryPageToolLinksHook.php',
'MediaWiki\\Hook\\HistoryRevisionToolsHook' => __DIR__ . '/includes/actions/Hook/HistoryRevisionToolsHook.php',
'MediaWiki\\Hook\\IRCLineURLHook' => __DIR__ . '/includes/rcfeed/Hook/IRCLineURLHook.php',
'MediaWiki\\Hook\\ImportHandleLogItemXMLTagHook' => __DIR__ . '/includes/import/Hook/ImportHandleLogItemXMLTagHook.php',
'MediaWiki\\Hook\\ImportHandlePageXMLTagHook' => __DIR__ . '/includes/import/Hook/ImportHandlePageXMLTagHook.php',
'MediaWiki\\Hook\\ImportHandleRevisionXMLTagHook' => __DIR__ . '/includes/import/Hook/ImportHandleRevisionXMLTagHook.php',
'MediaWiki\\Hook\\ImportHandleToplevelXMLTagHook' => __DIR__ . '/includes/import/Hook/ImportHandleToplevelXMLTagHook.php',
'MediaWiki\\Hook\\ImportHandleUploadXMLTagHook' => __DIR__ . '/includes/import/Hook/ImportHandleUploadXMLTagHook.php',
'MediaWiki\\Hook\\ImportLogInterwikiLinkHook' => __DIR__ . '/includes/specials/Hook/ImportLogInterwikiLinkHook.php',
'MediaWiki\\Hook\\ImportSourcesHook' => __DIR__ . '/includes/specials/Hook/ImportSourcesHook.php',
'MediaWiki\\Hook\\InfoActionHook' => __DIR__ . '/includes/actions/Hook/InfoActionHook.php',
'MediaWiki\\Hook\\InternalParseBeforeLinksHook' => __DIR__ . '/includes/parser/Hook/InternalParseBeforeLinksHook.php',
'MediaWiki\\Hook\\InternalParseBeforeSanitizeHook' => __DIR__ . '/includes/parser/Hook/InternalParseBeforeSanitizeHook.php',
'MediaWiki\\Hook\\IsUploadAllowedFromUrlHook' => __DIR__ . '/includes/upload/Hook/IsUploadAllowedFromUrlHook.php',
'MediaWiki\\Hook\\IsValidEmailAddrHook' => __DIR__ . '/includes/parser/Hook/IsValidEmailAddrHook.php',
'MediaWiki\\Hook\\LanguageGetNamespacesHook' => __DIR__ . '/languages/Hook/LanguageGetNamespacesHook.php',
'MediaWiki\\Hook\\LanguageSelectorHook' => __DIR__ . '/includes/specials/Hook/LanguageSelectorHook.php',
'MediaWiki\\Hook\\LinksUpdateAfterInsertHook' => __DIR__ . '/includes/deferred/Hook/LinksUpdateAfterInsertHook.php',
'MediaWiki\\Hook\\LinksUpdateCompleteHook' => __DIR__ . '/includes/deferred/Hook/LinksUpdateCompleteHook.php',
'MediaWiki\\Hook\\LinksUpdateConstructedHook' => __DIR__ . '/includes/deferred/Hook/LinksUpdateConstructedHook.php',
'MediaWiki\\Hook\\LinksUpdateHook' => __DIR__ . '/includes/deferred/Hook/LinksUpdateHook.php',
'MediaWiki\\Hook\\LocalFilePurgeThumbnailsHook' => __DIR__ . '/includes/filerepo/Hook/LocalFilePurgeThumbnailsHook.php',
'MediaWiki\\Hook\\LocalFile__getHistoryHook' => __DIR__ . '/includes/filerepo/Hook/LocalFile__getHistoryHook.php',
'MediaWiki\\Hook\\LocalisationCacheRecacheFallbackHook' => __DIR__ . '/includes/cache/localisation/Hook/LocalisationCacheRecacheFallbackHook.php',
'MediaWiki\\Hook\\LocalisationCacheRecacheHook' => __DIR__ . '/includes/cache/localisation/Hook/LocalisationCacheRecacheHook.php',
'MediaWiki\\Hook\\LogEventsListGetExtraInputsHook' => __DIR__ . '/includes/logging/Hook/LogEventsListGetExtraInputsHook.php',
'MediaWiki\\Hook\\LogEventsListLineEndingHook' => __DIR__ . '/includes/logging/Hook/LogEventsListLineEndingHook.php',
'MediaWiki\\Hook\\LogEventsListShowLogExtractHook' => __DIR__ . '/includes/logging/Hook/LogEventsListShowLogExtractHook.php',
'MediaWiki\\Hook\\LogExceptionHook' => __DIR__ . '/includes/exception/Hook/LogExceptionHook.php',
'MediaWiki\\Hook\\LogLineHook' => __DIR__ . '/includes/logging/Hook/LogLineHook.php',
'MediaWiki\\Hook\\LoginFormValidErrorMessagesHook' => __DIR__ . '/includes/specials/Hook/LoginFormValidErrorMessagesHook.php',
'MediaWiki\\Hook\\LonelyPagesQueryHook' => __DIR__ . '/includes/specials/Hook/LonelyPagesQueryHook.php',
'MediaWiki\\Hook\\ManualLogEntryBeforePublishHook' => __DIR__ . '/includes/logging/Hook/ManualLogEntryBeforePublishHook.php',
'MediaWiki\\Hook\\MarkPatrolledCompleteHook' => __DIR__ . '/includes/changes/Hook/MarkPatrolledCompleteHook.php',
'MediaWiki\\Hook\\MarkPatrolledHook' => __DIR__ . '/includes/changes/Hook/MarkPatrolledHook.php',
'MediaWiki\\Hook\\ModifyExportQueryHook' => __DIR__ . '/includes/export/Hook/ModifyExportQueryHook.php',
'MediaWiki\\Hook\\NamespaceIsMovableHook' => __DIR__ . '/includes/title/Hook/NamespaceIsMovableHook.php',
'MediaWiki\\Hook\\NewPagesLineEndingHook' => __DIR__ . '/includes/specials/Hook/NewPagesLineEndingHook.php',
'MediaWiki\\Hook\\OldChangesListRecentChangesLineHook' => __DIR__ . '/includes/changes/Hook/OldChangesListRecentChangesLineHook.php',
'MediaWiki\\Hook\\OtherAutoblockLogLinkHook' => __DIR__ . '/includes/specials/Hook/OtherAutoblockLogLinkHook.php',
'MediaWiki\\Hook\\OtherBlockLogLinkHook' => __DIR__ . '/includes/specials/Hook/OtherBlockLogLinkHook.php',
'MediaWiki\\Hook\\PageHistoryBeforeListHook' => __DIR__ . '/includes/actions/Hook/PageHistoryBeforeListHook.php',
'MediaWiki\\Hook\\PageHistoryLineEndingHook' => __DIR__ . '/includes/actions/Hook/PageHistoryLineEndingHook.php',
'MediaWiki\\Hook\\PageHistoryPager__doBatchLookupsHook' => __DIR__ . '/includes/actions/Hook/PageHistoryPager__doBatchLookupsHook.php',
'MediaWiki\\Hook\\PageHistoryPager__getQueryInfoHook' => __DIR__ . '/includes/actions/Hook/PageHistoryPager__getQueryInfoHook.php',
'MediaWiki\\Hook\\PageRenderingHashHook' => __DIR__ . '/includes/parser/Hook/PageRenderingHashHook.php',
'MediaWiki\\Hook\\ParserAfterParseHook' => __DIR__ . '/includes/parser/Hook/ParserAfterParseHook.php',
'MediaWiki\\Hook\\ParserAfterStripHook' => __DIR__ . '/includes/parser/Hook/ParserAfterStripHook.php',
'MediaWiki\\Hook\\ParserAfterTidyHook' => __DIR__ . '/includes/parser/Hook/ParserAfterTidyHook.php',
'MediaWiki\\Hook\\ParserBeforeInternalParseHook' => __DIR__ . '/includes/parser/Hook/ParserBeforeInternalParseHook.php',
'MediaWiki\\Hook\\ParserBeforeStripHook' => __DIR__ . '/includes/parser/Hook/ParserBeforeStripHook.php',
'MediaWiki\\Hook\\ParserBeforeTidyHook' => __DIR__ . '/includes/parser/Hook/ParserBeforeTidyHook.php',
'MediaWiki\\Hook\\ParserCacheSaveCompleteHook' => __DIR__ . '/includes/parser/Hook/ParserCacheSaveCompleteHook.php',
'MediaWiki\\Hook\\ParserClearStateHook' => __DIR__ . '/includes/parser/Hook/ParserClearStateHook.php',
'MediaWiki\\Hook\\ParserClonedHook' => __DIR__ . '/includes/parser/Hook/ParserClonedHook.php',
'MediaWiki\\Hook\\ParserFetchTemplateHook' => __DIR__ . '/includes/parser/Hook/ParserFetchTemplateHook.php',
'MediaWiki\\Hook\\ParserFirstCallInitHook' => __DIR__ . '/includes/parser/Hook/ParserFirstCallInitHook.php',
'MediaWiki\\Hook\\ParserGetVariableValueSwitchHook' => __DIR__ . '/includes/parser/Hook/ParserGetVariableValueSwitchHook.php',
'MediaWiki\\Hook\\ParserGetVariableValueTsHook' => __DIR__ . '/includes/parser/Hook/ParserGetVariableValueTsHook.php',
'MediaWiki\\Hook\\ParserGetVariableValueVarCacheHook' => __DIR__ . '/includes/parser/Hook/ParserGetVariableValueVarCacheHook.php',
'MediaWiki\\Hook\\ParserLimitReportFormatHook' => __DIR__ . '/includes/parser/Hook/ParserLimitReportFormatHook.php',
'MediaWiki\\Hook\\ParserLimitReportPrepareHook' => __DIR__ . '/includes/parser/Hook/ParserLimitReportPrepareHook.php',
'MediaWiki\\Hook\\ParserMakeImageParamsHook' => __DIR__ . '/includes/parser/Hook/ParserMakeImageParamsHook.php',
'MediaWiki\\Hook\\ParserOptionsRegisterHook' => __DIR__ . '/includes/parser/Hook/ParserOptionsRegisterHook.php',
'MediaWiki\\Hook\\ParserOutputPostCacheTransformHook' => __DIR__ . '/includes/parser/Hook/ParserOutputPostCacheTransformHook.php',
'MediaWiki\\Hook\\ParserPreSaveTransformCompleteHook' => __DIR__ . '/includes/parser/Hook/ParserPreSaveTransformCompleteHook.php',
'MediaWiki\\Hook\\ParserSectionCreateHook' => __DIR__ . '/includes/parser/Hook/ParserSectionCreateHook.php',
'MediaWiki\\Hook\\PasswordPoliciesForUserHook' => __DIR__ . '/includes/password/Hook/PasswordPoliciesForUserHook.php',
'MediaWiki\\Hook\\PersonalUrlsHook' => __DIR__ . '/includes/skins/Hook/PersonalUrlsHook.php',
'MediaWiki\\Hook\\PostLoginRedirectHook' => __DIR__ . '/includes/specials/Hook/PostLoginRedirectHook.php',
'MediaWiki\\Hook\\PreferencesGetLegendHook' => __DIR__ . '/includes/specials/Hook/PreferencesGetLegendHook.php',
'MediaWiki\\Hook\\PrefsEmailAuditHook' => __DIR__ . '/includes/specials/Hook/PrefsEmailAuditHook.php',
'MediaWiki\\Hook\\RandomPageQueryHook' => __DIR__ . '/includes/specials/Hook/RandomPageQueryHook.php',
'MediaWiki\\Hook\\RawPageViewBeforeOutputHook' => __DIR__ . '/includes/actions/Hook/RawPageViewBeforeOutputHook.php',
'MediaWiki\\Hook\\RecentChange_saveHook' => __DIR__ . '/includes/changes/Hook/RecentChange_saveHook.php',
'MediaWiki\\Hook\\RecentChangesPurgeRowsHook' => __DIR__ . '/includes/jobqueue/jobs/Hook/RecentChangesPurgeRowsHook.php',
'MediaWiki\\Hook\\RejectParserCacheValueHook' => __DIR__ . '/includes/parser/Hook/RejectParserCacheValueHook.php',
'MediaWiki\\Hook\\RequestContextCreateSkinHook' => __DIR__ . '/includes/context/Hook/RequestContextCreateSkinHook.php',
'MediaWiki\\Hook\\ResourceLoaderForeignApiModulesHook' => __DIR__ . '/includes/resourceloader/Hook/ResourceLoaderForeignApiModulesHook.php',
'MediaWiki\\Hook\\ResourceLoaderGetConfigVarsHook' => __DIR__ . '/includes/resourceloader/Hook/ResourceLoaderGetConfigVarsHook.php',
'MediaWiki\\Hook\\ResourceLoaderJqueryMsgModuleMagicWordsHook' => __DIR__ . '/includes/resourceloader/Hook/ResourceLoaderJqueryMsgModuleMagicWordsHook.php',
'MediaWiki\\Hook\\ResourceLoaderSiteModulePagesHook' => __DIR__ . '/includes/resourceloader/Hook/ResourceLoaderSiteModulePagesHook.php',
'MediaWiki\\Hook\\ResourceLoaderSiteStylesModulePagesHook' => __DIR__ . '/includes/resourceloader/Hook/ResourceLoaderSiteStylesModulePagesHook.php',
'MediaWiki\\Hook\\ResourceLoaderTestModulesHook' => __DIR__ . '/includes/resourceloader/Hook/ResourceLoaderTestModulesHook.php',
'MediaWiki\\Hook\\SendWatchlistEmailNotificationHook' => __DIR__ . '/includes/mail/Hook/SendWatchlistEmailNotificationHook.php',
'MediaWiki\\Hook\\ShortPagesQueryHook' => __DIR__ . '/includes/specials/Hook/ShortPagesQueryHook.php',
'MediaWiki\\Hook\\SidebarBeforeOutputHook' => __DIR__ . '/includes/skins/Hook/SidebarBeforeOutputHook.php',
'MediaWiki\\Hook\\SiteNoticeAfterHook' => __DIR__ . '/includes/skins/Hook/SiteNoticeAfterHook.php',
'MediaWiki\\Hook\\SiteNoticeBeforeHook' => __DIR__ . '/includes/skins/Hook/SiteNoticeBeforeHook.php',
'MediaWiki\\Hook\\SkinAfterBottomScriptsHook' => __DIR__ . '/includes/skins/Hook/SkinAfterBottomScriptsHook.php',
'MediaWiki\\Hook\\SkinAfterContentHook' => __DIR__ . '/includes/skins/Hook/SkinAfterContentHook.php',
'MediaWiki\\Hook\\SkinBuildSidebarHook' => __DIR__ . '/includes/skins/Hook/SkinBuildSidebarHook.php',
'MediaWiki\\Hook\\SkinCopyrightFooterHook' => __DIR__ . '/includes/skins/Hook/SkinCopyrightFooterHook.php',
'MediaWiki\\Hook\\SkinEditSectionLinksHook' => __DIR__ . '/includes/skins/Hook/SkinEditSectionLinksHook.php',
'MediaWiki\\Hook\\SkinGetPoweredByHook' => __DIR__ . '/includes/skins/Hook/SkinGetPoweredByHook.php',
'MediaWiki\\Hook\\SkinPreloadExistenceHook' => __DIR__ . '/includes/skins/Hook/SkinPreloadExistenceHook.php',
'MediaWiki\\Hook\\SkinSubPageSubtitleHook' => __DIR__ . '/includes/skins/Hook/SkinSubPageSubtitleHook.php',
'MediaWiki\\Hook\\SkinTemplateBuildNavUrlsNav_urlsAfterPermalinkHook' => __DIR__ . '/includes/skins/Hook/SkinTemplateBuildNavUrlsNav_urlsAfterPermalinkHook.php',
'MediaWiki\\Hook\\SkinTemplateGetLanguageLinkHook' => __DIR__ . '/includes/skins/Hook/SkinTemplateGetLanguageLinkHook.php',
'MediaWiki\\Hook\\SkinTemplateNavigationHook' => __DIR__ . '/includes/skins/Hook/SkinTemplateNavigationHook.php',
'MediaWiki\\Hook\\SkinTemplateNavigation__SpecialPageHook' => __DIR__ . '/includes/skins/Hook/SkinTemplateNavigation__SpecialPageHook.php',
'MediaWiki\\Hook\\SkinTemplateNavigation__UniversalHook' => __DIR__ . '/includes/skins/Hook/SkinTemplateNavigation__UniversalHook.php',
'MediaWiki\\Hook\\SkinTemplateOutputPageBeforeExecHook' => __DIR__ . '/includes/skins/Hook/SkinTemplateOutputPageBeforeExecHook.php',
'MediaWiki\\Hook\\SkinTemplatePreventOtherActiveTabsHook' => __DIR__ . '/includes/skins/Hook/SkinTemplatePreventOtherActiveTabsHook.php',
'MediaWiki\\Hook\\SkinTemplateTabActionHook' => __DIR__ . '/includes/skins/Hook/SkinTemplateTabActionHook.php',
'MediaWiki\\Hook\\SkinTemplateToolboxEndHook' => __DIR__ . '/includes/skins/Hook/SkinTemplateToolboxEndHook.php',
'MediaWiki\\Hook\\SoftwareInfoHook' => __DIR__ . '/includes/specials/Hook/SoftwareInfoHook.php',
'MediaWiki\\Hook\\SpecialBlockModifyFormFieldsHook' => __DIR__ . '/includes/specials/Hook/SpecialBlockModifyFormFieldsHook.php',
'MediaWiki\\Hook\\SpecialContributionsBeforeMainOutputHook' => __DIR__ . '/includes/specials/Hook/SpecialContributionsBeforeMainOutputHook.php',
'MediaWiki\\Hook\\SpecialContributions__formatRow__flagsHook' => __DIR__ . '/includes/specials/Hook/SpecialContributions__formatRow__flagsHook.php',
'MediaWiki\\Hook\\SpecialContributions__getForm__filtersHook' => __DIR__ . '/includes/specials/Hook/SpecialContributions__getForm__filtersHook.php',
'MediaWiki\\Hook\\SpecialListusersDefaultQueryHook' => __DIR__ . '/includes/specials/Hook/SpecialListusersDefaultQueryHook.php',
'MediaWiki\\Hook\\SpecialListusersFormatRowHook' => __DIR__ . '/includes/specials/Hook/SpecialListusersFormatRowHook.php',
'MediaWiki\\Hook\\SpecialListusersHeaderFormHook' => __DIR__ . '/includes/specials/Hook/SpecialListusersHeaderFormHook.php',
'MediaWiki\\Hook\\SpecialListusersHeaderHook' => __DIR__ . '/includes/specials/Hook/SpecialListusersHeaderHook.php',
'MediaWiki\\Hook\\SpecialListusersQueryInfoHook' => __DIR__ . '/includes/specials/Hook/SpecialListusersQueryInfoHook.php',
'MediaWiki\\Hook\\SpecialLogAddLogSearchRelationsHook' => __DIR__ . '/includes/specials/Hook/SpecialLogAddLogSearchRelationsHook.php',
'MediaWiki\\Hook\\SpecialMovepageAfterMoveHook' => __DIR__ . '/includes/specials/Hook/SpecialMovepageAfterMoveHook.php',
'MediaWiki\\Hook\\SpecialMuteModifyFormFieldsHook' => __DIR__ . '/includes/specials/Hook/SpecialMuteModifyFormFieldsHook.php',
'MediaWiki\\Hook\\SpecialMuteSubmitHook' => __DIR__ . '/includes/specials/Hook/SpecialMuteSubmitHook.php',
'MediaWiki\\Hook\\SpecialNewPagesFiltersHook' => __DIR__ . '/includes/specials/Hook/SpecialNewPagesFiltersHook.php',
'MediaWiki\\Hook\\SpecialNewpagesConditionsHook' => __DIR__ . '/includes/specials/Hook/SpecialNewpagesConditionsHook.php',
'MediaWiki\\Hook\\SpecialRandomGetRandomTitleHook' => __DIR__ . '/includes/specials/Hook/SpecialRandomGetRandomTitleHook.php',
'MediaWiki\\Hook\\SpecialRecentChangesPanelHook' => __DIR__ . '/includes/specials/Hook/SpecialRecentChangesPanelHook.php',
'MediaWiki\\Hook\\SpecialResetTokensTokensHook' => __DIR__ . '/includes/specials/Hook/SpecialResetTokensTokensHook.php',
'MediaWiki\\Hook\\SpecialSearchCreateLinkHook' => __DIR__ . '/includes/specials/Hook/SpecialSearchCreateLinkHook.php',
'MediaWiki\\Hook\\SpecialSearchGoResultHook' => __DIR__ . '/includes/specials/Hook/SpecialSearchGoResultHook.php',
'MediaWiki\\Hook\\SpecialSearchNogomatchHook' => __DIR__ . '/includes/specials/Hook/SpecialSearchNogomatchHook.php',
'MediaWiki\\Hook\\SpecialSearchProfilesHook' => __DIR__ . '/includes/specials/Hook/SpecialSearchProfilesHook.php',
'MediaWiki\\Hook\\SpecialSearchResultsAppendHook' => __DIR__ . '/includes/specials/Hook/SpecialSearchResultsAppendHook.php',
'MediaWiki\\Hook\\SpecialSearchResultsHook' => __DIR__ . '/includes/specials/Hook/SpecialSearchResultsHook.php',
'MediaWiki\\Hook\\SpecialSearchResultsPrependHook' => __DIR__ . '/includes/specials/Hook/SpecialSearchResultsPrependHook.php',
'MediaWiki\\Hook\\SpecialSearchSetupEngineHook' => __DIR__ . '/includes/specials/Hook/SpecialSearchSetupEngineHook.php',
'MediaWiki\\Hook\\SpecialStatsAddExtraHook' => __DIR__ . '/includes/specials/Hook/SpecialStatsAddExtraHook.php',
'MediaWiki\\Hook\\SpecialTrackingCategories__generateCatLinkHook' => __DIR__ . '/includes/specials/Hook/SpecialTrackingCategories__generateCatLinkHook.php',
'MediaWiki\\Hook\\SpecialTrackingCategories__preprocessHook' => __DIR__ . '/includes/specials/Hook/SpecialTrackingCategories__preprocessHook.php',
'MediaWiki\\Hook\\SpecialUploadCompleteHook' => __DIR__ . '/includes/specials/Hook/SpecialUploadCompleteHook.php',
'MediaWiki\\Hook\\SpecialVersionVersionUrlHook' => __DIR__ . '/includes/specials/Hook/SpecialVersionVersionUrlHook.php',
'MediaWiki\\Hook\\SpecialWatchlistGetNonRevisionTypesHook' => __DIR__ . '/includes/specials/Hook/SpecialWatchlistGetNonRevisionTypesHook.php',
'MediaWiki\\Hook\\ThumbnailBeforeProduceHTMLHook' => __DIR__ . '/includes/media/Hook/ThumbnailBeforeProduceHTMLHook.php',
'MediaWiki\\Hook\\UnblockUserCompleteHook' => __DIR__ . '/includes/specials/Hook/UnblockUserCompleteHook.php',
'MediaWiki\\Hook\\UnblockUserHook' => __DIR__ . '/includes/specials/Hook/UnblockUserHook.php',
'MediaWiki\\Hook\\UndeleteForm__showHistoryHook' => __DIR__ . '/includes/specials/Hook/UndeleteForm__showHistoryHook.php',
'MediaWiki\\Hook\\UndeleteForm__showRevisionHook' => __DIR__ . '/includes/specials/Hook/UndeleteForm__showRevisionHook.php',
'MediaWiki\\Hook\\UndeleteForm__undeleteHook' => __DIR__ . '/includes/specials/Hook/UndeleteForm__undeleteHook.php',
'MediaWiki\\Hook\\UndeletePageToolLinksHook' => __DIR__ . '/includes/skins/Hook/UndeletePageToolLinksHook.php',
'MediaWiki\\Hook\\UndeleteShowRevisionHook' => __DIR__ . '/includes/specials/Hook/UndeleteShowRevisionHook.php',
'MediaWiki\\Hook\\UnwatchArticleCompleteHook' => __DIR__ . '/includes/actions/Hook/UnwatchArticleCompleteHook.php',
'MediaWiki\\Hook\\UnwatchArticleHook' => __DIR__ . '/includes/actions/Hook/UnwatchArticleHook.php',
'MediaWiki\\Hook\\UpdateUserMailerFormattedPageStatusHook' => __DIR__ . '/includes/mail/Hook/UpdateUserMailerFormattedPageStatusHook.php',
'MediaWiki\\Hook\\UploadCompleteHook' => __DIR__ . '/includes/upload/Hook/UploadCompleteHook.php',
'MediaWiki\\Hook\\UploadCreateFromRequestHook' => __DIR__ . '/includes/upload/Hook/UploadCreateFromRequestHook.php',
'MediaWiki\\Hook\\UploadFormInitDescriptorHook' => __DIR__ . '/includes/specials/Hook/UploadFormInitDescriptorHook.php',
'MediaWiki\\Hook\\UploadFormSourceDescriptorsHook' => __DIR__ . '/includes/specials/Hook/UploadFormSourceDescriptorsHook.php',
'MediaWiki\\Hook\\UploadForm_BeforeProcessingHook' => __DIR__ . '/includes/specials/Hook/UploadForm_BeforeProcessingHook.php',
'MediaWiki\\Hook\\UploadForm_getInitialPageTextHook' => __DIR__ . '/includes/specials/Hook/UploadForm_getInitialPageTextHook.php',
'MediaWiki\\Hook\\UploadForm_initialHook' => __DIR__ . '/includes/specials/Hook/UploadForm_initialHook.php',
'MediaWiki\\Hook\\UploadStashFileHook' => __DIR__ . '/includes/upload/Hook/UploadStashFileHook.php',
'MediaWiki\\Hook\\UploadVerifyFileHook' => __DIR__ . '/includes/upload/Hook/UploadVerifyFileHook.php',
'MediaWiki\\Hook\\UploadVerifyUploadHook' => __DIR__ . '/includes/upload/Hook/UploadVerifyUploadHook.php',
'MediaWiki\\Hook\\UserGetLanguageObjectHook' => __DIR__ . '/includes/context/Hook/UserGetLanguageObjectHook.php',
'MediaWiki\\Hook\\UserLoginCompleteHook' => __DIR__ . '/includes/specials/Hook/UserLoginCompleteHook.php',
'MediaWiki\\Hook\\UserLogoutCompleteHook' => __DIR__ . '/includes/specials/Hook/UserLogoutCompleteHook.php',
'MediaWiki\\Hook\\UserMailerChangeReturnPathHook' => __DIR__ . '/includes/mail/Hook/UserMailerChangeReturnPathHook.php',
'MediaWiki\\Hook\\UserMailerSplitToHook' => __DIR__ . '/includes/mail/Hook/UserMailerSplitToHook.php',
'MediaWiki\\Hook\\UserMailerTransformContentHook' => __DIR__ . '/includes/mail/Hook/UserMailerTransformContentHook.php',
'MediaWiki\\Hook\\UserMailerTransformMessageHook' => __DIR__ . '/includes/mail/Hook/UserMailerTransformMessageHook.php',
'MediaWiki\\Hook\\UsersPagerDoBatchLookupsHook' => __DIR__ . '/includes/specials/Hook/UsersPagerDoBatchLookupsHook.php',
'MediaWiki\\Hook\\ValidateExtendedMetadataCacheHook' => __DIR__ . '/includes/media/Hook/ValidateExtendedMetadataCacheHook.php',
'MediaWiki\\Hook\\WantedPages__getQueryInfoHook' => __DIR__ . '/includes/specials/Hook/WantedPages__getQueryInfoHook.php',
'MediaWiki\\Hook\\WatchArticleCompleteHook' => __DIR__ . '/includes/actions/Hook/WatchArticleCompleteHook.php',
'MediaWiki\\Hook\\WatchArticleHook' => __DIR__ . '/includes/actions/Hook/WatchArticleHook.php',
'MediaWiki\\Hook\\WatchedItemQueryServiceExtensionsHook' => __DIR__ . '/includes/watcheditem/Hook/WatchedItemQueryServiceExtensionsHook.php',
'MediaWiki\\Hook\\WatchlistEditorBeforeFormRenderHook' => __DIR__ . '/includes/specials/Hook/WatchlistEditorBeforeFormRenderHook.php',
'MediaWiki\\Hook\\WatchlistEditorBuildRemoveLineHook' => __DIR__ . '/includes/specials/Hook/WatchlistEditorBuildRemoveLineHook.php',
'MediaWiki\\Hook\\WhatLinksHerePropsHook' => __DIR__ . '/includes/specials/Hook/WhatLinksHerePropsHook.php',
'MediaWiki\\Hook\\WikiExporter__dumpStableQueryHook' => __DIR__ . '/includes/export/Hook/WikiExporter__dumpStableQueryHook.php',
'MediaWiki\\Hook\\XmlDumpWriterOpenPageHook' => __DIR__ . '/includes/export/Hook/XmlDumpWriterOpenPageHook.php',
'MediaWiki\\Hook\\XmlDumpWriterWriteRevisionHook' => __DIR__ . '/includes/export/Hook/XmlDumpWriterWriteRevisionHook.php',
'MediaWiki\\Languages\\Data\\CrhExceptions' => __DIR__ . '/languages/data/CrhExceptions.php',
'MediaWiki\\Languages\\Data\\Names' => __DIR__ . '/languages/data/Names.php',
'MediaWiki\\Languages\\Data\\ZhConversion' => __DIR__ . '/languages/data/ZhConversion.php',
'MediaWiki\\Languages\\Hook\\LanguageGetTranslatedLanguageNamesHook' => __DIR__ . '/includes/language/Hook/LanguageGetTranslatedLanguageNamesHook.php',
'MediaWiki\\Languages\\Hook\\Language__getMessagesFileNameHook' => __DIR__ . '/includes/language/Hook/Language__getMessagesFileNameHook.php',
'MediaWiki\\Languages\\LanguageConverterFactory' => __DIR__ . '/languages/LanguageConverterFactory.php',
'MediaWiki\\Languages\\LanguageFactory' => __DIR__ . '/includes/language/LanguageFactory.php',
'MediaWiki\\Languages\\LanguageFallback' => __DIR__ . '/includes/language/LanguageFallback.php',

View file

@ -0,0 +1,21 @@
<?php
namespace MediaWiki\Hook;
/**
* @stable for implementation
* @ingroup Hooks
*/
interface AfterBuildFeedLinksHook {
/**
* Executed in OutputPage.php after all feed links (atom,
* rss,...) are created. Can be used to omit specific feeds from being outputted.
* You must not use this hook to add feeds, use OutputPage::addFeedLink() instead.
*
* @since 1.35
*
* @param ?mixed &$feedLinks Array of created feed links
* @return bool|void True or no return value to continue or false to abort
*/
public function onAfterBuildFeedLinks( &$feedLinks );
}

View file

@ -0,0 +1,22 @@
<?php
namespace MediaWiki\Hook;
/**
* @stable for implementation
* @ingroup Hooks
*/
interface AfterFinalPageOutputHook {
/**
* Nearly at the end of OutputPage::output() but
* before OutputPage::sendCacheControl() and final ob_end_flush() which
* will send the buffered output to the client. This allows for last-minute
* modification of the output within the buffer by using ob_get_clean().
*
* @since 1.35
*
* @param ?mixed $output The OutputPage object where output() was called
* @return bool|void This hook must not abort, it must return true or null.
*/
public function onAfterFinalPageOutput( $output );
}

View file

@ -0,0 +1,20 @@
<?php
namespace MediaWiki\Hook;
/**
* @stable for implementation
* @ingroup Hooks
*/
interface AlternateEditHook {
/**
* Before checking if a user can edit a page and before showing
* the edit form ( EditPage::edit() ). This is triggered on &action=edit.
*
* @since 1.35
*
* @param ?mixed $editPage the EditPage object
* @return bool|void True or no return value to continue or false to abort
*/
public function onAlternateEdit( $editPage );
}

View file

@ -0,0 +1,27 @@
<?php
namespace MediaWiki\Hook;
/**
* @stable for implementation
* @ingroup Hooks
*/
interface AlternateEditPreviewHook {
/**
* Before generating the preview of the page when editing
* ( EditPage::getPreviewText() ).
* Return false and set $previewHTML and $parserOutput to output custom page
* preview HTML.
*
* @since 1.35
*
* @param ?mixed $editPage the EditPage object
* @param ?mixed &$content the Content object for the text field from the edit page
* @param ?mixed &$previewHTML Text to be placed into the page for the preview
* @param ?mixed &$parserOutput the ParserOutput object for the preview
* @return bool|void True or no return value to continue or false to abort
*/
public function onAlternateEditPreview( $editPage, &$content, &$previewHTML,
&$parserOutput
);
}

View file

@ -0,0 +1,19 @@
<?php
namespace MediaWiki\Hook;
/**
* @stable for implementation
* @ingroup Hooks
*/
interface ApiBeforeMainHook {
/**
* Before calling ApiMain's execute() method in api.php.
*
* @since 1.35
*
* @param ?mixed &$main ApiMain object
* @return bool|void True or no return value to continue or false to abort
*/
public function onApiBeforeMain( &$main );
}

View file

@ -0,0 +1,20 @@
<?php
namespace MediaWiki\Hook;
/**
* @stable for implementation
* @ingroup Hooks
*/
interface ArticleMergeCompleteHook {
/**
* After merging to article using Special:Mergehistory.
*
* @since 1.35
*
* @param ?mixed $targetTitle target title (object)
* @param ?mixed $destTitle destination title (object)
* @return bool|void True or no return value to continue or false to abort
*/
public function onArticleMergeComplete( $targetTitle, $destTitle );
}

View file

@ -0,0 +1,24 @@
<?php
namespace MediaWiki\Hook;
/**
* @stable for implementation
* @ingroup Hooks
*/
interface ArticleUpdateBeforeRedirectHook {
/**
* After a page is updated (usually on save), before
* the user is redirected back to the page.
*
* @since 1.35
*
* @param ?mixed $article the article
* @param ?mixed &$sectionanchor The section anchor link (e.g. "#overview" )
* @param ?mixed &$extraq Extra query parameters which can be added via hooked functions
* @return bool|void True or no return value to continue or false to abort
*/
public function onArticleUpdateBeforeRedirect( $article, &$sectionanchor,
&$extraq
);
}

View file

@ -0,0 +1,22 @@
<?php
namespace MediaWiki\Hook;
/**
* @stable for implementation
* @ingroup Hooks
*/
interface AutopromoteConditionHook {
/**
* Check autopromote condition for user.
*
* @since 1.35
*
* @param ?mixed $type condition type
* @param ?mixed $args arguments
* @param ?mixed $user user
* @param ?mixed &$result result of checking autopromote condition
* @return bool|void True or no return value to continue or false to abort
*/
public function onAutopromoteCondition( $type, $args, $user, &$result );
}

View file

@ -0,0 +1,22 @@
<?php
namespace MediaWiki\Hook;
/**
* @stable for implementation
* @ingroup Hooks
*/
interface BadImageHook {
/**
* When checking against the bad image list. Change $bad and return
* false to override. If an image is "bad", it is not rendered inline in wiki
* pages or galleries in category pages.
*
* @since 1.35
*
* @param ?mixed $name Image name being checked
* @param ?mixed &$bad Whether or not the image is "bad"
* @return bool|void True or no return value to continue or false to abort
*/
public function onBadImage( $name, &$bad );
}

View file

@ -0,0 +1,24 @@
<?php
namespace MediaWiki\Hook;
/**
* @stable for implementation
* @ingroup Hooks
*/
interface BeforeHttpsRedirectHook {
/**
* Prior to forcing HTTP->HTTPS redirect. Gives a chance to
* override how the redirect is output by modifying, or by returning false, and
* letting standard HTTP rendering take place.
* ATTENTION: This hook is likely to be removed soon due to overall design of the
* system.
*
* @since 1.35
*
* @param ?mixed $context IContextSource object
* @param ?mixed &$redirect string URL, modifiable
* @return bool|void True or no return value to continue or false to abort
*/
public function onBeforeHttpsRedirect( $context, &$redirect );
}

View file

@ -0,0 +1,27 @@
<?php
namespace MediaWiki\Hook;
/**
* @stable for implementation
* @ingroup Hooks
*/
interface BeforeInitializeHook {
/**
* Before anything is initialized in
* MediaWiki::performRequest().
*
* @since 1.35
*
* @param ?mixed $title Title being used for request
* @param ?mixed $unused null
* @param ?mixed $output OutputPage object
* @param ?mixed $user User
* @param ?mixed $request WebRequest object
* @param ?mixed $mediaWiki Mediawiki object
* @return bool|void True or no return value to continue or false to abort
*/
public function onBeforeInitialize( $title, $unused, $output, $user, $request,
$mediaWiki
);
}

View file

@ -0,0 +1,20 @@
<?php
namespace MediaWiki\Hook;
/**
* @stable for implementation
* @ingroup Hooks
*/
interface BeforePageDisplayHook {
/**
* Prior to outputting a page.
*
* @since 1.35
*
* @param ?mixed $out OutputPage object
* @param ?mixed $skin Skin object
* @return bool|void This hook must not abort, it must return true or null.
*/
public function onBeforePageDisplay( $out, $skin );
}

View file

@ -0,0 +1,23 @@
<?php
namespace MediaWiki\Hook;
/**
* @stable for implementation
* @ingroup Hooks
*/
interface BeforePageRedirectHook {
/**
* Prior to sending an HTTP redirect. Gives a chance to
* override how the redirect is output by modifying, or by returning false and
* taking over the output.
*
* @since 1.35
*
* @param ?mixed $out OutputPage object
* @param ?mixed &$redirect URL, modifiable
* @param ?mixed &$code HTTP code (eg '301' or '302'), modifiable
* @return bool|void True or no return value to continue or false to abort
*/
public function onBeforePageRedirect( $out, &$redirect, &$code );
}

View file

@ -0,0 +1,22 @@
<?php
namespace MediaWiki\Hook;
/**
* @stable for implementation
* @ingroup Hooks
*/
interface CanIPUseHTTPSHook {
/**
* Determine whether the client at a given source IP is likely
* to be able to access the wiki via HTTPS.
*
* @since 1.35
*
* @param ?mixed $ip The IP address in human-readable form
* @param ?mixed &$canDo This reference should be set to false if the client may not be able
* to use HTTPS
* @return bool|void True or no return value to continue or false to abort
*/
public function onCanIPUseHTTPS( $ip, &$canDo );
}

View file

@ -0,0 +1,23 @@
<?php
namespace MediaWiki\Hook;
// phpcs:disable Squiz.Classes.ValidClassName.NotCamelCaps
/**
* @stable for implementation
* @ingroup Hooks
*/
interface CategoryViewer__doCategoryQueryHook {
/**
* After querying for pages to be displayed
* in a Category page. Gives extensions the opportunity to batch load any
* related data about the pages.
*
* @since 1.35
*
* @param ?mixed $type The category type. Either 'page', 'file' or 'subcat'
* @param ?mixed $res Query result from Wikimedia\Rdbms\IDatabase::select()
* @return bool|void True or no return value to continue or false to abort
*/
public function onCategoryViewer__doCategoryQuery( $type, $res );
}

View file

@ -0,0 +1,25 @@
<?php
namespace MediaWiki\Hook;
// phpcs:disable Squiz.Classes.ValidClassName.NotCamelCaps
/**
* @stable for implementation
* @ingroup Hooks
*/
interface CategoryViewer__generateLinkHook {
/**
* Before generating an output link allow
* extensions opportunity to generate a more specific or relevant link.
*
* @since 1.35
*
* @param ?mixed $type The category type. Either 'page', 'img' or 'subcat'
* @param ?mixed $title Title object for the categorized page
* @param ?mixed $html Requested html content of anchor
* @param ?mixed &$link Returned value. When set to a non-null value by a hook subscriber
* this value will be used as the anchor instead of Linker::link
* @return bool|void True or no return value to continue or false to abort
*/
public function onCategoryViewer__generateLink( $type, $title, $html, &$link );
}

View file

@ -0,0 +1,26 @@
<?php
namespace MediaWiki\Hook;
/**
* @stable for implementation
* @ingroup Hooks
*/
interface ContentSecurityPolicyDefaultSourceHook {
/**
* Modify the allowed CSP load sources. This
* affects all directives except for the script directive. If you want to add a
* script source, see ContentSecurityPolicyScriptSource hook.
*
* @since 1.35
*
* @param ?mixed &$defaultSrc Array of Content-Security-Policy allowed sources
* @param ?mixed $policyConfig Current configuration for the Content-Security-Policy header
* @param ?mixed $mode ContentSecurityPolicy::REPORT_ONLY_MODE or
* ContentSecurityPolicy::FULL_MODE depending on type of header
* @return bool|void True or no return value to continue or false to abort
*/
public function onContentSecurityPolicyDefaultSource( &$defaultSrc,
$policyConfig, $mode
);
}

View file

@ -0,0 +1,26 @@
<?php
namespace MediaWiki\Hook;
/**
* @stable for implementation
* @ingroup Hooks
*/
interface ContentSecurityPolicyDirectivesHook {
/**
* Modify the content security policy
* directives. Use this only if ContentSecurityPolicyDefaultSource and
* ContentSecurityPolicyScriptSource do not meet your needs.
*
* @since 1.35
*
* @param ?mixed &$directives Array of CSP directives
* @param ?mixed $policyConfig Current configuration for the CSP header
* @param ?mixed $mode ContentSecurityPolicy::REPORT_ONLY_MODE or
* ContentSecurityPolicy::FULL_MODE depending on type of header
* @return bool|void True or no return value to continue or false to abort
*/
public function onContentSecurityPolicyDirectives( &$directives, $policyConfig,
$mode
);
}

View file

@ -0,0 +1,27 @@
<?php
namespace MediaWiki\Hook;
/**
* @stable for implementation
* @ingroup Hooks
*/
interface ContentSecurityPolicyScriptSourceHook {
/**
* Modify the allowed CSP script sources.
* Note that you also have to use ContentSecurityPolicyDefaultSource if you
* want non-script sources to be loaded from
* whatever you add.
*
* @since 1.35
*
* @param ?mixed &$scriptSrc Array of CSP directives
* @param ?mixed $policyConfig Current configuration for the CSP header
* @param ?mixed $mode ContentSecurityPolicy::REPORT_ONLY_MODE or
* ContentSecurityPolicy::FULL_MODE depending on type of header
* @return bool|void True or no return value to continue or false to abort
*/
public function onContentSecurityPolicyScriptSource( &$scriptSrc,
$policyConfig, $mode
);
}

View file

@ -0,0 +1,27 @@
<?php
namespace MediaWiki\Hook;
/**
* @stable for implementation
* @ingroup Hooks
*/
interface DeleteUnknownPreferencesHook {
/**
* Called by the cleanupPreferences.php maintenance
* script to build a WHERE clause with which to delete preferences that are not
* known about. This hook is used by extensions that have dynamically-named
* preferences that should not be deleted in the usual cleanup process. For
* example, the Gadgets extension creates preferences prefixed with 'gadget-', and
* so anything with that prefix is excluded from the deletion.
*
* @since 1.35
*
* @param ?mixed &$where An array that will be passed as the $cond parameter to
* IDatabase::select() to determine what will be deleted from the user_properties
* table.
* @param ?mixed $db The IDatabase object, useful for accessing $db->buildLike() etc.
* @return bool|void True or no return value to continue or false to abort
*/
public function onDeleteUnknownPreferences( &$where, $db );
}

View file

@ -0,0 +1,23 @@
<?php
namespace MediaWiki\Hook;
/**
* @stable for implementation
* @ingroup Hooks
*/
interface EditFilterHook {
/**
* Perform checks on an edit
*
* @since 1.35
*
* @param ?mixed $editor EditPage instance (object). The edit form (see includes/EditPage.php)
* @param ?mixed $text Contents of the edit box
* @param ?mixed $section Section being edited
* @param ?mixed &$error Error message to return
* @param ?mixed $summary Edit summary for page
* @return bool|void True or no return value to continue or false to abort
*/
public function onEditFilter( $editor, $text, $section, &$error, $summary );
}

View file

@ -0,0 +1,33 @@
<?php
namespace MediaWiki\Hook;
/**
* @stable for implementation
* @ingroup Hooks
*/
interface EditFilterMergedContentHook {
/**
* Post-section-merge edit filter.
* This may be triggered by the EditPage or any other facility that modifies page
* content. Use the $status object to indicate whether the edit should be allowed,
* and to provide a reason for disallowing it. Return false to abort the edit, and
* true to continue. Returning true if $status->isOK() returns false means "don't
* save but continue user interaction", e.g. show the edit form.
* $status->apiHookResult can be set to an array to be returned by api.php
* action=edit. This is used to deliver captchas.
*
* @since 1.35
*
* @param ?mixed $context object implementing the IContextSource interface.
* @param ?mixed $content content of the edit box, as a Content object.
* @param ?mixed $status Status object to represent errors, etc.
* @param ?mixed $summary Edit summary for page
* @param ?mixed $user the User object representing the user whois performing the edit.
* @param ?mixed $minoredit whether the edit was marked as minor by the user.
* @return bool|void True or no return value to continue or false to abort
*/
public function onEditFilterMergedContent( $context, $content, $status,
$summary, $user, $minoredit
);
}

View file

@ -0,0 +1,20 @@
<?php
namespace MediaWiki\Hook;
/**
* @stable for implementation
* @ingroup Hooks
*/
interface EditFormInitialTextHook {
/**
* Allows modifying the edit form when editing existing
* pages
*
* @since 1.35
*
* @param ?mixed $editPage EditPage object
* @return bool|void True or no return value to continue or false to abort
*/
public function onEditFormInitialText( $editPage );
}

View file

@ -0,0 +1,21 @@
<?php
namespace MediaWiki\Hook;
/**
* @stable for implementation
* @ingroup Hooks
*/
interface EditFormPreloadTextHook {
/**
* Allows population of the edit form when creating
* new pages
*
* @since 1.35
*
* @param ?mixed &$text Text to preload with
* @param ?mixed $title Title object representing the page being created
* @return bool|void True or no return value to continue or false to abort
*/
public function onEditFormPreloadText( &$text, $title );
}

View file

@ -0,0 +1,24 @@
<?php
namespace MediaWiki\Hook;
/**
* @stable for implementation
* @ingroup Hooks
*/
interface EditPageBeforeConflictDiffHook {
/**
* allows modifying the EditPage object and output
* when there's an edit conflict. Return false to halt normal diff output; in
* this case you're responsible for computing and outputting the entire "conflict"
* part, i.e., the "difference between revisions" and "your text" headers and
* sections.
*
* @since 1.35
*
* @param ?mixed $editor EditPage instance
* @param ?mixed $out OutputPage instance
* @return bool|void True or no return value to continue or false to abort
*/
public function onEditPageBeforeConflictDiff( $editor, $out );
}

View file

@ -0,0 +1,22 @@
<?php
namespace MediaWiki\Hook;
/**
* @stable for implementation
* @ingroup Hooks
*/
interface EditPageBeforeEditButtonsHook {
/**
* Allows modifying the edit buttons below the
* textarea in the edit form.
*
* @since 1.35
*
* @param ?mixed $editpage The current EditPage object
* @param ?mixed &$buttons Array of edit buttons "Save", "Preview", "Live", and "Diff"
* @param ?mixed &$tabindex HTML tabindex of the last edit check/button
* @return bool|void True or no return value to continue or false to abort
*/
public function onEditPageBeforeEditButtons( $editpage, &$buttons, &$tabindex );
}

View file

@ -0,0 +1,21 @@
<?php
namespace MediaWiki\Hook;
/**
* @stable for implementation
* @ingroup Hooks
*/
interface EditPageBeforeEditToolbarHook {
/**
* Allow adding an edit toolbar above the textarea in
* the edit form.
*
* @since 1.35
*
* @param ?mixed &$toolbar The toolbar HTML, initially an empty `<div id="toolbar"></div>`
* Hook subscribers can return false to have no toolbar HTML be loaded.
* @return bool|void True or no return value to continue or false to abort
*/
public function onEditPageBeforeEditToolbar( &$toolbar );
}

View file

@ -0,0 +1,22 @@
<?php
namespace MediaWiki\Hook;
/**
* @stable for implementation
* @ingroup Hooks
*/
interface EditPageCopyrightWarningHook {
/**
* Allow for site and per-namespace customization of
* contribution/copyright notice.
*
* @since 1.35
*
* @param ?mixed $title title of page being edited
* @param ?mixed &$msg localization message name, overridable. Default is either
* 'copyrightwarning' or 'copyrightwarning2'.
* @return bool|void True or no return value to continue or false to abort
*/
public function onEditPageCopyrightWarning( $title, &$msg );
}

View file

@ -0,0 +1,22 @@
<?php
namespace MediaWiki\Hook;
/**
* @stable for implementation
* @ingroup Hooks
*/
interface EditPageGetCheckboxesDefinitionHook {
/**
* Allows modifying the edit checkboxes
* below the textarea in the edit form.
*
* @since 1.35
*
* @param ?mixed $editpage The current EditPage object
* @param ?mixed &$checkboxes Array of checkbox definitions. See
* EditPage::getCheckboxesDefinition() for the format.
* @return bool|void True or no return value to continue or false to abort
*/
public function onEditPageGetCheckboxesDefinition( $editpage, &$checkboxes );
}

View file

@ -0,0 +1,22 @@
<?php
namespace MediaWiki\Hook;
/**
* @stable for implementation
* @ingroup Hooks
*/
interface EditPageGetDiffContentHook {
/**
* Allow modifying the wikitext that will be used in
* "Show changes". Note that it is preferable to implement diff handling for
* different data types using the ContentHandler facility.
*
* @since 1.35
*
* @param ?mixed $editPage EditPage object
* @param ?mixed &$newtext wikitext that will be used as "your version"
* @return bool|void True or no return value to continue or false to abort
*/
public function onEditPageGetDiffContent( $editPage, &$newtext );
}

View file

@ -0,0 +1,22 @@
<?php
namespace MediaWiki\Hook;
/**
* @stable for implementation
* @ingroup Hooks
*/
interface EditPageGetPreviewContentHook {
/**
* Allow modifying the wikitext that will be
* previewed. Note that it is preferable to implement previews for different data
* types using the ContentHandler facility.
*
* @since 1.35
*
* @param ?mixed $editPage EditPage object
* @param ?mixed &$content Content object to be previewed (may be replaced by hook function)
* @return bool|void True or no return value to continue or false to abort
*/
public function onEditPageGetPreviewContent( $editPage, &$content );
}

View file

@ -0,0 +1,21 @@
<?php
namespace MediaWiki\Hook;
/**
* @stable for implementation
* @ingroup Hooks
*/
interface EditPageNoSuchSectionHook {
/**
* When a section edit request is given for an
* non-existent section
*
* @since 1.35
*
* @param ?mixed $editpage The current EditPage object
* @param ?mixed &$res the HTML of the error text
* @return bool|void True or no return value to continue or false to abort
*/
public function onEditPageNoSuchSection( $editpage, &$res );
}

View file

@ -0,0 +1,22 @@
<?php
namespace MediaWiki\Hook;
/**
* @stable for implementation
* @ingroup Hooks
*/
interface EditPageTosSummaryHook {
/**
* Give a chance for site and per-namespace customizations
* of terms of service summary link that might exist separately from the copyright
* notice.
*
* @since 1.35
*
* @param ?mixed $title title of page being edited
* @param ?mixed &$msg localization message name, overridable. Default is 'editpage-tos-summary'
* @return bool|void True or no return value to continue or false to abort
*/
public function onEditPageTosSummary( $title, &$msg );
}

View file

@ -0,0 +1,21 @@
<?php
namespace MediaWiki\Hook;
// phpcs:disable Squiz.Classes.ValidClassName.NotCamelCaps
/**
* @stable for implementation
* @ingroup Hooks
*/
interface EditPage__attemptSaveHook {
/**
* Called before an article is
* saved, that is before WikiPage::doEditContent() is called
*
* @since 1.35
*
* @param ?mixed $editpage_Obj the current EditPage object
* @return bool|void True or no return value to continue or false to abort
*/
public function onEditPage__attemptSave( $editpage_Obj );
}

View file

@ -0,0 +1,24 @@
<?php
namespace MediaWiki\Hook;
// phpcs:disable Squiz.Classes.ValidClassName.NotCamelCaps
/**
* @stable for implementation
* @ingroup Hooks
*/
interface EditPage__attemptSave_afterHook {
/**
* Called after an article save attempt
*
* @since 1.35
*
* @param ?mixed $editpage_Obj the current EditPage object
* @param ?mixed $status the resulting Status object
* @param ?mixed $resultDetails Result details array
* @return bool|void True or no return value to continue or false to abort
*/
public function onEditPage__attemptSave_after( $editpage_Obj, $status,
$resultDetails
);
}

View file

@ -0,0 +1,23 @@
<?php
namespace MediaWiki\Hook;
// phpcs:disable Squiz.Classes.ValidClassName.NotCamelCaps
/**
* @stable for implementation
* @ingroup Hooks
*/
interface EditPage__importFormDataHook {
/**
* allow extensions to read additional data
* posted in the form
* Return value is ignored (should always return true)
*
* @since 1.35
*
* @param ?mixed $editpage EditPage instance
* @param ?mixed $request Webrequest
* @return bool|void True or no return value to continue or false to abort
*/
public function onEditPage__importFormData( $editpage, $request );
}

View file

@ -0,0 +1,22 @@
<?php
namespace MediaWiki\Hook;
// phpcs:disable Squiz.Classes.ValidClassName.NotCamelCaps
/**
* @stable for implementation
* @ingroup Hooks
*/
interface EditPage__showEditForm_fieldsHook {
/**
* allows injection of form field into edit form
* Return value is ignored (should always return true)
*
* @since 1.35
*
* @param ?mixed $editor the EditPage instance for reference
* @param ?mixed $out an OutputPage instance to write to
* @return bool|void True or no return value to continue or false to abort
*/
public function onEditPage__showEditForm_fields( $editor, $out );
}

View file

@ -0,0 +1,25 @@
<?php
namespace MediaWiki\Hook;
// phpcs:disable Squiz.Classes.ValidClassName.NotCamelCaps
/**
* @stable for implementation
* @ingroup Hooks
*/
interface EditPage__showEditForm_initialHook {
/**
* before showing the edit form
* Return false to halt editing; you'll need to handle error messages, etc.
* yourself. Alternatively, modifying $error and returning true will cause the
* contents of $error to be echoed at the top of the edit form as wikitext.
* Return true without altering $error to allow the edit to proceed.
*
* @since 1.35
*
* @param ?mixed $editor EditPage instance (object)
* @param ?mixed $out an OutputPage instance to write to
* @return bool|void True or no return value to continue or false to abort
*/
public function onEditPage__showEditForm_initial( $editor, $out );
}

View file

@ -0,0 +1,23 @@
<?php
namespace MediaWiki\Hook;
// phpcs:disable Squiz.Classes.ValidClassName.NotCamelCaps
/**
* @stable for implementation
* @ingroup Hooks
*/
interface EditPage__showReadOnlyForm_initialHook {
/**
* similar to EditPage::showEditForm:initial
* but for the read-only 'view source' variant of the edit form.
* Return value is ignored (should always return true)
*
* @since 1.35
*
* @param ?mixed $editor EditPage instance (object)
* @param ?mixed $out an OutputPage instance to write to
* @return bool|void True or no return value to continue or false to abort
*/
public function onEditPage__showReadOnlyForm_initial( $editor, $out );
}

View file

@ -0,0 +1,26 @@
<?php
namespace MediaWiki\Hook;
// phpcs:disable Squiz.Classes.ValidClassName.NotCamelCaps
/**
* @stable for implementation
* @ingroup Hooks
*/
interface EditPage__showStandardInputs_optionsHook {
/**
* allows injection of form fields into
* the editOptions area
* Return value is ignored (should always be true)
*
* @since 1.35
*
* @param ?mixed $editor EditPage instance (object)
* @param ?mixed $out an OutputPage instance to write to
* @param ?mixed &$tabindex HTML tabindex of the last edit check/button
* @return bool|void True or no return value to continue or false to abort
*/
public function onEditPage__showStandardInputs_options( $editor, $out,
&$tabindex
);
}

View file

@ -0,0 +1,26 @@
<?php
namespace MediaWiki\Hook;
/**
* @stable for implementation
* @ingroup Hooks
*/
interface FileDeleteCompleteHook {
/**
* When a file is deleted.
*
* @since 1.35
*
* @param ?mixed $file reference to the deleted file
* @param ?mixed $oldimage in case of the deletion of an old image, the name of the old file
* @param ?mixed $article in case all revisions of the file are deleted a reference to the
* WikiFilePage associated with the file.
* @param ?mixed $user user who performed the deletion
* @param ?mixed $reason reason
* @return bool|void True or no return value to continue or false to abort
*/
public function onFileDeleteComplete( $file, $oldimage, $article, $user,
$reason
);
}

View file

@ -0,0 +1,30 @@
<?php
namespace MediaWiki\Hook;
/**
* @stable for implementation
* @ingroup Hooks
*/
interface FormatAutocommentsHook {
/**
* When an autocomment is formatted by the Linker.
*
* @since 1.35
*
* @param ?mixed &$comment Reference to the accumulated comment. Initially null, when set the
* default code will be skipped.
* @param ?mixed $pre Boolean, true if there is text before this autocomment
* @param ?mixed $auto The extracted part of the parsed comment before the call to the hook.
* @param ?mixed $post Boolean, true if there is text after this autocomment
* @param ?mixed $title An optional title object used to links to sections. Can be null.
* @param ?mixed $local Boolean indicating whether section links should refer to local page.
* @param ?mixed $wikiId String containing the ID (as used by WikiMap) of the wiki from which the
* autocomment originated; null for the local wiki. Added in 1.26, should default
* to null in handler functions, for backwards compatibility.
* @return bool|void True or no return value to continue or false to abort
*/
public function onFormatAutocomments( &$comment, $pre, $auto, $post, $title,
$local, $wikiId
);
}

View file

@ -0,0 +1,21 @@
<?php
namespace MediaWiki\Hook;
/**
* @stable for implementation
* @ingroup Hooks
*/
interface GetAutoPromoteGroupsHook {
/**
* When determining which autopromote groups a user is
* entitled to be in.
*
* @since 1.35
*
* @param ?mixed $user user to promote.
* @param ?mixed &$promote groups that will be added.
* @return bool|void True or no return value to continue or false to abort
*/
public function onGetAutoPromoteGroups( $user, &$promote );
}

View file

@ -0,0 +1,21 @@
<?php
namespace MediaWiki\Hook;
/**
* @stable for implementation
* @ingroup Hooks
*/
interface GetCacheVaryCookiesHook {
/**
* Get cookies that should vary cache options.
*
* @since 1.35
*
* @param ?mixed $out OutputPage object
* @param ?mixed &$cookies array of cookies name, add a value to it if you want to add a cookie
* that have to vary cache options
* @return bool|void True or no return value to continue or false to abort
*/
public function onGetCacheVaryCookies( $out, &$cookies );
}

View file

@ -0,0 +1,22 @@
<?php
namespace MediaWiki\Hook;
/**
* @stable for implementation
* @ingroup Hooks
*/
interface GetCanonicalURLHook {
/**
* Modify fully-qualified URLs used for IRC and e-mail
* notifications.
*
* @since 1.35
*
* @param ?mixed $title Title object of page
* @param ?mixed &$url string value as output (out parameter, can modify)
* @param ?mixed $query query options as string passed to Title::getCanonicalURL()
* @return bool|void True or no return value to continue or false to abort
*/
public function onGetCanonicalURL( $title, &$url, $query );
}

View file

@ -0,0 +1,20 @@
<?php
namespace MediaWiki\Hook;
/**
* @stable for implementation
* @ingroup Hooks
*/
interface GetDefaultSortkeyHook {
/**
* Override the default sortkey for a page.
*
* @since 1.35
*
* @param ?mixed $title Title object that we need to get a sortkey for
* @param ?mixed &$sortkey Sortkey to use.
* @return bool|void True or no return value to continue or false to abort
*/
public function onGetDefaultSortkey( $title, &$sortkey );
}

View file

@ -0,0 +1,20 @@
<?php
namespace MediaWiki\Hook;
/**
* @stable for implementation
* @ingroup Hooks
*/
interface GetDoubleUnderscoreIDsHook {
/**
* Modify the list of behavior switch (double
* underscore) magic words. Called by MagicWord.
*
* @since 1.35
*
* @param ?mixed &$doubleUnderscoreIDs array of strings
* @return bool|void True or no return value to continue or false to abort
*/
public function onGetDoubleUnderscoreIDs( &$doubleUnderscoreIDs );
}

View file

@ -0,0 +1,21 @@
<?php
namespace MediaWiki\Hook;
/**
* @stable for implementation
* @ingroup Hooks
*/
interface GetFullURLHook {
/**
* Modify fully-qualified URLs used in redirects/export/offsite data.
*
* @since 1.35
*
* @param ?mixed $title Title object of page
* @param ?mixed &$url string value as output (out parameter, can modify)
* @param ?mixed $query query options as string passed to Title::getFullURL()
* @return bool|void True or no return value to continue or false to abort
*/
public function onGetFullURL( $title, &$url, $query );
}

View file

@ -0,0 +1,19 @@
<?php
namespace MediaWiki\Hook;
/**
* @stable for implementation
* @ingroup Hooks
*/
interface GetIPHook {
/**
* modify the ip of the current user (called only once).
*
* @since 1.35
*
* @param ?mixed &$ip string holding the ip as determined so far
* @return bool|void True or no return value to continue or false to abort
*/
public function onGetIP( &$ip );
}

View file

@ -0,0 +1,21 @@
<?php
namespace MediaWiki\Hook;
/**
* @stable for implementation
* @ingroup Hooks
*/
interface GetInternalURLHook {
/**
* Modify fully-qualified URLs used for squid cache purging.
*
* @since 1.35
*
* @param ?mixed $title Title object of page
* @param ?mixed &$url string value as output (out parameter, can modify)
* @param ?mixed $query query options as string passed to Title::getInternalURL()
* @return bool|void True or no return value to continue or false to abort
*/
public function onGetInternalURL( $title, &$url, $query );
}

View file

@ -0,0 +1,25 @@
<?php
namespace MediaWiki\Hook;
/**
* @stable for implementation
* @ingroup Hooks
*/
interface GetLocalURLHook {
/**
* Modify local URLs as output into page links. Note that if you are
* working with internal urls (non-interwiki) then it may be preferable to work
* with the GetLocalURL::Internal or GetLocalURL::Article hooks as GetLocalURL can
* be buggy for internal urls on render if you do not re-implement the horrible
* hack that Title::getLocalURL uses in your own extension.
*
* @since 1.35
*
* @param ?mixed $title Title object of page
* @param ?mixed &$url string value as output (out parameter, can modify)
* @param ?mixed $query query options as string passed to Title::getLocalURL()
* @return bool|void True or no return value to continue or false to abort
*/
public function onGetLocalURL( $title, &$url, $query );
}

View file

@ -0,0 +1,22 @@
<?php
namespace MediaWiki\Hook;
// phpcs:disable Squiz.Classes.ValidClassName.NotCamelCaps
/**
* @stable for implementation
* @ingroup Hooks
*/
interface GetLocalURL__ArticleHook {
/**
* Modify local URLs specifically pointing to article paths
* without any fancy queries or variants.
*
* @since 1.35
*
* @param ?mixed $title Title object of page
* @param ?mixed &$url string value as output (out parameter, can modify)
* @return bool|void True or no return value to continue or false to abort
*/
public function onGetLocalURL__Article( $title, &$url );
}

View file

@ -0,0 +1,22 @@
<?php
namespace MediaWiki\Hook;
// phpcs:disable Squiz.Classes.ValidClassName.NotCamelCaps
/**
* @stable for implementation
* @ingroup Hooks
*/
interface GetLocalURL__InternalHook {
/**
* Modify local URLs to internal pages.
*
* @since 1.35
*
* @param ?mixed $title Title object of page
* @param ?mixed &$url string value as output (out parameter, can modify)
* @param ?mixed $query query options as string passed to Title::getLocalURL()
* @return bool|void True or no return value to continue or false to abort
*/
public function onGetLocalURL__Internal( $title, &$url, $query );
}

View file

@ -0,0 +1,28 @@
<?php
namespace MediaWiki\Hook;
/**
* @stable for implementation
* @ingroup Hooks
*/
interface GetRelativeTimestampHook {
/**
* Pre-emptively override the relative timestamp generated
* by MWTimestamp::getRelativeTimestamp(). Return false in this hook to use the
* custom output.
*
* @since 1.35
*
* @param ?mixed &$output string for the output timestamp
* @param ?mixed &$diff DateInterval representing the difference between the timestamps
* @param ?mixed $timestamp MWTimestamp object of the current (user-adjusted) timestamp
* @param ?mixed $relativeTo MWTimestamp object of the relative (user-adjusted) timestamp
* @param ?mixed $user User whose preferences are being used to make timestamp
* @param ?mixed $lang Language that will be used to render the timestamp
* @return bool|void True or no return value to continue or false to abort
*/
public function onGetRelativeTimestamp( &$output, &$diff, $timestamp,
$relativeTo, $user, $lang
);
}

View file

@ -0,0 +1,20 @@
<?php
namespace MediaWiki\Hook;
/**
* @stable for implementation
* @ingroup Hooks
*/
interface GitViewersHook {
/**
* Called when generating the list of git viewers for
* Special:Version, use this to change the list.
*
* @since 1.35
*
* @param ?mixed &$extTypes associative array of repo URLS to viewer URLs.
* @return bool|void True or no return value to continue or false to abort
*/
public function onGitViewers( &$extTypes );
}

View file

@ -0,0 +1,34 @@
<?php
namespace MediaWiki\Hook;
/**
* @stable for implementation
* @ingroup Hooks
*/
interface ImageBeforeProduceHTMLHook {
/**
* Called before producing the HTML created by a wiki
* image insertion. You can skip the default logic entirely by returning false, or
* just modify a few things using call-by-reference.
*
* @since 1.35
*
* @param ?mixed $skin Skin object
* @param ?mixed &$title Title object of the image
* @param ?mixed &$file File object, or false if it doesn't exist
* @param ?mixed &$frameParams Various parameters with special meanings; see documentation in
* includes/Linker.php for Linker::makeImageLink
* @param ?mixed &$handlerParams Various parameters with special meanings; see documentation in
* includes/Linker.php for Linker::makeImageLink
* @param ?mixed &$time Timestamp of file in 'YYYYMMDDHHIISS' string form, or false for current
* @param ?mixed &$res Final HTML output, used if you return false
* @param ?mixed $parser Parser instance
* @param ?mixed &$query Query params for desc URL
* @param ?mixed &$widthOption Used by the parser to remember the user preference thumbnailsize
* @return bool|void True or no return value to continue or false to abort
*/
public function onImageBeforeProduceHTML( $skin, &$title, &$file,
&$frameParams, &$handlerParams, &$time, &$res, $parser, &$query, &$widthOption
);
}

View file

@ -0,0 +1,29 @@
<?php
namespace MediaWiki\Hook;
/**
* @stable for implementation
* @ingroup Hooks
*/
interface ImgAuthBeforeStreamHook {
/**
* Executed before file is streamed to user, but only when
* using img_auth.php.
*
* @since 1.35
*
* @param ?mixed &$title the Title object of the file as it would appear for the upload page
* @param ?mixed &$path the original file and path name when img_auth was invoked by the web
* server
* @param ?mixed &$name the name only component of the file
* @param ?mixed &$result The location to pass back results of the hook routine (only used if
* failed)
* $result[0]=The index of the header message
* $result[1]=The index of the body text message
* $result[2 through n]=Parameters passed to body text message. Please note the
* header message cannot receive/use parameters.
* @return bool|void True or no return value to continue or false to abort
*/
public function onImgAuthBeforeStream( &$title, &$path, &$name, &$result );
}

View file

@ -0,0 +1,24 @@
<?php
namespace MediaWiki\Hook;
/**
* @stable for implementation
* @ingroup Hooks
*/
interface ImgAuthModifyHeadersHook {
/**
* Executed just before a file is streamed to a user via
* img_auth.php, allowing headers to be modified beforehand.
*
* @since 1.35
*
* @param ?mixed $title LinkTarget object
* @param ?mixed &$headers HTTP headers ( name => value, names are case insensitive ).
* Two headers get special handling: If-Modified-Since (value must be
* a valid HTTP date) and Range (must be of the form "bytes=(\d*-\d*)")
* will be honored when streaming the file.
* @return bool|void True or no return value to continue or false to abort
*/
public function onImgAuthModifyHeaders( $title, &$headers );
}

View file

@ -0,0 +1,21 @@
<?php
namespace MediaWiki\Hook;
/**
* @stable for implementation
* @ingroup Hooks
*/
interface ImportHandleUnknownUserHook {
/**
* When a user doesn't exist locally, this hook is
* called to give extensions an opportunity to auto-create it. If the auto-creation
* is successful, return false.
*
* @since 1.35
*
* @param ?mixed $name User name
* @return bool|void True or no return value to continue or false to abort
*/
public function onImportHandleUnknownUser( $name );
}

View file

@ -0,0 +1,25 @@
<?php
namespace MediaWiki\Hook;
/**
* @stable for implementation
* @ingroup Hooks
*/
interface InitializeArticleMaybeRedirectHook {
/**
* MediaWiki check to see if title is a redirect.
*
* @since 1.35
*
* @param ?mixed $title Title object for the current page
* @param ?mixed $request WebRequest
* @param ?mixed &$ignoreRedirect boolean to skip redirect check
* @param ?mixed &$target Title/string of redirect target
* @param ?mixed &$article Article object
* @return bool|void True or no return value to continue or false to abort
*/
public function onInitializeArticleMaybeRedirect( $title, $request,
&$ignoreRedirect, &$target, &$article
);
}

View file

@ -0,0 +1,20 @@
<?php
namespace MediaWiki\Hook;
/**
* @stable for implementation
* @ingroup Hooks
*/
interface IsTrustedProxyHook {
/**
* Override the result of ProxyLookup::isTrustedProxy()
*
* @since 1.35
*
* @param ?mixed $ip IP being check
* @param ?mixed &$result Change this value to override the result of ProxyLookup::isTrustedProxy()
* @return bool|void True or no return value to continue or false to abort
*/
public function onIsTrustedProxy( $ip, &$result );
}

View file

@ -0,0 +1,26 @@
<?php
namespace MediaWiki\Hook;
/**
* @stable for implementation
* @ingroup Hooks
*/
interface LanguageLinksHook {
/**
* Manipulate a page's language links. This is called
* in various places to allow extensions to define the effective language
* links for a page.
*
* @since 1.35
*
* @param ?mixed $title The page's Title.
* @param ?mixed &$links Array with elements of the form "language:title" in the order
* that they will be output.
* @param ?mixed &$linkFlags Associative array mapping prefixed links to arrays of flags.
* Currently unused, but planned to provide support for marking individual
* language links in the UI, e.g. for featured articles.
* @return bool|void True or no return value to continue or false to abort
*/
public function onLanguageLinks( $title, &$links, &$linkFlags );
}

View file

@ -0,0 +1,22 @@
<?php
namespace MediaWiki\Hook;
/**
* @stable for implementation
* @ingroup Hooks
*/
interface LinkerMakeExternalImageHook {
/**
* At the end of Linker::makeExternalImage() just
* before the return.
*
* @since 1.35
*
* @param ?mixed &$url the image url
* @param ?mixed &$alt the image's alt text
* @param ?mixed &$img the new image HTML (if returning false)
* @return bool|void True or no return value to continue or false to abort
*/
public function onLinkerMakeExternalImage( &$url, &$alt, &$img );
}

View file

@ -0,0 +1,26 @@
<?php
namespace MediaWiki\Hook;
/**
* @stable for implementation
* @ingroup Hooks
*/
interface LinkerMakeExternalLinkHook {
/**
* At the end of Linker::makeExternalLink() just
* before the return.
*
* @since 1.35
*
* @param ?mixed &$url the link url
* @param ?mixed &$text the link text
* @param ?mixed &$link the new link HTML (if returning false)
* @param ?mixed &$attribs the attributes to be applied.
* @param ?mixed $linkType The external link type
* @return bool|void True or no return value to continue or false to abort
*/
public function onLinkerMakeExternalLink( &$url, &$text, &$link, &$attribs,
$linkType
);
}

View file

@ -0,0 +1,26 @@
<?php
namespace MediaWiki\Hook;
/**
* @stable for implementation
* @ingroup Hooks
*/
interface LinkerMakeMediaLinkFileHook {
/**
* At the end of Linker::makeMediaLinkFile() just
* before the return.
*
* @since 1.35
*
* @param ?mixed $title the Title object that the link is pointing to
* @param ?mixed $file the File object or false if broken link
* @param ?mixed &$html the link text
* @param ?mixed &$attribs the attributes to be applied
* @param ?mixed &$ret the value to return if your hook returns false
* @return bool|void True or no return value to continue or false to abort
*/
public function onLinkerMakeMediaLinkFile( $title, $file, &$html, &$attribs,
&$ret
);
}

View file

@ -0,0 +1,21 @@
<?php
namespace MediaWiki\Hook;
/**
* @stable for implementation
* @ingroup Hooks
*/
interface LocalisationChecksBlacklistHook {
/**
* When fetching the blacklist of
* localisation checks.
*
* @since 1.35
*
* @param ?mixed &$blacklist array of checks to blacklist. See the bottom of
* maintenance/language/checkLanguage.inc for the format of this variable.
* @return bool|void True or no return value to continue or false to abort
*/
public function onLocalisationChecksBlacklist( &$blacklist );
}

View file

@ -0,0 +1,21 @@
<?php
namespace MediaWiki\Hook;
/**
* @stable for implementation
* @ingroup Hooks
*/
interface LocalisationIgnoredOptionalMessagesHook {
/**
* When fetching the list of ignored and
* optional localisation messages
*
* @since 1.35
*
* @param ?mixed &$ignored Array of ignored message keys
* @param ?mixed &$optional Array of optional message keys
* @return bool|void True or no return value to continue or false to abort
*/
public function onLocalisationIgnoredOptionalMessages( &$ignored, &$optional );
}

View file

@ -0,0 +1,19 @@
<?php
namespace MediaWiki\Hook;
/**
* @stable for implementation
* @ingroup Hooks
*/
interface MagicWordwgVariableIDsHook {
/**
* When defining new magic words IDs.
*
* @since 1.35
*
* @param ?mixed &$variableIDs array of strings
* @return bool|void True or no return value to continue or false to abort
*/
public function onMagicWordwgVariableIDs( &$variableIDs );
}

View file

@ -0,0 +1,20 @@
<?php
namespace MediaWiki\Hook;
/**
* @stable for implementation
* @ingroup Hooks
*/
interface MaintenanceRefreshLinksInitHook {
/**
* before executing the refreshLinks.php maintenance
* script.
*
* @since 1.35
*
* @param ?mixed $refreshLinks RefreshLinks object
* @return bool|void True or no return value to continue or false to abort
*/
public function onMaintenanceRefreshLinksInit( $refreshLinks );
}

View file

@ -0,0 +1,27 @@
<?php
namespace MediaWiki\Hook;
// phpcs:disable Generic.Files.LineLength -- Remove this after doc review
/**
* @stable for implementation
* @ingroup Hooks
*/
interface MaintenanceUpdateAddParamsHook {
/**
* allow extensions to add params to the update.php
* maintenance script.
*
* @since 1.35
*
* @param ?mixed &$params array to populate with the params to be added. Array elements are keyed by
* the param name. Each param is an associative array that must include the following keys:
* - desc The description of the param to show on --help
* - require Is the param required? Defaults to false if not set.
* - withArg Is an argument required with this option? Defaults to false if not set.
* - shortName Character to use as short name, or false if none. Defaults to false if not set.
* - multiOccurrence Can this option be passed multiple times? Defaults to false if not set.
* @return bool|void True or no return value to continue or false to abort
*/
public function onMaintenanceUpdateAddParams( &$params );
}

View file

@ -0,0 +1,24 @@
<?php
namespace MediaWiki\Hook;
/**
* @stable for implementation
* @ingroup Hooks
*/
interface MakeGlobalVariablesScriptHook {
/**
* Called at end of OutputPage::getJSVars.
* Ideally, this hook should only be used to add variables that depend on
* the current page/request; static configuration should be added through
* ResourceLoaderGetConfigVars instead.
*
* @since 1.35
*
* @param ?mixed &$vars variable (or multiple variables) to be added into the output of
* Skin::makeVariablesScript
* @param ?mixed $out The OutputPage which called the hook, can be used to get the real title.
* @return bool|void True or no return value to continue or false to abort
*/
public function onMakeGlobalVariablesScript( &$vars, $out );
}

View file

@ -0,0 +1,21 @@
<?php
namespace MediaWiki\Hook;
// phpcs:disable Squiz.Classes.ValidClassName.NotCamelCaps
/**
* @stable for implementation
* @ingroup Hooks
*/
interface MediaWikiPHPUnitTest__endTestHook {
/**
* After each PHPUnit test completes
*
* @since 1.35
*
* @param ?mixed $test PHPUnit\Framework\Test object
* @param ?mixed $time The execution time in seconds
* @return bool|void True or no return value to continue or false to abort
*/
public function onMediaWikiPHPUnitTest__endTest( $test, $time );
}

View file

@ -0,0 +1,20 @@
<?php
namespace MediaWiki\Hook;
// phpcs:disable Squiz.Classes.ValidClassName.NotCamelCaps
/**
* @stable for implementation
* @ingroup Hooks
*/
interface MediaWikiPHPUnitTest__startTestHook {
/**
* Before each PHPUnit test starts
*
* @since 1.35
*
* @param ?mixed $test PHPUnit\Framework\Test object
* @return bool|void True or no return value to continue or false to abort
*/
public function onMediaWikiPHPUnitTest__startTest( $test );
}

View file

@ -0,0 +1,28 @@
<?php
namespace MediaWiki\Hook;
/**
* @stable for implementation
* @ingroup Hooks
*/
interface MediaWikiPerformActionHook {
/**
* Override MediaWiki::performAction(). Use this to do
* something completely different, after the basic globals have been set up, but
* before ordinary actions take place.
*
* @since 1.35
*
* @param ?mixed $output Context output
* @param ?mixed $article Article on which the action will be performed
* @param ?mixed $title Title on which the action will be performed
* @param ?mixed $user Context user
* @param ?mixed $request Context request
* @param ?mixed $mediaWiki The $mediawiki object
* @return bool|void True or no return value to continue or false to abort
*/
public function onMediaWikiPerformAction( $output, $article, $title, $user,
$request, $mediaWiki
);
}

View file

@ -0,0 +1,22 @@
<?php
namespace MediaWiki\Hook;
/**
* @stable for implementation
* @ingroup Hooks
*/
interface MediaWikiServicesHook {
/**
* Called when a global MediaWikiServices instance is
* initialized. Extensions may use this to define, replace, or wrap services.
* However, the preferred way to define a new service is
* the $wgServiceWiringFiles array.
*
* @since 1.35
*
* @param ?mixed $services MediaWikiServices
* @return bool|void True or no return value to continue or false to abort
*/
public function onMediaWikiServices( $services );
}

View file

@ -0,0 +1,26 @@
<?php
namespace MediaWiki\Hook;
/**
* @stable for implementation
* @ingroup Hooks
*/
interface MimeMagicGuessFromContentHook {
/**
* Allows MW extensions guess the MIME by content.
*
* @since 1.35
*
* @param ?mixed $mimeMagic Instance of MimeAnalyzer.
* @param ?mixed &$head First 1024 bytes of the file in a string (in - Do not alter!).
* @param ?mixed &$tail More or equal than last 65558 bytes of the file in a string
* (in - Do not alter!).
* @param ?mixed $file File path.
* @param ?mixed &$mime MIME type (out).
* @return bool|void True or no return value to continue or false to abort
*/
public function onMimeMagicGuessFromContent( $mimeMagic, &$head, &$tail, $file,
&$mime
);
}

View file

@ -0,0 +1,22 @@
<?php
namespace MediaWiki\Hook;
/**
* @stable for implementation
* @ingroup Hooks
*/
interface MimeMagicImproveFromExtensionHook {
/**
* Allows MW extensions to further improve the
* MIME type detected by considering the file extension.
*
* @since 1.35
*
* @param ?mixed $mimeMagic Instance of MimeAnalyzer.
* @param ?mixed $ext File extension.
* @param ?mixed &$mime MIME type (in/out).
* @return bool|void True or no return value to continue or false to abort
*/
public function onMimeMagicImproveFromExtension( $mimeMagic, $ext, &$mime );
}

View file

@ -0,0 +1,26 @@
<?php
namespace MediaWiki\Hook;
/**
* @stable for implementation
* @ingroup Hooks
*/
interface MimeMagicInitHook {
/**
* Before processing the list mapping MIME types to media types
* and the list mapping MIME types to file extensions.
* As an extension author, you are encouraged to submit patches to MediaWiki's
* core to add new MIME types to mime.types.
*
* @since 1.35
*
* @param ?mixed $mimeMagic Instance of MimeAnalyzer.
* Use $mimeMagic->addExtraInfo( $stringOfInfo );
* for adding new MIME info to the list.
* Use $mimeMagic->addExtraTypes( $stringOfTypes );
* for adding new MIME types to the list.
* @return bool|void True or no return value to continue or false to abort
*/
public function onMimeMagicInit( $mimeMagic );
}

View file

@ -0,0 +1,26 @@
<?php
namespace MediaWiki\Hook;
/**
* @stable for implementation
* @ingroup Hooks
*/
interface MovePageCheckPermissionsHook {
/**
* Specify whether the user is allowed to move the
* page.
*
* @since 1.35
*
* @param ?mixed $oldTitle Title object of the current (old) location
* @param ?mixed $newTitle Title object of the new location
* @param ?mixed $user User making the move
* @param ?mixed $reason string of the reason provided by the user
* @param ?mixed $status Status object to pass error messages to
* @return bool|void True or no return value to continue or false to abort
*/
public function onMovePageCheckPermissions( $oldTitle, $newTitle, $user,
$reason, $status
);
}

View file

@ -0,0 +1,22 @@
<?php
namespace MediaWiki\Hook;
/**
* @stable for implementation
* @ingroup Hooks
*/
interface MovePageIsValidMoveHook {
/**
* Specify whether a page can be moved for technical
* reasons.
*
* @since 1.35
*
* @param ?mixed $oldTitle Title object of the current (old) location
* @param ?mixed $newTitle Title object of the new location
* @param ?mixed $status Status object to pass error messages to
* @return bool|void True or no return value to continue or false to abort
*/
public function onMovePageIsValidMove( $oldTitle, $newTitle, $status );
}

View file

@ -0,0 +1,20 @@
<?php
namespace MediaWiki\Hook;
/**
* @stable for implementation
* @ingroup Hooks
*/
interface OpenSearchUrlsHook {
/**
* Called when constructing the OpenSearch description XML. Hooks
* can alter or append to the array of URLs for search & suggestion formats.
*
* @since 1.35
*
* @param ?mixed &$urls array of associative arrays with Url element attributes
* @return bool|void True or no return value to continue or false to abort
*/
public function onOpenSearchUrls( &$urls );
}

View file

@ -0,0 +1,22 @@
<?php
namespace MediaWiki\Hook;
/**
* @stable for implementation
* @ingroup Hooks
*/
interface OutputPageAfterGetHeadLinksArrayHook {
/**
* Called in OutputPage#getHeadLinksArray right
* before returning the result.
*
* @since 1.35
*
* @param ?mixed &$tags array containing all <head> links generated so far. The array format is
* "link name or number => 'link HTML'".
* @param ?mixed $out the OutputPage object
* @return bool|void True or no return value to continue or false to abort
*/
public function onOutputPageAfterGetHeadLinksArray( &$tags, $out );
}

View file

@ -0,0 +1,21 @@
<?php
namespace MediaWiki\Hook;
/**
* @stable for implementation
* @ingroup Hooks
*/
interface OutputPageBeforeHTMLHook {
/**
* A page has been processed by the parser and the
* resulting HTML is about to be displayed.
*
* @since 1.35
*
* @param ?mixed $out the OutputPage (object) that corresponds to the page
* @param ?mixed &$text the text that will be displayed, in HTML (string)
* @return bool|void This hook must not abort, it must return true or null.
*/
public function onOutputPageBeforeHTML( $out, &$text );
}

View file

@ -0,0 +1,24 @@
<?php
namespace MediaWiki\Hook;
/**
* @stable for implementation
* @ingroup Hooks
*/
interface OutputPageBodyAttributesHook {
/**
* Called when OutputPage::headElement is creating the
* body tag to allow for extensions to add attributes to the body of the page they
* might need. Or to allow building extensions to add body classes that aren't of
* high enough demand to be included in core.
*
* @since 1.35
*
* @param ?mixed $out The OutputPage which called the hook, can be used to get the real title
* @param ?mixed $sk The Skin that called OutputPage::headElement
* @param ?mixed &$bodyAttrs An array of attributes for the body tag passed to Html::openElement
* @return bool|void True or no return value to continue or false to abort
*/
public function onOutputPageBodyAttributes( $out, $sk, &$bodyAttrs );
}

View file

@ -0,0 +1,22 @@
<?php
namespace MediaWiki\Hook;
/**
* @stable for implementation
* @ingroup Hooks
*/
interface OutputPageCheckLastModifiedHook {
/**
* when checking if the page has been modified
* since the last visit.
*
* @since 1.35
*
* @param ?mixed &$modifiedTimes array of timestamps.
* The following keys are set: page, user, epoch
* @param ?mixed $out OutputPage object (since 1.28)
* @return bool|void True or no return value to continue or false to abort
*/
public function onOutputPageCheckLastModified( &$modifiedTimes, $out );
}

View file

@ -0,0 +1,25 @@
<?php
namespace MediaWiki\Hook;
/**
* @stable for implementation
* @ingroup Hooks
*/
interface OutputPageMakeCategoryLinksHook {
/**
* Links are about to be generated for the page's
* categories. Implementations should return false if they generate the category
* links, so the default link generation is skipped.
*
* @since 1.35
*
* @param ?mixed $out OutputPage instance (object)
* @param ?mixed $categories associative array, keys are category names, values are category
* types ("normal" or "hidden")
* @param ?mixed &$links array, intended to hold the result. Must be an associative array with
* category types as keys and arrays of HTML links as values.
* @return bool|void True or no return value to continue or false to abort
*/
public function onOutputPageMakeCategoryLinks( $out, $categories, &$links );
}

View file

@ -0,0 +1,20 @@
<?php
namespace MediaWiki\Hook;
/**
* @stable for implementation
* @ingroup Hooks
*/
interface OutputPageParserOutputHook {
/**
* after adding a parserOutput to $wgOut
*
* @since 1.35
*
* @param ?mixed $out OutputPage instance (object)
* @param ?mixed $parserOutput parserOutput instance being added in $out
* @return bool|void This hook must not abort, it must return true or null.
*/
public function onOutputPageParserOutput( $out, $parserOutput );
}

View file

@ -0,0 +1,20 @@
<?php
namespace MediaWiki\Hook;
/**
* @stable for implementation
* @ingroup Hooks
*/
interface ParserTestGlobalsHook {
/**
* Allows to define globals for parser tests.
*
* @since 1.35
*
* @param ?mixed &$globals Array with all the globals which should be set for parser tests.
* The arrays keys serve as the globals names, its values are the globals values.
* @return bool|void True or no return value to continue or false to abort
*/
public function onParserTestGlobals( &$globals );
}

View file

@ -0,0 +1,21 @@
<?php
namespace MediaWiki\Hook;
/**
* @stable for implementation
* @ingroup Hooks
*/
interface ParserTestTablesHook {
/**
* Alter the list of tables to duplicate when parser tests are
* run. Use when page save hooks require the presence of custom tables to ensure
* that tests continue to run properly.
*
* @since 1.35
*
* @param ?mixed &$tables array of table names
* @return bool|void True or no return value to continue or false to abort
*/
public function onParserTestTables( &$tables );
}

View file

@ -0,0 +1,22 @@
<?php
namespace MediaWiki\Hook;
// phpcs:disable Squiz.Classes.ValidClassName.NotCamelCaps
/**
* @stable for implementation
* @ingroup Hooks
*/
interface ProtectionForm__buildFormHook {
/**
* Called after all protection type fieldsets are made
* in the form.
*
* @since 1.35
*
* @param ?mixed $article the title being (un)protected
* @param ?mixed &$output a string of the form HTML so far
* @return bool|void True or no return value to continue or false to abort
*/
public function onProtectionForm__buildForm( $article, &$output );
}

View file

@ -0,0 +1,23 @@
<?php
namespace MediaWiki\Hook;
// phpcs:disable Squiz.Classes.ValidClassName.NotCamelCaps
/**
* @stable for implementation
* @ingroup Hooks
*/
interface ProtectionForm__saveHook {
/**
* Called when a protection form is submitted.
*
* @since 1.35
*
* @param ?mixed $article the Page being (un)protected
* @param ?mixed &$errorMsg an html message string of an error or an array of message name and
* its parameters
* @param ?mixed $reasonstr a string describing the reason page protection level is altered
* @return bool|void True or no return value to continue or false to abort
*/
public function onProtectionForm__save( $article, &$errorMsg, $reasonstr );
}

View file

@ -0,0 +1,22 @@
<?php
namespace MediaWiki\Hook;
// phpcs:disable Squiz.Classes.ValidClassName.NotCamelCaps
/**
* @stable for implementation
* @ingroup Hooks
*/
interface ProtectionForm__showLogExtractHook {
/**
* Called after the protection log extract is
* shown.
*
* @since 1.35
*
* @param ?mixed $article the page the form is shown for
* @param ?mixed $out OutputPage object
* @return bool|void True or no return value to continue or false to abort
*/
public function onProtectionForm__showLogExtract( $article, $out );
}

View file

@ -0,0 +1,21 @@
<?php
namespace MediaWiki\Hook;
/**
* @stable for implementation
* @ingroup Hooks
*/
interface ResourceLoaderRegisterModulesHook {
/**
* Right before modules information is required,
* such as when responding to a resource
* loader request or generating HTML output.
*
* @since 1.35
*
* @param ?mixed $resourceLoader ResourceLoader object
* @return bool|void True or no return value to continue or false to abort
*/
public function onResourceLoaderRegisterModules( $resourceLoader );
}

View file

@ -0,0 +1,24 @@
<?php
namespace MediaWiki\Hook;
/**
* @stable for implementation
* @ingroup Hooks
*/
interface SelfLinkBeginHook {
/**
* Called before a link to the current article is displayed to
* allow the display of the link to be customized.
*
* @since 1.35
*
* @param ?mixed $nt the Title object
* @param ?mixed &$html html to display for the link
* @param ?mixed &$trail optional text to display before $html
* @param ?mixed &$prefix optional text to display after $html
* @param ?mixed &$ret the value to return if your hook returns false
* @return bool|void True or no return value to continue or false to abort
*/
public function onSelfLinkBegin( $nt, &$html, &$trail, &$prefix, &$ret );
}

View file

@ -0,0 +1,17 @@
<?php
namespace MediaWiki\Hook;
/**
* @stable for implementation
* @ingroup Hooks
*/
interface SetupAfterCacheHook {
/**
* Called in Setup.php, after cache objects are set
*
* @since 1.35
* @return bool|void True or no return value to continue or false to abort
*/
public function onSetupAfterCache();
}

View file

@ -0,0 +1,24 @@
<?php
namespace MediaWiki\Hook;
/**
* @stable for implementation
* @ingroup Hooks
*/
interface TestCanonicalRedirectHook {
/**
* Called when about to force a redirect to a canonical
* URL for a title when we have no other parameters on the URL. Gives a chance for
* extensions that alter page view behavior radically to abort that redirect or
* handle it manually.
*
* @since 1.35
*
* @param ?mixed $request WebRequest
* @param ?mixed $title Title of the currently found title obj
* @param ?mixed $output OutputPage object
* @return bool|void True or no return value to continue or false to abort
*/
public function onTestCanonicalRedirect( $request, $title, $output );
}

View file

@ -0,0 +1,21 @@
<?php
namespace MediaWiki\Hook;
/**
* @stable for implementation
* @ingroup Hooks
*/
interface TitleArrayFromResultHook {
/**
* Called when creating an TitleArray object from a
* database result.
*
* @since 1.35
*
* @param ?mixed &$titleArray set this to an object to override the default object returned
* @param ?mixed $res database result used to create the object
* @return bool|void True or no return value to continue or false to abort
*/
public function onTitleArrayFromResult( &$titleArray, $res );
}

View file

@ -0,0 +1,20 @@
<?php
namespace MediaWiki\Hook;
/**
* @stable for implementation
* @ingroup Hooks
*/
interface TitleExistsHook {
/**
* Called when determining whether a page exists at a given title.
*
* @since 1.35
*
* @param ?mixed $title The title being tested.
* @param ?mixed &$exists Whether the title exists.
* @return bool|void True or no return value to continue or false to abort
*/
public function onTitleExists( $title, &$exists );
}

View file

@ -0,0 +1,22 @@
<?php
namespace MediaWiki\Hook;
/**
* @stable for implementation
* @ingroup Hooks
*/
interface TitleGetEditNoticesHook {
/**
* Allows extensions to add edit notices
*
* @since 1.35
*
* @param ?mixed $title The Title object for the page the edit notices are for
* @param ?mixed $oldid Revision ID that the edit notices are for (or 0 for latest)
* @param ?mixed &$notices Array of notices. Keys are i18n message keys, values are
* parseAsBlock()ed messages.
* @return bool|void True or no return value to continue or false to abort
*/
public function onTitleGetEditNotices( $title, $oldid, &$notices );
}

Some files were not shown because too many files have changed in this diff Show more