Wikibase
MediaWiki Wikibase extension
Wikibase\Client\Hooks\DataUpdateHookHandler Class Reference

Hook handlers for triggering data updates. More...

+ Inheritance diagram for Wikibase\Client\Hooks\DataUpdateHookHandler:
+ Collaboration diagram for Wikibase\Client\Hooks\DataUpdateHookHandler:

Public Member Functions

 __construct (UsageUpdater $usageUpdater, JobQueueGroup $jobScheduler, UsageLookup $usageLookup, UsageAccumulatorFactory $usageAccumulatorFactory, LoggerInterface $logger=null)
 
 onArticleDeleteComplete ( $wikiPage, $user, $reason, $id, $content, $logEntry, $archivedRevisionCount)
 Static handler for ArticleDeleteComplete. More...
 
 onLinksUpdateComplete ( $linksUpdate, $ticket)
 Triggered when a page gets re-rendered to update secondary link tables. More...
 
 doLinksUpdateComplete (LinksUpdate $linksUpdate)
 
 onParserCacheSaveComplete ( $parserCache, $parserOutput, $title, $popts, $revId)
 Triggered when a new rendering of a page is committed to the ParserCache. More...
 

Static Public Member Functions

static factory (JobQueueGroup $jobQueueGroup, LoggerInterface $logger, ClientStore $store, UsageAccumulatorFactory $usageAccumulatorFactory)
 

Private Member Functions

 reindexEntityUsages (array $usages)
 Re-indexes the given list of EntityUsages so that each EntityUsage can be found by using its string representation as a key. More...
 

Private Attributes

 $usageUpdater
 
 $jobScheduler
 
 $usageLookup
 
 $usageAccumulatorFactory
 
 $logger
 

Detailed Description

Hook handlers for triggering data updates.

This class has a static interface for use with MediaWiki's hook mechanism; the static handler functions will create a new instance of DataUpdateHookHandler and then call the corresponding member function on that.

Author
Daniel Kinzler
Marius Hoch

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Client\Hooks\DataUpdateHookHandler::__construct ( UsageUpdater  $usageUpdater,
JobQueueGroup  $jobScheduler,
UsageLookup  $usageLookup,
UsageAccumulatorFactory  $usageAccumulatorFactory,
LoggerInterface  $logger = null 
)

Member Function Documentation

◆ doLinksUpdateComplete()

Wikibase\Client\Hooks\DataUpdateHookHandler::doLinksUpdateComplete ( LinksUpdate  $linksUpdate)

◆ factory()

static Wikibase\Client\Hooks\DataUpdateHookHandler::factory ( JobQueueGroup  $jobQueueGroup,
LoggerInterface  $logger,
ClientStore  $store,
UsageAccumulatorFactory  $usageAccumulatorFactory 
)
static

◆ onArticleDeleteComplete()

Wikibase\Client\Hooks\DataUpdateHookHandler::onArticleDeleteComplete (   $wikiPage,
  $user,
  $reason,
  $id,
  $content,
  $logEntry,
  $archivedRevisionCount 
)

Static handler for ArticleDeleteComplete.

See also
https://www.mediawiki.org/wiki/Manual:Hooks/ArticleDeleteComplete
Parameters
WikiPage$wikiPageWikiPage that was deleted
User$userUser that deleted the article
string$reasonReason the article was deleted
int$idID of the article that was deleted
Content | null$contentContent of the deleted page (or null, when deleting a broken page)
\ManualLogEntry$logEntryManualLogEntry used to record the deletion
int$archivedRevisionCountNumber of revisions archived during the deletion

◆ onLinksUpdateComplete()

Wikibase\Client\Hooks\DataUpdateHookHandler::onLinksUpdateComplete (   $linksUpdate,
  $ticket 
)

Triggered when a page gets re-rendered to update secondary link tables.

Implemented to update usage tracking information via UsageUpdater.

Parameters
LinksUpdate$linksUpdate
mixed$ticketPrior result of LBFactory::getEmptyTransactionTicket()

◆ onParserCacheSaveComplete()

Wikibase\Client\Hooks\DataUpdateHookHandler::onParserCacheSaveComplete (   $parserCache,
  $parserOutput,
  $title,
  $popts,
  $revId 
)

Triggered when a new rendering of a page is committed to the ParserCache.

Implemented to update usage tracking information via UsageUpdater.

Parameters
ParserCache$parserCacheParserCache object $parserOutput was stored in
ParserOutput$parserOutputParserOutput object that was stored
Title$titleTitle of the page that was parsed to generate $parserOutput
ParserOptions$poptsParserOptions used for generating $parserOutput
int$revIdID of the revision that was parsed to create $parserOutput

◆ reindexEntityUsages()

Wikibase\Client\Hooks\DataUpdateHookHandler::reindexEntityUsages ( array  $usages)
private

Re-indexes the given list of EntityUsages so that each EntityUsage can be found by using its string representation as a key.

Parameters
EntityUsage[]$usages
Exceptions
InvalidArgumentException
Returns
EntityUsage[]

Member Data Documentation

◆ $jobScheduler

Wikibase\Client\Hooks\DataUpdateHookHandler::$jobScheduler
private

◆ $logger

Wikibase\Client\Hooks\DataUpdateHookHandler::$logger
private

◆ $usageAccumulatorFactory

Wikibase\Client\Hooks\DataUpdateHookHandler::$usageAccumulatorFactory
private

◆ $usageLookup

Wikibase\Client\Hooks\DataUpdateHookHandler::$usageLookup
private

◆ $usageUpdater

Wikibase\Client\Hooks\DataUpdateHookHandler::$usageUpdater
private

The documentation for this class was generated from the following file: