MediaWiki master
|
Class the manages updates of *_link tables as well as similar extension-managed tables. More...
Inherits MediaWiki\Deferred\DataUpdate.
Inherited by MediaWiki\Deferred\LinksUpdate\LinksDeletionUpdate.
Public Member Functions | |
__construct (PageIdentity $page, ParserOutput $parserOutput, $recursive=true, $maybeRedirectChanged=true) | |
doUpdate () | |
Update link tables with outgoing links from an updated article. | |
getAddedExternalLinks () | |
Fetch external links added by this LinksUpdate. | |
getAddedLinks () | |
Fetch page links added by this LinksUpdate. | |
getAddedProperties () | |
Fetch page properties added by this LinksUpdate. | |
getImages () | |
Return the list of images used as generated by the parser. | |
getPageId () | |
Get the page_id of the page being updated. | |
getPageReferenceArray ( $tableName, $setType) | |
Same as getPageReferenceIterator() but converted to an array for convenience (at the expense of additional time and memory usage) | |
getPageReferenceIterator ( $tableName, $setType) | |
Get an iterator over PageReferenceValue objects corresponding to a given set type in a given table. | |
getParserOutput () | |
Returns parser output. | |
getRemovedExternalLinks () | |
Fetch external links removed by this LinksUpdate. | |
getRemovedLinks () | |
Fetch page links removed by this LinksUpdate. | |
getRemovedProperties () | |
Fetch page properties removed by this LinksUpdate. | |
getRevisionRecord () | |
getTitle () | |
Return the title object of the page being updated. | |
getTriggeringUser () | |
Get the user who triggered this LinksUpdate. | |
isRecursive () | |
Whether or not this LinksUpdate will also update pages which transclude the current page or otherwise depend on it. | |
setMoveDetails (PageReference $oldPage) | |
Notify LinksUpdate that a move has just been completed and set the original title. | |
setRevisionRecord (RevisionRecord $revisionRecord) | |
Set the RevisionRecord corresponding to this LinksUpdate. | |
setStrictTestMode ( $mode=true) | |
Omit conflict resolution options from the insert query so that testing can confirm that the incremental update logic was correct. | |
setTransactionTicket ( $ticket) | |
setTriggeringUser (UserIdentity $user) | |
Set the user who triggered this LinksUpdate. | |
Public Member Functions inherited from MediaWiki\Deferred\DataUpdate | |
__construct () | |
getCauseAction () | |
getCauseAgent () | |
setCause ( $action, $user) | |
Static Public Member Functions | |
static | acquirePageLock (IDatabase $dbw, $pageId, $why='atomicity') |
Acquire a session-level lock for performing link table updates for a page on a DB. | |
static | queueRecursiveJobsForTable (PageIdentity $page, $table, $action='LinksUpdate', $userName='unknown', ?BacklinkCache $backlinkCache=null) |
Queue a RefreshLinks job for any table. | |
Protected Member Functions | |
doIncrementalUpdate () | |
getDB () | |
getExternalLinksTable () | |
getPageLinksTable () | |
getPagePropsTable () | |
queueRecursiveJobs () | |
Queue recursive jobs for this page. | |
updateLinksTimestamp () | |
Update links table freshness. | |
Protected Attributes | |
int | $mId |
Page ID of the article linked from. | |
bool | $mMaybeRedirectChanged |
Whether the page's redirect target may have changed in the latest revision. | |
ParserOutput | $mParserOutput |
bool | $mRecursive |
Whether to queue jobs for recursive updates. | |
Title | $mTitle |
Title object of the article linked from. | |
Protected Attributes inherited from MediaWiki\Deferred\DataUpdate | |
string | $causeAction = 'unknown' |
Short update cause action description. | |
string | $causeAgent = 'unknown' |
Short update cause user description. | |
mixed | $ticket |
Result from LBFactory::getEmptyTransactionTicket() | |
Class the manages updates of *_link tables as well as similar extension-managed tables.
See docs/deferred.txt
Definition at line 56 of file LinksUpdate.php.
MediaWiki\Deferred\LinksUpdate\LinksUpdate::__construct | ( | PageIdentity | $page, |
ParserOutput | $parserOutput, | ||
$recursive = true, | |||
$maybeRedirectChanged = true ) |
PageIdentity | $page | The page we're updating |
ParserOutput | $parserOutput | Output from a full parse of this page |
bool | $recursive | Queue jobs for recursive updates? |
bool | $maybeRedirectChanged | True if the page's redirect target may have changed in the latest revision. If false, this is used as a hint to skip some unnecessary updates. |
Definition at line 97 of file LinksUpdate.php.
References MediaWiki\MediaWikiServices\getInstance(), MediaWiki\MainConfigNames\TempCategoryCollations, and MediaWiki\MainConfigNames\UpdateRowsPerQuery.
|
static |
Acquire a session-level lock for performing link table updates for a page on a DB.
IDatabase | $dbw | |
int | $pageId | |
string | $why | One of (job, atomicity) |
Definition at line 207 of file LinksUpdate.php.
References Wikimedia\Rdbms\IDatabase\getScopedLockAndFlush().
Referenced by MediaWiki\Deferred\LinksUpdate\LinksUpdate\doUpdate().
|
protected |
Reimplemented in MediaWiki\Deferred\LinksUpdate\LinksDeletionUpdate.
Definition at line 222 of file LinksUpdate.php.
References MediaWiki\Deferred\LinksUpdate\LinksUpdate\queueRecursiveJobs(), and MediaWiki\Deferred\LinksUpdate\LinksUpdate\updateLinksTimestamp().
Referenced by MediaWiki\Deferred\LinksUpdate\LinksUpdate\doUpdate().
MediaWiki\Deferred\LinksUpdate\LinksUpdate::doUpdate | ( | ) |
Update link tables with outgoing links from an updated article.
Implements MediaWiki\Deferred\DeferrableUpdate.
Definition at line 144 of file LinksUpdate.php.
References MediaWiki\Deferred\LinksUpdate\LinksUpdate\acquirePageLock(), MediaWiki\Deferred\DeferredUpdates\addUpdate(), MediaWiki\Deferred\LinksUpdate\LinksUpdate\doIncrementalUpdate(), and MediaWiki\Deferred\LinksUpdate\LinksUpdate\getDB().
MediaWiki\Deferred\LinksUpdate\LinksUpdate::getAddedExternalLinks | ( | ) |
Fetch external links added by this LinksUpdate.
Only available after the update is complete.
Definition at line 446 of file LinksUpdate.php.
MediaWiki\Deferred\LinksUpdate\LinksUpdate::getAddedLinks | ( | ) |
Fetch page links added by this LinksUpdate.
Only available after the update is complete.
Definition at line 423 of file LinksUpdate.php.
References wfDeprecated().
MediaWiki\Deferred\LinksUpdate\LinksUpdate::getAddedProperties | ( | ) |
Fetch page properties added by this LinksUpdate.
Only available after the update is complete.
Definition at line 466 of file LinksUpdate.php.
|
protected |
Definition at line 536 of file LinksUpdate.php.
Referenced by MediaWiki\Deferred\LinksUpdate\LinksDeletionUpdate\doIncrementalUpdate(), MediaWiki\Deferred\LinksUpdate\LinksUpdate\doUpdate(), and MediaWiki\Deferred\LinksUpdate\LinksDeletionUpdate\getAsJobSpecification().
|
protected |
Definition at line 406 of file LinksUpdate.php.
MediaWiki\Deferred\LinksUpdate\LinksUpdate::getImages | ( | ) |
Return the list of images used as generated by the parser.
Definition at line 357 of file LinksUpdate.php.
References MediaWiki\Deferred\LinksUpdate\LinksUpdate\getParserOutput(), and wfDeprecated().
MediaWiki\Deferred\LinksUpdate\LinksUpdate::getPageId | ( | ) |
Get the page_id of the page being updated.
Definition at line 335 of file LinksUpdate.php.
References MediaWiki\Deferred\LinksUpdate\LinksUpdate\$mId.
|
protected |
Definition at line 401 of file LinksUpdate.php.
|
protected |
Definition at line 411 of file LinksUpdate.php.
MediaWiki\Deferred\LinksUpdate\LinksUpdate::getPageReferenceArray | ( | $tableName, | |
$setType ) |
Same as getPageReferenceIterator() but converted to an array for convenience (at the expense of additional time and memory usage)
string | $tableName | |
int | $setType |
Definition at line 514 of file LinksUpdate.php.
MediaWiki\Deferred\LinksUpdate\LinksUpdate::getPageReferenceIterator | ( | $tableName, | |
$setType ) |
Get an iterator over PageReferenceValue objects corresponding to a given set type in a given table.
string | $tableName | The name of any table that links to local titles |
int | $setType | One of:
|
Definition at line 495 of file LinksUpdate.php.
MediaWiki\Deferred\LinksUpdate\LinksUpdate::getParserOutput | ( | ) |
Returns parser output.
Definition at line 348 of file LinksUpdate.php.
References MediaWiki\Deferred\LinksUpdate\LinksUpdate\$mParserOutput.
Referenced by MediaWiki\Deferred\LinksUpdate\LinksUpdate\getImages().
MediaWiki\Deferred\LinksUpdate\LinksUpdate::getRemovedExternalLinks | ( | ) |
Fetch external links removed by this LinksUpdate.
Only available after the update is complete.
Definition at line 456 of file LinksUpdate.php.
MediaWiki\Deferred\LinksUpdate\LinksUpdate::getRemovedLinks | ( | ) |
Fetch page links removed by this LinksUpdate.
Only available after the update is complete.
Definition at line 435 of file LinksUpdate.php.
References wfDeprecated().
MediaWiki\Deferred\LinksUpdate\LinksUpdate::getRemovedProperties | ( | ) |
Fetch page properties removed by this LinksUpdate.
Only available after the update is complete.
Definition at line 476 of file LinksUpdate.php.
MediaWiki\Deferred\LinksUpdate\LinksUpdate::getRevisionRecord | ( | ) |
MediaWiki\Deferred\LinksUpdate\LinksUpdate::getTitle | ( | ) |
Return the title object of the page being updated.
Definition at line 325 of file LinksUpdate.php.
References MediaWiki\Deferred\LinksUpdate\LinksUpdate\$mTitle.
MediaWiki\Deferred\LinksUpdate\LinksUpdate::getTriggeringUser | ( | ) |
Get the user who triggered this LinksUpdate.
Definition at line 397 of file LinksUpdate.php.
MediaWiki\Deferred\LinksUpdate\LinksUpdate::isRecursive | ( | ) |
Whether or not this LinksUpdate will also update pages which transclude the current page or otherwise depend on it.
Definition at line 550 of file LinksUpdate.php.
|
protected |
Queue recursive jobs for this page.
Which means do LinksUpdate on all pages that include the current page, using the job queue.
Definition at line 243 of file LinksUpdate.php.
References MediaWiki\Deferred\DataUpdate\getCauseAction(), MediaWiki\Deferred\DataUpdate\getCauseAgent(), MediaWiki\MediaWikiServices\getInstance(), RefreshLinksJob\newPrioritized(), NS_FILE, and MediaWiki\Deferred\LinksUpdate\LinksUpdate\queueRecursiveJobsForTable().
Referenced by MediaWiki\Deferred\LinksUpdate\LinksUpdate\doIncrementalUpdate().
|
static |
Queue a RefreshLinks job for any table.
PageIdentity | $page | Page to do job for |
string | $table | Table to use (e.g. 'templatelinks') |
string | $action | Triggering action |
string | $userName | Triggering user name |
BacklinkCache | null | $backlinkCache |
Definition at line 287 of file LinksUpdate.php.
References $job, MediaWiki\MediaWikiServices\getInstance(), Job\newRootJobParams(), and wfDeprecatedMsg().
Referenced by MediaWiki\Deferred\LinksUpdate\LinksUpdate\queueRecursiveJobs().
MediaWiki\Deferred\LinksUpdate\LinksUpdate::setMoveDetails | ( | PageReference | $oldPage | ) |
Notify LinksUpdate that a move has just been completed and set the original title.
Definition at line 135 of file LinksUpdate.php.
MediaWiki\Deferred\LinksUpdate\LinksUpdate::setRevisionRecord | ( | RevisionRecord | $revisionRecord | ) |
Set the RevisionRecord corresponding to this LinksUpdate.
RevisionRecord | $revisionRecord |
Definition at line 368 of file LinksUpdate.php.
MediaWiki\Deferred\LinksUpdate\LinksUpdate::setStrictTestMode | ( | $mode = true | ) |
Omit conflict resolution options from the insert query so that testing can confirm that the incremental update logic was correct.
bool | $mode |
Definition at line 317 of file LinksUpdate.php.
MediaWiki\Deferred\LinksUpdate\LinksUpdate::setTransactionTicket | ( | $ticket | ) |
mixed | $ticket | Result of getEmptyTransactionTicket() |
Reimplemented from MediaWiki\Deferred\DataUpdate.
Definition at line 126 of file LinksUpdate.php.
References MediaWiki\Deferred\DataUpdate\$ticket.
MediaWiki\Deferred\LinksUpdate\LinksUpdate::setTriggeringUser | ( | UserIdentity | $user | ) |
Set the user who triggered this LinksUpdate.
UserIdentity | $user |
Definition at line 387 of file LinksUpdate.php.
|
protected |
Update links table freshness.
Definition at line 521 of file LinksUpdate.php.
Referenced by MediaWiki\Deferred\LinksUpdate\LinksUpdate\doIncrementalUpdate().
|
protected |
Page ID of the article linked from.
Definition at line 60 of file LinksUpdate.php.
Referenced by MediaWiki\Deferred\LinksUpdate\LinksDeletionUpdate\doIncrementalUpdate(), and MediaWiki\Deferred\LinksUpdate\LinksUpdate\getPageId().
|
protected |
Whether the page's redirect target may have changed in the latest revision.
Definition at line 72 of file LinksUpdate.php.
|
protected |
Definition at line 66 of file LinksUpdate.php.
Referenced by MediaWiki\Deferred\LinksUpdate\LinksUpdate\getParserOutput().
|
protected |
Whether to queue jobs for recursive updates.
Definition at line 69 of file LinksUpdate.php.
|
protected |
Title object of the article linked from.
Definition at line 63 of file LinksUpdate.php.
Referenced by MediaWiki\Deferred\LinksUpdate\LinksDeletionUpdate\doIncrementalUpdate(), and MediaWiki\Deferred\LinksUpdate\LinksUpdate\getTitle().