Wikibase
MediaWiki Wikibase extension
|
File defining the hook handlers for the Wikibase extension. More...
Static Public Member Functions | |
static | onBeforePageDisplay (OutputPage $out, Skin $skin) |
Handler for the BeforePageDisplay hook, simply injects wikibase.ui.entitysearch module replacing the native search box with the entity selector widget. More... | |
static | onBeforePageDisplayMobile (OutputPage $out, Skin $skin) |
Handler for the BeforePageDisplayMobile hook that adds the wikibase mobile styles. More... | |
static | onSetupAfterCache () |
Handler for the SetupAfterCache hook, completing the content and namespace setup. More... | |
static | registerUnitTests (array &$paths) |
Hook to add PHPUnit test cases. More... | |
static | onNamespaceIsMovable ( $ns, &$movable) |
Handler for the NamespaceIsMovable hook. More... | |
static | onRevisionFromEditComplete (WikiPage $wikiPage, RevisionRecord $revisionRecord, $baseID, UserIdentity $user) |
Called when a revision was inserted due to an edit. More... | |
static | onArticleUndelete (Title $title, $created, $comment) |
Handle changes for undeletions. More... | |
static | onGetPreferences (User $user, array &$preferences) |
Allows to add user preferences. More... | |
static | onUserGetDefaultOptions (array &$defaultOptions) |
Called after fetching the core default user options. More... | |
static | onPageHistoryLineEnding (HistoryPager $history, $row, &$html, array $classes) |
Modify line endings on history page. More... | |
static | onSkinTemplateNavigationUniversal (SkinTemplate $skinTemplate, array &$links) |
Alter the structured navigation links in SkinTemplates. More... | |
static | onSpecialPageReorderPages (&$groups, $moveOther) |
Reorder the groups for the special pages. More... | |
static | onOutputPageBodyAttributes (OutputPage $out, Skin $skin, array &$bodyAttrs) |
Used to append a css class to the body, so the page can be identified as Wikibase item page. More... | |
static | onTitleGetRestrictionTypes (Title $title, array &$types) |
Handler for the TitleGetRestrictionTypes hook. More... | |
static | onAbuseFilterContentToString (Content $content, &$text) |
Hook handler for AbuseFilter's AbuseFilter-contentToString hook, implemented to provide a custom text representation of Entities for filtering. More... | |
static | onFormat (&$comment, $pre, $auto, $post, $title, $local) |
Handler for the FormatAutocomments hook, implementing localized formatting for machine readable autocomments generated by SummaryFormatter. More... | |
static | onOutputPageParserOutput (OutputPage $out, ParserOutput $parserOutput) |
Called when pushing meta-info from the ParserOutput into OutputPage. More... | |
static | onContentModelCanBeUsedOn ( $contentModel, LinkTarget $title, &$ok) |
Handler for the ContentModelCanBeUsedOn hook, used to prevent pages of inappropriate type to be placed in an entity namespace. More... | |
static | onAPIQuerySiteInfoGeneralInfo (ApiQuerySiteinfo $api, array &$data) |
Exposes configuration values to the action=query&meta=siteinfo API, including lists of property and data value types, sparql endpoint, and several base URLs and URIs. More... | |
static | onAPIQuerySiteInfoStatisticsInfo (array &$data) |
Adds DispatchStats info to the API. More... | |
static | onImportHandleRevisionXMLTag ( $importer, $pageInfo, $revisionInfo) |
Called by Import.php. More... | |
static | onSidebarBeforeOutput (Skin $skin, array &$sidebar) |
Add Concept URI link to the toolbox section of the sidebar. More... | |
static | onResourceLoaderRegisterModules (ResourceLoader $resourceLoader) |
Register ResourceLoader modules with dynamic dependencies. More... | |
static | onInfoAction (IContextSource $context, array &$pageInfo) |
Adds the Wikis using the entity in action=info. More... | |
static | onApiMaxLagInfo (array &$lagInfo) |
Handler for the ApiMaxLagInfo to add dispatching lag stats. More... | |
static | onParserOptionsRegister (&$defaults, &$inCacheKey, &$lazyOptions) |
Handler for the ParserOptionsRegister hook to add a "wb" option for cache-splitting. More... | |
static | onRejectParserCacheValue (ParserOutput $parserValue, WikiPage $wikiPage, ParserOptions $parserOpts) |
static | onApiQueryModuleManager (ApiModuleManager $moduleManager) |
static | onParserFirstCallInit (Parser $parser) |
Register the parser functions. More... | |
static | onRegistration () |
static | inheritDefaultRateLimits (array &$rateLimits) |
Make the 'wikibase-idgenerator' rate limit inherit the 'create' rate limit, or the 'edit' rate limit if no 'create' limit is defined, unless the 'wikibase-idgenerator' rate limit was itself customized. More... | |
static | onApiMainOnException ( $apiMain, $e) |
Attempt to create an entity locks an entity id (for items, it would be Q####) and if saving fails due to validation issues for example, that id would be wasted. More... | |
Static Private Member Functions | |
static | isNamespaceUsedByLocalEntities ( $namespace) |
static | notifyEntityStoreWatcherOnUpdate (EntityContent $content, RevisionRecord $revision) |
static | formatDispatchRow ( $row) |
Helper for onAPIQuerySiteInfoStatisticsInfo. More... | |
File defining the hook handlers for the Wikibase extension.
|
staticprivate |
Helper for onAPIQuerySiteInfoStatisticsInfo.
object | $row |
|
static |
Make the 'wikibase-idgenerator' rate limit inherit the 'create' rate limit, or the 'edit' rate limit if no 'create' limit is defined, unless the 'wikibase-idgenerator' rate limit was itself customized.
array | $rateLimits | should be $wgRateLimits or a similar array |
|
staticprivate |
|
staticprivate |
|
static |
Hook handler for AbuseFilter's AbuseFilter-contentToString hook, implemented to provide a custom text representation of Entities for filtering.
Content | $content | |
string | &$text | The resulting text |
|
static |
Attempt to create an entity locks an entity id (for items, it would be Q####) and if saving fails due to validation issues for example, that id would be wasted.
We want to penalize the user by adding a bigger number to ratelimit and slow them down to avoid bots wasting significant number of Q-ids by sending faulty data over and over again. See T284538 for more information.
ApiMain | $apiMain | |
Throwable | $e |
MWException |
|
static |
Handler for the ApiMaxLagInfo to add dispatching lag stats.
array | &$lagInfo |
|
static |
|
static |
Exposes configuration values to the action=query&meta=siteinfo API, including lists of property and data value types, sparql endpoint, and several base URLs and URIs.
ApiQuerySiteinfo | $api | |
array | &$data |
|
static |
Adds DispatchStats info to the API.
array[] | &$data |
|
static |
Handle changes for undeletions.
Title | $title | |
bool | $created | |
string | $comment |
|
static |
Handler for the BeforePageDisplay hook, simply injects wikibase.ui.entitysearch module replacing the native search box with the entity selector widget.
It additionally schedules a WikibasePingback
OutputPage | $out | |
Skin | $skin |
|
static |
Handler for the BeforePageDisplayMobile hook that adds the wikibase mobile styles.
OutputPage | $out | |
Skin | $skin |
|
static |
Handler for the ContentModelCanBeUsedOn hook, used to prevent pages of inappropriate type to be placed in an entity namespace.
string | $contentModel | |
LinkTarget | $title | Actually a Title object, but we only require getNamespace |
bool | &$ok |
|
static |
Handler for the FormatAutocomments hook, implementing localized formatting for machine readable autocomments generated by SummaryFormatter.
string | &$comment | reference to the autocomment text |
bool | $pre | true if there is content before the autocomment |
string | $auto | the autocomment unformatted |
bool | $post | true if there is content after the autocomment |
Title | null | $title | use for further information |
bool | $local | shall links be generated locally or globally |
|
static |
Allows to add user preferences.
NOTE: Might make sense to put the inner functionality into a well structured Preferences file once this becomes more.
User | $user | |
array[] | &$preferences |
|
static |
Called by Import.php.
Implemented to prevent the import of entities.
object | $importer | unclear, see Bug T66657 |
array | $pageInfo | |
array | $revisionInfo |
MWException |
|
static |
Adds the Wikis using the entity in action=info.
IContextSource | $context | |
array[] | &$pageInfo |
|
static |
Handler for the NamespaceIsMovable hook.
Implemented to prevent moving pages that are in an entity namespace.
int | $ns | Namespace ID |
bool | &$movable |
|
static |
Used to append a css class to the body, so the page can be identified as Wikibase item page.
OutputPage | $out | |
Skin | $skin | |
array | &$bodyAttrs |
|
static |
Called when pushing meta-info from the ParserOutput into OutputPage.
Used to transfer 'wikibase-view-chunks' and entity data from ParserOutput to OutputPage.
OutputPage | $out | |
ParserOutput | $parserOutput |
|
static |
Modify line endings on history page.
HistoryPager | $history | |
object | $row | |
string | &$html | |
array | $classes |
|
static |
Register the parser functions.
Parser | $parser |
|
static |
Handler for the ParserOptionsRegister hook to add a "wb" option for cache-splitting.
This registers a lazy-loaded parser option with its value being the EntityHandler parser version. Non-Wikibase parses will ignore this option, while Wikibase parses will trigger its loading via ParserOutput::recordOption() and thereby include it in the cache key to fragment the cache by EntityHandler::PARSER_VERSION.
array | &$defaults | Options and their defaults |
array | &$inCacheKey | Whether each option splits the parser cache |
array | &$lazyOptions | Initializers for lazy-loaded options |
|
static |
|
static |
|
static |
Register ResourceLoader modules with dynamic dependencies.
ResourceLoader | $resourceLoader |
|
static |
Called when a revision was inserted due to an edit.
WikiPage | $wikiPage | |
RevisionRecord | $revisionRecord | |
int | $baseID | |
UserIdentity | $user |
|
static |
Handler for the SetupAfterCache hook, completing the content and namespace setup.
This updates the $wgContentHandlers and $wgNamespaceContentModels registries according to information provided by entity type definitions and the entityNamespaces setting for the local entity source.
MWException |
|
static |
Add Concept URI link to the toolbox section of the sidebar.
Skin | $skin | |
string[] | &$sidebar |
|
static |
Alter the structured navigation links in SkinTemplates.
SkinTemplate | $skinTemplate | |
array[] | &$links |
|
static |
Reorder the groups for the special pages.
array | &$groups | |
bool | $moveOther |
|
static |
Handler for the TitleGetRestrictionTypes hook.
Implemented to prevent people from protecting pages from being created or moved in an entity namespace (which is pointless).
Title | $title | |
string[] | &$types | The types of protection available |
|
static |
Called after fetching the core default user options.
array | &$defaultOptions |
|
static |
Hook to add PHPUnit test cases.
string[] | &$paths |