|
Wikibase
MediaWiki Wikibase extension
|
Partial implementation of a hook runner for WikibaseRepo. More...
Inheritance diagram for Wikibase\Repo\Hooks\WikibaseRepoHookRunner:
Collaboration diagram for Wikibase\Repo\Hooks\WikibaseRepoHookRunner:Public Member Functions | ||||||||||||||||||||||
| __construct (HookContainer $container) | ||||||||||||||||||||||
| onEditFilterMergedContent (IContextSource $context, Content $content, Status $status, $summary, User $user, $minoredit, string $slotRole=SlotRecord::MAIN) | ||||||||||||||||||||||
| ||||||||||||||||||||||
| onGetEntityByLinkedTitleLookup (EntityByLinkedTitleLookup &$lookup) | ||||||||||||||||||||||
| Allows extensions to add custom EntityByLinkedTitleLookup services. | ||||||||||||||||||||||
| onGetEntityContentModelForTitle (Title $title, string &$contentModel) | ||||||||||||||||||||||
| Called to determine what the entity content model of the Title is. | ||||||||||||||||||||||
| onWikibaseChangeNotification (Change $change) | ||||||||||||||||||||||
Triggered from ChangeNotifier via a HookChangeTransmitter to notify any listeners of changes to entities. | ||||||||||||||||||||||
| onWikibaseContentModelMapping (array &$map) | ||||||||||||||||||||||
Called by () WikibaseRepo::getContentModelMappings() to allow additional mappings between Entity types and content model identifiers to be defined. | ||||||||||||||||||||||
| onWikibaseRepoControllers (array &$controllerDefinitions) | ||||||||||||||||||||||
| onWikibaseRepoDataTypes (array &$dataTypeDefinitions) | ||||||||||||||||||||||
Called when constructing the top-level WikibaseRepo factory May be used to define additional data types. | ||||||||||||||||||||||
| onWikibaseRepoEntityTypes (array &$entityTypeDefinitions) | ||||||||||||||||||||||
Called when constructing the top-level WikibaseRepo factory. | ||||||||||||||||||||||
| onWikibaseRepoOnParserOutputUpdaterConstruction (StatementDataUpdater $statementUpdater, array &$entityUpdaters) | ||||||||||||||||||||||
| Allows extensions to register extra EntityParserOutputUpdater implementations. | ||||||||||||||||||||||
| onWikibaseRepoOpenApiDocFragments (OpenApiDocFragmentJoiner $joiner) | ||||||||||||||||||||||
| onWikibaseRepoSearchableEntityScopesMessages (array &$messages) | ||||||||||||||||||||||
Hook handler method for the 'WikibaseRepoSearchableEntityScopesMessages' hook.
| ||||||||||||||||||||||
| onWikibaseRepoSearchableEntityScopes (array &$searchableEntityScopes) | ||||||||||||||||||||||
Hook handler method for the 'WikibaseRepoSearchableEntityScopes' hook.
| ||||||||||||||||||||||
| onWikibaseTextForSearchIndex (EntityContent $entityContent, string &$text) | ||||||||||||||||||||||
Called by EntityContent::getTextForSearchIndex() to allow extra text to be passed to the search engine for indexing.If the hook function returns false, no text at all will be passed to the search index.
| ||||||||||||||||||||||
| onWikibaseRepoEntityNamespaces (array &$entityNamespaces) | ||||||||||||||||||||||
Called in the default 'entitySources' setting to allow additional mappings between Entity types and namespace IDs to be defined.Only used if no custom entity sources are defined.
| ||||||||||||||||||||||
Private Attributes | |
| HookContainer | $hookContainer |
Partial implementation of a hook runner for WikibaseRepo.
Full implementation will be addressed in T338452
| Wikibase\Repo\Hooks\WikibaseRepoHookRunner::__construct | ( | HookContainer | $container | ) |
| Wikibase\Repo\Hooks\WikibaseRepoHookRunner::onEditFilterMergedContent | ( | IContextSource | $context, |
| Content | $content, | ||
| Status | $status, | ||
| $summary, | |||
| User | $user, | ||
| $minoredit, | |||
| string | $slotRole = SlotRecord::MAIN ) |
| IContextSource | $context | |
| Content | $content | Content of the edit box |
| Status | $status | Status object to represent errors, etc. |
| string | $summary | Edit summary for page |
| User | $user | User whois performing the edit |
| bool | $minoredit | Whether the edit was marked as minor by the user. |
| string | $slotRole | This extra parameter is not part of the core hook interface, but is passed in by Wikibase and read by AbuseFilter; see T288885. |
Implements Wikibase\Repo\Hooks\WikibaseEditFilterMergedContentHook.
| Wikibase\Repo\Hooks\WikibaseRepoHookRunner::onGetEntityByLinkedTitleLookup | ( | EntityByLinkedTitleLookup & | $lookup | ) |
Allows extensions to add custom EntityByLinkedTitleLookup services.
| EntityByLinkedTitleLookup | &$lookup |
Implements Wikibase\Repo\Hooks\GetEntityByLinkedTitleLookupHook.
| Wikibase\Repo\Hooks\WikibaseRepoHookRunner::onGetEntityContentModelForTitle | ( | Title | $title, |
| string & | $contentModel ) |
Called to determine what the entity content model of the Title is.
Extensions can override it so entity content model does not equal page content model.
| Title | $title | Title object for the page. |
| string | &$contentModel | Content model for the page. Extensions can override this. |
Implements Wikibase\DataAccess\Hooks\GetEntityContentModelForTitleHook.
| Wikibase\Repo\Hooks\WikibaseRepoHookRunner::onWikibaseChangeNotification | ( | Change | $change | ) |
Triggered from ChangeNotifier via a HookChangeTransmitter to notify any listeners of changes to entities.
For performance reasons, does not include statement, description and alias diffs (see T113468, T163465).
| Change | $change | The Change object representing the change. |
Implements Wikibase\Repo\Hooks\WikibaseChangeNotificationHook.
| Wikibase\Repo\Hooks\WikibaseRepoHookRunner::onWikibaseContentModelMapping | ( | array & | $map | ) |
Called by () WikibaseRepo::getContentModelMappings() to allow additional mappings between Entity types and content model identifiers to be defined.
This hook runs during early initialization; its handlers must obey the () MediaWikiServicesHook rules, i.e. not declare any service dependencies nor access any unsafe services dynamically.
| string[] | &$map | An associative array mapping Entity types to content model ids. |
Warning: This hook runs as part of an early initialization service (WikibaseRepo.ContentModelMappings, see service wiring and the warning there).
Implements Wikibase\Repo\Hooks\WikibaseContentModelMappingHook.
| Wikibase\Repo\Hooks\WikibaseRepoHookRunner::onWikibaseRepoControllers | ( | array & | $controllerDefinitions | ) |
| array<string,array<string,callable>> | &$controllerDefinitions |
Implements Wikibase\Repo\Hooks\WikibaseRepoControllersHook.
| Wikibase\Repo\Hooks\WikibaseRepoHookRunner::onWikibaseRepoDataTypes | ( | array & | $dataTypeDefinitions | ) |
Called when constructing the top-level WikibaseRepo factory May be used to define additional data types.
See also WikibaseClientDataTypesHook.
Hook handlers may add additional definitions. See datatypes documentation for details.
| array[] | &$dataTypeDefinitions | the array of data type definitions, as defined by WikibaseRepo.datatypes.php. |
Implements Wikibase\Repo\Hooks\WikibaseRepoDataTypesHook.
| Wikibase\Repo\Hooks\WikibaseRepoHookRunner::onWikibaseRepoEntityNamespaces | ( | array & | $entityNamespaces | ) |
Called in the default 'entitySources' setting to allow additional mappings between Entity types and namespace IDs to be defined.Only used if no custom entity sources are defined.
| array | &$entityNamespaces | An associative array mapping Entity types to namespace ids. |
Implements Wikibase\Repo\Hooks\WikibaseRepoEntityNamespacesHook.
| Wikibase\Repo\Hooks\WikibaseRepoHookRunner::onWikibaseRepoEntityTypes | ( | array & | $entityTypeDefinitions | ) |
Called when constructing the top-level WikibaseRepo factory.
May be used to define additional entity types. See also WikibaseClientDataTypesHook.
Hook handlers may add additional definitions. See entitytypes documentation for details.
This hook runs during early initialization; its handlers must obey the () MediaWikiServicesHook rules, i.e. not declare any service dependencies nor access any unsafe services dynamically.
| array[] | &$entityTypeDefinitions | The array of entity type definitions, as defined by WikibaseLib.entitytypes.php. |
Warning: This hook runs as part of an early initialization service (WikibaseRepo.EntityTypeDefinitions, see service wiring and the warning there).
Implements Wikibase\Repo\Hooks\WikibaseRepoEntityTypesHook.
| Wikibase\Repo\Hooks\WikibaseRepoHookRunner::onWikibaseRepoOnParserOutputUpdaterConstruction | ( | StatementDataUpdater | $statementUpdater, |
| array & | $entityUpdaters ) |
Allows extensions to register extra EntityParserOutputUpdater implementations.
| StatementDataUpdater | $statementUpdater | |
| EntityParserOutputUpdater[] | &$entityUpdaters |
Implements Wikibase\Repo\Hooks\WikibaseRepoOnParserOutputUpdaterConstructionHook.
| Wikibase\Repo\Hooks\WikibaseRepoHookRunner::onWikibaseRepoOpenApiDocFragments | ( | OpenApiDocFragmentJoiner | $joiner | ) |
| Wikibase\Repo\Hooks\WikibaseRepoHookRunner::onWikibaseRepoSearchableEntityScopes | ( | array & | $searchableEntityScopes | ) |
Hook handler method for the 'WikibaseRepoSearchableEntityScopes' hook.
| array | &$searchableEntityScopes | A dictionary mapping entity types (lexeme, property) to the namespaceId of the associated entity namespace |
Implements Wikibase\Repo\Hooks\WikibaseRepoSearchableEntityScopesHook.
| Wikibase\Repo\Hooks\WikibaseRepoHookRunner::onWikibaseRepoSearchableEntityScopesMessages | ( | array & | $messages | ) |
Hook handler method for the 'WikibaseRepoSearchableEntityScopesMessages' hook.
| array | &$messages | A dictionary mapping entity types (lexeme, property) to the message key of the translation for the entity name. |
Implements Wikibase\Repo\Hooks\WikibaseRepoSearchableEntityScopesMessagesHook.
| Wikibase\Repo\Hooks\WikibaseRepoHookRunner::onWikibaseTextForSearchIndex | ( | EntityContent | $entityContent, |
| string & | $text ) |
Called by EntityContent::getTextForSearchIndex() to allow extra text to be passed to the search engine for indexing.If the hook function returns false, no text at all will be passed to the search index.
| EntityContent | $entityContent | EntityContent to be indexed. |
| string | &$text | The text to pass to the index (to be modified). |
Implements Wikibase\Repo\Hooks\WikibaseTextForSearchIndexHook.
|
private |