MediaWiki
master
|
Static Public Member Functions | |
static | clear ( $name) |
Clears hooks registered via Hooks::register(). More... | |
static | getHandlers ( $name) |
Returns an array of all the event functions attached to a hook This combines functions registered via Hooks::register and with $wgHooks. More... | |
static | isRegistered ( $name) |
Returns true if a hook has a function registered to it. More... | |
static | register ( $name, $callback) |
Attach an event handler to a given hook in both legacy and non-legacy hook systems. More... | |
static | run ( $event, array $args=[], $deprecatedVersion=null) |
Call hook functions defined in Hooks::register and $wgHooks. More... | |
static | runner () |
Get a HookRunner instance for calling hooks using the new interfaces. More... | |
static | runWithoutAbort ( $event, array $args=[], $deprecatedVersion=null) |
Call hook functions defined in Hooks::register and $wgHooks. More... | |
|
static |
Clears hooks registered via Hooks::register().
Does not touch $wgHooks. This is intended for use while testing and will fail if MW_PHPUNIT_TEST is not defined.
string | $name | The name of the hook to clear. |
Definition at line 69 of file Hooks.php.
References wfDeprecated().
|
static |
Returns an array of all the event functions attached to a hook This combines functions registered via Hooks::register and with $wgHooks.
string | $name | Name of the hook |
|
static |
Returns true if a hook has a function registered to it.
The function may have been registered either via Hooks::register or in $wgHooks.
string | $name | Name of hook |
Definition at line 87 of file Hooks.php.
Referenced by WebRequest\getIP().
|
static |
Attach an event handler to a given hook in both legacy and non-legacy hook systems.
string | $name | Name of hook |
callable | $callback | Callback function to attach |
Definition at line 48 of file Hooks.php.
References wfDeprecatedMsg().
Referenced by BenchmarkParse\execute().
|
static |
Call hook functions defined in Hooks::register and $wgHooks.
For the given hook event, fetch the array of hook events and process them. Determine the proper callback for each hook and then call the actual hook using the appropriate arguments. Finally, process the return value and return/throw accordingly.
For hook event that are not abortable through a handler's return value, use runWithoutAbort() instead.
string | $event | Event name |
array | $args | Array of parameters passed to hook functions |
string | null | $deprecatedVersion | [optional] Mark hook as deprecated with version number |
Exception |
Definition at line 133 of file Hooks.php.
Referenced by BenchmarkHooks\execute().
|
static |
Get a HookRunner instance for calling hooks using the new interfaces.
Classes using dependency injection should instead receive a HookContainer and construct a private HookRunner from it.
Classes without dependency injection may alternatively use ProtectedHookAccessorTrait, a trait which provides getHookRunner() as a protected method.
Definition at line 172 of file Hooks.php.
Referenced by LogEventsList\__construct(), GitInfo\__construct(), EmailNotification\actuallyNotifyOnPageChange(), ExternalUserNames\applyPrefix(), ChangeTags\canAddTagsAccompanyingChange(), ChangeTags\canCreateTag(), ChangeTags\canDeleteTag(), AbstractContent\convert(), UploadBase\createFromRequest(), ChangeTags\deleteTagEverywhere(), MediaWiki\Block\DatabaseBlock\doAutoblock(), RecentChange\doMarkPatrolled(), TransformationalImageHandler\doTransform(), MWEval\execute(), MediaWikiShell\execute(), MediaWiki\Linker\Linker\generateRollback(), LegacyLogFormatter\getActionLinks(), MediaWiki\Title\Title\getCanonicalURL(), MediaWiki\Title\Title\getCategorySortkey(), MediaWiki\EditPage\EditPage\getCopyrightWarning(), MediaWiki\Title\Title\getEditNotices(), MediaWiki\EditPage\EditPage\getEditToolbar(), SpecialVersion\getExtensionTypes(), MediaWiki\Title\Title\getFullURL(), SpecialUpload\getInitialPageText(), MediaWiki\Title\Title\getInternalURL(), WebRequest\getIP(), IRCColourfulRCFeedFormatter\getLine(), MediaWiki\Title\Title\getLocalURL(), SpecialLog\getLogTypesOnUser(), MediaHandler\getMetadataVersion(), QueryPage\getPages(), ContentHandler\getParserOutput(), AbstractContent\getParserOutput(), WebRequest\getPathInfo(), MediaWiki\Mail\EmailUser\getPermissionsError(), UserPasswordPolicy\getPoliciesForUser(), LanguageConverter\getPreferredVariant(), MediaWiki\EditPage\EditPage\getPreviewLimitReport(), MWTimestamp\getRelativeTimestamp(), RequestContext\getSkin(), ParserOutput\getText(), LoginHelper\getValidErrorMessages(), initFromTitle(), UploadFromUrl\isAllowedUrl(), MediaWiki\Title\Title\isAlwaysKnown(), TransformationalImageHandler\isImageAreaOkForThumbnaling(), MediaWiki\Title\Title\isMovable(), MWExceptionHandler\logException(), MediaWiki\Linker\Linker\makeExternalImage(), MediaWiki\Linker\Linker\makeExternalLink(), MediaWiki\Linker\Linker\makeImageLink(), MediaWiki\Linker\Linker\makeMediaLinkFile(), MediaWiki\Linker\Linker\makeSelfLinkObj(), ChangesList\newFromContext(), UserArray\newFromResult(), ParserOptions\optionsHash(), SearchEngine\parseNamespacePrefixes(), ManualLogEntry\publish(), RecentChangesUpdateJob\purgeExpiredRows(), WikitextContent\replaceSection(), RecentChange\save(), PrefixSearch\searchBackend(), UserMailer\send(), UserMailer\sendInternal(), GuzzleHttp\Psr7\Request\WebResponse\setCookie(), LogEventsList\showLogExtract(), Parser\statelessFetchTemplate(), MediaWiki\Mail\EmailUser\submit(), ThumbnailImage\toHtml(), TraditionalImageGallery\toHTML(), ChangeTags\updateTags(), HTMLFileCache\useFileCache(), MediaWiki\Linker\Linker\userToolLinks(), Sanitizer\validateEmail(), Article\view(), wfApiMain(), wfImageAuthMain(), wfOpenSearchDescMain(), and wfShellWikiCmd().
|
static |
Call hook functions defined in Hooks::register and $wgHooks.
string | $event | Event name |
array | $args | Array of parameters passed to hook functions |
string | null | $deprecatedVersion | [optional] Mark hook as deprecated with version number |
UnexpectedValueException | callback returns an invalid value |