CirrusSearch
Elasticsearch-powered search for MediaWiki
Loading...
Searching...
No Matches
CirrusSearch\PageChangeTracker Class Reference

Listen to a set of hooks to keep track if a pageId was involved in a "page change". More...

+ Inheritance diagram for CirrusSearch\PageChangeTracker:
+ Collaboration diagram for CirrusSearch\PageChangeTracker:

Public Member Functions

 __construct (int $maxStateSize=512)
 
 onPageDeleteComplete (ProperPageIdentity $page, Authority $deleter, string $reason, int $pageID, RevisionRecord $deletedRev, ManualLogEntry $logEntry, int $archivedRevisionCount)
 
 onPageDelete (ProperPageIdentity $page, Authority $deleter, string $reason, StatusValue $status, bool $suppress)
 
 onPageMoveComplete ( $old, $new, $user, $pageid, $redirid, $reason, $revision)
 
 onPageSaveComplete ( $wikiPage, $user, $summary, $flags, $revisionRecord, $editResult)
 
 isPageChange (int $pageId)
 Test if this pageId was references in a hook call earlier.
 

Detailed Description

Listen to a set of hooks to keep track if a pageId was involved in a "page change".

A page change is a change happening to the page itself, based on the hooks used by EventBus to emit its page_change stream we use this to determine in which stream we might emit a cirrus event based on a LinksUpdateComplete hook. Mainly we want to identify if a particular LinksUpdate is caused by a page change or something else unrelated to the life of the page.

Member Function Documentation

◆ isPageChange()

CirrusSearch\PageChangeTracker::isPageChange ( int $pageId)

Test if this pageId was references in a hook call earlier.

Calling this function resets the state held by this class.

Parameters
int$pageId
Returns
bool

◆ onPageDelete()

CirrusSearch\PageChangeTracker::onPageDelete ( ProperPageIdentity $page,
Authority $deleter,
string $reason,
StatusValue $status,
bool $suppress )
Parameters
ProperPageIdentity$page
Authority$deleter
string$reason
StatusValue$status
bool$suppress
Returns
void

◆ onPageDeleteComplete()

CirrusSearch\PageChangeTracker::onPageDeleteComplete ( ProperPageIdentity $page,
Authority $deleter,
string $reason,
int $pageID,
RevisionRecord $deletedRev,
ManualLogEntry $logEntry,
int $archivedRevisionCount )
Parameters
ProperPageIdentity$page
Authority$deleter
string$reason
int$pageID
RevisionRecord$deletedRev
ManualLogEntry$logEntry
int$archivedRevisionCount
Returns
void

Reimplemented in CirrusSearch\ChangeListener.

◆ onPageMoveComplete()

CirrusSearch\PageChangeTracker::onPageMoveComplete ( $old,
$new,
$user,
$pageid,
$redirid,
$reason,
$revision )
Parameters
LinkTarget$oldOld title
LinkTarget$newNew title
UserIdentity$userUser who did the move
int$pageidDatabase ID of the page that's been moved
int$rediridDatabase ID of the created redirect
string$reasonReason for the move
RevisionRecord$revisionRevisionRecord created by the move
Returns
bool|void True or no return value to continue or false stop other hook handlers, doesn't abort the move itself

Reimplemented in CirrusSearch\ChangeListener.

◆ onPageSaveComplete()

CirrusSearch\PageChangeTracker::onPageSaveComplete ( $wikiPage,
$user,
$summary,
$flags,
$revisionRecord,
$editResult )
Parameters
\WikiPage$wikiPageWikiPage modified
UserIdentity$userUser performing the modification
string$summaryEdit summary/comment
int$flagsFlags passed to WikiPage::doUserEditContent()
RevisionRecord$revisionRecordNew RevisionRecord of the article
EditResult$editResultObject storing information about the effects of this edit, including which edits were reverted and which edit is this based on (for reverts and null edits).
Returns
bool|void True or no return value to continue or false to stop other hook handlers from being called; save cannot be aborted

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