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. | |
static | onBeforePageDisplayMobile (OutputPage $out, Skin $skin) |
Handler for the BeforePageDisplayMobile hook that adds the wikibase mobile styles. | |
static | onSetupAfterCache () |
Handler for the SetupAfterCache hook, completing the content and namespace setup. | |
static | registerUnitTests (array &$paths) |
Hook to add PHPUnit test cases. | |
static | onNamespaceIsMovable ( $ns, &$movable) |
Handler for the NamespaceIsMovable hook. | |
static | onRevisionFromEditComplete (WikiPage $wikiPage, RevisionRecord $revisionRecord, $baseID, UserIdentity $user) |
Called when a revision was inserted due to an edit. | |
static | onArticleUndelete (Title $title, $created, $comment) |
Handle changes for undeletions. | |
static | onGetPreferences (User $user, array &$preferences) |
Allows to add user preferences. | |
static | onUserGetDefaultOptions (array &$defaultOptions) |
Called after fetching the core default user options. | |
static | onPageHistoryLineEnding (HistoryPager $history, $row, &$html, array $classes) |
Modify line endings on history page. | |
static | onSkinTemplateNavigationUniversal (SkinTemplate $skinTemplate, array &$links) |
Alter the structured navigation links in SkinTemplates. | |
static | onSpecialPageReorderPages (&$groups, $moveOther) |
Reorder the groups for the special pages. | |
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. | |
static | onTitleGetRestrictionTypes (Title $title, array &$types) |
Handler for the TitleGetRestrictionTypes hook. | |
static | onAbuseFilterContentToString (Content $content, &$text) |
Hook handler for AbuseFilter's AbuseFilter-contentToString hook, implemented to provide a custom text representation of Entities for filtering. | |
static | onFormat (&$comment, $pre, $auto, $post, $title, $local) |
Handler for the FormatAutocomments hook, implementing localized formatting for machine readable autocomments generated by SummaryFormatter. | |
static | onOutputPageParserOutput (OutputPage $outputPage, ParserOutput $parserOutput) |
Called when pushing meta-info from the ParserOutput into OutputPage. | |
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. | |
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. | |
static | onImportHandleRevisionXMLTag ( $importer, $pageInfo, $revisionInfo) |
Called by Import.php. | |
static | onSidebarBeforeOutput (Skin $skin, array &$sidebar) |
Add Concept URI link to the toolbox section of the sidebar. | |
static | onResourceLoaderRegisterModules (ResourceLoader $resourceLoader) |
Register ResourceLoader modules with dynamic dependencies. | |
static | onInfoAction (IContextSource $context, array &$pageInfo) |
Adds the Wikis using the entity in action=info. | |
static | onParserOptionsRegister (&$defaults, &$inCacheKey, &$lazyOptions) |
Handler for the ParserOptionsRegister hook to add a "wb" option for cache-splitting. | |
static | onRejectParserCacheValue (ParserOutput $parserValue, WikiPage $wikiPage, ParserOptions $parserOpts) |
static | onApiQueryModuleManager (ApiModuleManager $moduleManager) |
static | onParserFirstCallInit (Parser $parser) |
Register the parser functions. | |
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. | |
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. | |
static | onWikibaseContentLanguages (array &$contentLanguages) |
static | onMaintenanceShellStart () |
Static Private Member Functions | |
static | defaultEntityNamespaces () |
PhanUndeclaredConstant. | |
static | ensureConstant (string $name, int $value) |
Ensure that a constant is set to a certain (integer) value, defining it or checking its value if it was already defined. | |
static | isNamespaceUsedByLocalEntities ( $namespace) |
static | notifyEntityStoreWatcherOnUpdate (EntityContent $content, RevisionRecord $revision) |
File defining the hook handlers for the Wikibase extension.
|
staticprivate |
PhanUndeclaredConstant.
|
staticprivate |
Ensure that a constant is set to a certain (integer) value, defining it or checking its value if it was already defined.
|
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 |
|
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 |
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 |
|
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 | $outputPage | |
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 |
ContentLanguages[] | $contentLanguages |
|
static |
Hook to add PHPUnit test cases.
string[] | &$paths |