MediaWiki
1.27.1
|
See docs/deferred.txt. More...
Public Member Functions | |
__construct (Title $title, ParserOutput $parserOutput, $recursive=true) | |
Constructor. More... | |
doUpdate () | |
Update link tables with outgoing links from an updated article. More... | |
getAddedLinks () | |
Fetch page links added by this LinksUpdate. More... | |
getAsJobSpecification () | |
getImages () | |
Return the list of images used as generated by the parser. More... | |
getParserOutput () | |
Returns parser output. More... | |
getPropertyDeletions ($existing) | |
Get array of properties which should be deleted. More... | |
getPropertyInsertions ($existing=[]) | |
Get an array of page property insertions. More... | |
getRemovedLinks () | |
Fetch page links removed by this LinksUpdate. More... | |
getTitle () | |
Return the title object of the page being updated. More... | |
getTriggeringUser () | |
incrTableUpdate ($table, $prefix, $deletions, $insertions) | |
Update a table by doing a delete query then an insert query. More... | |
invalidateCategories ($cats) | |
invalidateImageDescriptions ($images) | |
setRevision (Revision $revision) | |
Set the revision corresponding to this LinksUpdate. More... | |
setTriggeringUser (User $user) | |
Set the User who triggered this LinksUpdate. More... | |
updateCategoryCounts ($added, $deleted) | |
Update all the appropriate counts in the category table. More... | |
Public Member Functions inherited from SqlDataUpdate | |
__construct ($withTransaction=true) | |
Constructor. More... | |
abortTransaction () | |
Abort the database transaction started via beginTransaction (if any). More... | |
beginTransaction () | |
Begin a database transaction, if $withTransaction was given as true in the constructor for this SqlDataUpdate. More... | |
commitTransaction () | |
Commit the database transaction started via beginTransaction (if any). More... | |
Public Member Functions inherited from DataUpdate | |
__construct () | |
beginTransaction () | |
Begin an appropriate transaction, if any. More... | |
commitTransaction () | |
Commit the transaction started via beginTransaction, if any. More... | |
rollbackTransaction () | |
Abort / roll back the transaction started via beginTransaction, if any. More... | |
Static Public Member Functions | |
static | queueRecursiveJobsForTable (Title $title, $table) |
Queue a RefreshLinks job for any table. More... | |
Static Public Member Functions inherited from DataUpdate | |
static | runUpdates (array $updates, $mode= 'run') |
Convenience method, calls doUpdate() on every DataUpdate in the array. More... | |
Public Attributes | |
array | $mCategories |
Map of category names to sort keys. More... | |
array | $mExternals |
URLs of external links, array key only. More... | |
int | $mId |
Page ID of the article linked from. More... | |
array | $mImages |
DB keys of the images used, in the array key only. More... | |
array | $mInterlangs |
Map of language codes to titles. More... | |
array | $mInterwikis |
2-D map of (prefix => DBK => 1) More... | |
array | $mLinks |
Map of title strings to IDs for the links in the document. More... | |
ParserOutput | $mParserOutput |
array | $mProperties |
Map of arbitrary name to value. More... | |
bool | $mRecursive |
Whether to queue jobs for recursive updates. More... | |
array | $mTemplates |
Map of title strings to IDs for the template references, including broken ones. More... | |
Title | $mTitle |
Title object of the article linked from. More... | |
Protected Member Functions | |
doIncrementalUpdate () | |
getExistingInterwikis () | |
Get an array of existing inline interwiki links, as a 2-D array. More... | |
queueRecursiveJobs () | |
Queue recursive jobs for this page. More... | |
updateLinksTimestamp () | |
Update links table freshness. More... | |
Protected Member Functions inherited from SqlDataUpdate | |
invalidatePages ($namespace, array $dbkeys) | |
Invalidate the cache of a list of pages from a single namespace. More... | |
Private Member Functions | |
getCategoryDeletions ($existing) | |
Given an array of existing categories, returns those categories which are not in $this and thus should be deleted. More... | |
getCategoryInsertions ($existing=[]) | |
Get an array of category insertions. More... | |
getExistingCategories () | |
Get an array of existing categories, with the name in the key and sort key in the value. More... | |
getExistingExternals () | |
Get an array of existing external links, URLs in the keys. More... | |
getExistingImages () | |
Get an array of existing images, image names in the keys. More... | |
getExistingInterlangs () | |
Get an array of existing interlanguage links, with the language code in the key and the title in the value. More... | |
getExistingLinks () | |
Get an array of existing links, as a 2-D array. More... | |
getExistingProperties () | |
Get an array of existing categories, with the name in the key and sort key in the value. More... | |
getExistingTemplates () | |
Get an array of existing templates, as a 2-D array. More... | |
getExternalDeletions ($existing) | |
Given an array of existing external links, returns those links which are not in $this and thus should be deleted. More... | |
getExternalInsertions ($existing=[]) | |
Get an array of externallinks insertions. More... | |
getImageDeletions ($existing) | |
Given an array of existing images, returns those images which are not in $this and thus should be deleted. More... | |
getImageInsertions ($existing=[]) | |
Get an array of image insertions Skips the names specified in $existing. More... | |
getInterlangDeletions ($existing) | |
Given an array of existing interlanguage links, returns those links which are not in $this and thus should be deleted. More... | |
getInterlangInsertions ($existing=[]) | |
Get an array of interlanguage link insertions. More... | |
getInterwikiDeletions ($existing) | |
Given an array of existing interwiki links, returns those links which are not in $this and thus should be deleted. More... | |
getInterwikiInsertions ($existing=[]) | |
Get an array of interwiki insertions for passing to the DB Skips the titles specified by the 2-D array $existing. More... | |
getLinkDeletions ($existing) | |
Given an array of existing links, returns those links which are not in $this and thus should be deleted. More... | |
getLinkInsertions ($existing=[]) | |
Get an array of pagelinks insertions for passing to the DB Skips the titles specified by the 2-D array $existing. More... | |
getPagePropRowData ($prop) | |
Returns an associative array to be used for inserting a row into the page_props table. More... | |
getPropertySortKeyValue ($value) | |
Determines the sort key for the given property value. More... | |
getTemplateDeletions ($existing) | |
Given an array of existing templates, returns those templates which are not in $this and thus should be deleted. More... | |
getTemplateInsertions ($existing=[]) | |
Get an array of template insertions. More... | |
invalidateProperties ($changed) | |
Invalidate any necessary link lists related to page property changes. More... | |
Private Attributes | |
null array | $linkDeletions = null |
Deleted links if calculated. More... | |
null array | $linkInsertions = null |
Added links if calculated. More... | |
Revision | $mRevision |
Revision for which this update has been triggered. More... | |
User null | $user |
Additional Inherited Members | |
Static Protected Member Functions inherited from DataUpdate | |
static | enqueueUpdates (array $updates) |
Enqueue jobs for every DataUpdate that support enqueueUpdate() and return the remaining DataUpdate objects (those that do not) More... | |
Protected Attributes inherited from SqlDataUpdate | |
IDatabase | $mDb |
Database connection reference. More... | |
array | $mOptions = [] |
SELECT options to be used (array) More... | |
bool | $mUseTransaction |
Whether this update should be wrapped in a transaction. More... | |
See docs/deferred.txt.
Definition at line 28 of file LinksUpdate.php.
LinksUpdate::__construct | ( | Title | $title, |
ParserOutput | $parserOutput, | ||
$recursive = true |
|||
) |
Constructor.
Title | $title | Title of the page we're updating |
ParserOutput | $parserOutput | Output from a full parse of this page |
bool | $recursive | Queue jobs for recursive updates? |
MWException |
Definition at line 93 of file LinksUpdate.php.
References $key, $link, $parserOutput, $title, as, Title\GAID_FOR_UPDATE, Title\getArticleID(), ParserOutput\getCategories(), ParserOutput\getExternalLinks(), ParserOutput\getImages(), ParserOutput\getInterwikiLinks(), ParserOutput\getLanguageLinks(), ParserOutput\getLinks(), ParserOutput\getProperties(), ParserOutput\getTemplates(), list, and Hooks\run().
|
protected |
Definition at line 154 of file LinksUpdate.php.
References getCategoryDeletions(), getCategoryInsertions(), getExistingCategories(), getExistingExternals(), getExistingImages(), getExistingInterlangs(), getExistingInterwikis(), getExistingLinks(), getExistingProperties(), getExistingTemplates(), getExternalDeletions(), getExternalInsertions(), getImageDeletions(), getImageInsertions(), getInterlangDeletions(), getInterlangInsertions(), getInterwikiDeletions(), getInterwikiInsertions(), getLinkDeletions(), getLinkInsertions(), getPropertyDeletions(), getPropertyInsertions(), getTemplateDeletions(), getTemplateInsertions(), incrTableUpdate(), invalidateCategories(), invalidateImageDescriptions(), invalidateProperties(), queueRecursiveJobs(), updateCategoryCounts(), and updateLinksTimestamp().
Referenced by doUpdate().
LinksUpdate::doUpdate | ( | ) |
Update link tables with outgoing links from an updated article.
Implements DeferrableUpdate.
Definition at line 145 of file LinksUpdate.php.
References doIncrementalUpdate(), and Hooks\run().
LinksUpdate::getAddedLinks | ( | ) |
Fetch page links added by this LinksUpdate.
Only available after the update is complete.
Definition at line 924 of file LinksUpdate.php.
References as, and Title\makeTitle().
LinksUpdate::getAsJobSpecification | ( | ) |
Implements EnqueueableDataUpdate.
Definition at line 970 of file LinksUpdate.php.
References $mRecursive, getTitle(), true, and user.
|
private |
Given an array of existing categories, returns those categories which are not in $this and thus should be deleted.
array | $existing |
Definition at line 666 of file LinksUpdate.php.
Referenced by doIncrementalUpdate().
|
private |
Get an array of category insertions.
array | $existing | Mapping existing category names to sort keys. If both match a link in $this, the link will be omitted from the output |
Definition at line 449 of file LinksUpdate.php.
References $mId, $name, $type, $wgContLang, as, global, Title\makeTitleSafe(), NS_CATEGORY, NS_FILE, and Collation\singleton().
Referenced by doIncrementalUpdate().
|
private |
Get an array of existing categories, with the name in the key and sort key in the value.
Definition at line 783 of file LinksUpdate.php.
Referenced by doIncrementalUpdate().
|
private |
Get an array of existing external links, URLs in the keys.
Definition at line 767 of file LinksUpdate.php.
Referenced by doIncrementalUpdate().
|
private |
Get an array of existing images, image names in the keys.
Definition at line 751 of file LinksUpdate.php.
Referenced by doIncrementalUpdate().
|
private |
Get an array of existing interlanguage links, with the language code in the key and the title in the value.
Definition at line 800 of file LinksUpdate.php.
Referenced by doIncrementalUpdate().
|
protected |
Get an array of existing inline interwiki links, as a 2-D array.
Definition at line 815 of file LinksUpdate.php.
Referenced by doIncrementalUpdate().
|
private |
Get an array of existing links, as a 2-D array.
Definition at line 713 of file LinksUpdate.php.
Referenced by doIncrementalUpdate().
|
private |
Get an array of existing categories, with the name in the key and sort key in the value.
Definition at line 834 of file LinksUpdate.php.
Referenced by doIncrementalUpdate().
|
private |
Get an array of existing templates, as a 2-D array.
Definition at line 732 of file LinksUpdate.php.
Referenced by doIncrementalUpdate().
|
private |
Given an array of existing external links, returns those links which are not in $this and thus should be deleted.
array | $existing |
Definition at line 656 of file LinksUpdate.php.
Referenced by doIncrementalUpdate().
|
private |
Get an array of externallinks insertions.
Skips the names specified in $existing
array | $existing |
Definition at line 424 of file LinksUpdate.php.
References $mId, as, and wfMakeUrlIndexes().
Referenced by doIncrementalUpdate().
|
private |
Given an array of existing images, returns those images which are not in $this and thus should be deleted.
array | $existing |
Definition at line 646 of file LinksUpdate.php.
Referenced by doIncrementalUpdate().
|
private |
Get an array of image insertions Skips the names specified in $existing.
array | $existing |
Definition at line 405 of file LinksUpdate.php.
Referenced by doIncrementalUpdate().
LinksUpdate::getImages | ( | ) |
Return the list of images used as generated by the parser.
Definition at line 866 of file LinksUpdate.php.
References $mImages.
|
private |
Given an array of existing interlanguage links, returns those links which are not in $this and thus should be deleted.
array | $existing |
Definition at line 676 of file LinksUpdate.php.
Referenced by doIncrementalUpdate().
|
private |
Get an array of interlanguage link insertions.
array | $existing | Mapping existing language codes to titles |
Definition at line 493 of file LinksUpdate.php.
References $lang, $mId, $title, and as.
Referenced by doIncrementalUpdate().
|
private |
Given an array of existing interwiki links, returns those links which are not in $this and thus should be deleted.
array | $existing |
Definition at line 695 of file LinksUpdate.php.
References as.
Referenced by doIncrementalUpdate().
|
private |
Get an array of interwiki insertions for passing to the DB Skips the titles specified by the 2-D array $existing.
array | $existing |
Definition at line 583 of file LinksUpdate.php.
Referenced by doIncrementalUpdate().
|
private |
Given an array of existing links, returns those links which are not in $this and thus should be deleted.
array | $existing |
Definition at line 608 of file LinksUpdate.php.
References as.
Referenced by doIncrementalUpdate().
|
private |
Get an array of pagelinks insertions for passing to the DB Skips the titles specified by the 2-D array $existing.
array | $existing |
Definition at line 358 of file LinksUpdate.php.
Referenced by doIncrementalUpdate().
|
private |
Returns an associative array to be used for inserting a row into the page_props table.
Besides the given property name, this will include the page id from $this->mId and any property value from $this->mProperties.
The array returned will include the pp_sortkey field if this is present in the database (as indicated by $wgPagePropsHaveSortkey). The sortkey value is currently determined by getPropertySortKeyValue().
string | $prop | The name of the property. |
Definition at line 539 of file LinksUpdate.php.
References $mId, $value, getPropertySortKeyValue(), and global.
Referenced by getPropertyInsertions().
LinksUpdate::getParserOutput | ( | ) |
Returns parser output.
Definition at line 858 of file LinksUpdate.php.
References $mParserOutput.
LinksUpdate::getPropertyDeletions | ( | $existing | ) |
Get array of properties which should be deleted.
array | $existing |
Definition at line 685 of file LinksUpdate.php.
Referenced by doIncrementalUpdate().
LinksUpdate::getPropertyInsertions | ( | $existing = [] | ) |
Get an array of page property insertions.
array | $existing |
Definition at line 512 of file LinksUpdate.php.
References $name, as, and getPagePropRowData().
Referenced by doIncrementalUpdate().
|
private |
Determines the sort key for the given property value.
This will return $value if it is a float or int, 1 or resp. 0 if it is a bool, and null otherwise.
mixed | $value |
Definition at line 569 of file LinksUpdate.php.
References $value.
Referenced by getPagePropRowData().
LinksUpdate::getRemovedLinks | ( | ) |
Fetch page links removed by this LinksUpdate.
Only available after the update is complete.
Definition at line 941 of file LinksUpdate.php.
References $title, $titles, as, and Title\makeTitle().
|
private |
Given an array of existing templates, returns those templates which are not in $this and thus should be deleted.
array | $existing |
Definition at line 627 of file LinksUpdate.php.
References as.
Referenced by doIncrementalUpdate().
|
private |
Get an array of template insertions.
Like getLinkInsertions()
array | $existing |
Definition at line 382 of file LinksUpdate.php.
Referenced by doIncrementalUpdate().
LinksUpdate::getTitle | ( | ) |
Return the title object of the page being updated.
Definition at line 849 of file LinksUpdate.php.
References $mTitle.
Referenced by getAsJobSpecification().
LinksUpdate::getTriggeringUser | ( | ) |
LinksUpdate::incrTableUpdate | ( | $table, | |
$prefix, | |||
$deletions, | |||
$insertions | |||
) |
Update a table by doing a delete query then an insert query.
string | $table | Table name |
string | $prefix | Field name prefix |
array | $deletions | |
array | $insertions | Rows to insert |
Definition at line 310 of file LinksUpdate.php.
References $mId, and Hooks\run().
Referenced by doIncrementalUpdate().
LinksUpdate::invalidateCategories | ( | $cats | ) |
array | $cats |
Definition at line 280 of file LinksUpdate.php.
References SqlDataUpdate\invalidatePages(), and NS_CATEGORY.
Referenced by doIncrementalUpdate().
LinksUpdate::invalidateImageDescriptions | ( | $images | ) |
array | $images |
Definition at line 299 of file LinksUpdate.php.
References SqlDataUpdate\invalidatePages(), and NS_FILE.
Referenced by doIncrementalUpdate().
|
private |
Invalidate any necessary link lists related to page property changes.
array | $changed |
Definition at line 903 of file LinksUpdate.php.
References $name, $value, DeferredUpdates\addUpdate(), as, and global.
Referenced by doIncrementalUpdate().
|
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 235 of file LinksUpdate.php.
References $title, as, RefreshLinksJob\newPrioritized(), NS_FILE, and JobQueueGroup\singleton().
Referenced by doIncrementalUpdate().
|
static |
Queue a RefreshLinks job for any table.
Definition at line 261 of file LinksUpdate.php.
References $job, Title\getBacklinkCache(), Job\newRootJobParams(), and JobQueueGroup\singleton().
Referenced by WikiPage\doDeleteUpdates(), and LocalFile\recordUpload2().
LinksUpdate::setRevision | ( | Revision | $revision | ) |
Set the revision corresponding to this LinksUpdate.
Revision | $revision |
Definition at line 877 of file LinksUpdate.php.
LinksUpdate::setTriggeringUser | ( | User | $user | ) |
Set the User who triggered this LinksUpdate.
User | $user |
Definition at line 887 of file LinksUpdate.php.
LinksUpdate::updateCategoryCounts | ( | $added, | |
$deleted | |||
) |
Update all the appropriate counts in the category table.
array | $added | Associative array of category name => sort key |
array | $deleted | Associative array of category name => sort key |
Definition at line 289 of file LinksUpdate.php.
References WikiPage\factory().
Referenced by doIncrementalUpdate().
|
protected |
Update links table freshness.
Definition at line 958 of file LinksUpdate.php.
References $mId, and $timestamp.
Referenced by doIncrementalUpdate().
|
private |
Deleted links if calculated.
Definition at line 78 of file LinksUpdate.php.
|
private |
Added links if calculated.
Definition at line 73 of file LinksUpdate.php.
array LinksUpdate::$mCategories |
Map of category names to sort keys.
Definition at line 53 of file LinksUpdate.php.
array LinksUpdate::$mExternals |
URLs of external links, array key only.
Definition at line 50 of file LinksUpdate.php.
int LinksUpdate::$mId |
Page ID of the article linked from.
Definition at line 32 of file LinksUpdate.php.
Referenced by getCategoryInsertions(), getExternalInsertions(), getImageInsertions(), getInterlangInsertions(), getInterwikiInsertions(), getLinkInsertions(), getPagePropRowData(), getTemplateInsertions(), incrTableUpdate(), and updateLinksTimestamp().
array LinksUpdate::$mImages |
DB keys of the images used, in the array key only.
Definition at line 44 of file LinksUpdate.php.
Referenced by getImages().
array LinksUpdate::$mInterlangs |
Map of language codes to titles.
Definition at line 56 of file LinksUpdate.php.
array LinksUpdate::$mInterwikis |
2-D map of (prefix => DBK => 1)
Definition at line 59 of file LinksUpdate.php.
array LinksUpdate::$mLinks |
Map of title strings to IDs for the links in the document.
Definition at line 41 of file LinksUpdate.php.
ParserOutput LinksUpdate::$mParserOutput |
Definition at line 38 of file LinksUpdate.php.
Referenced by getParserOutput().
array LinksUpdate::$mProperties |
Map of arbitrary name to value.
Definition at line 62 of file LinksUpdate.php.
bool LinksUpdate::$mRecursive |
Whether to queue jobs for recursive updates.
Definition at line 65 of file LinksUpdate.php.
Referenced by getAsJobSpecification().
|
private |
Revision for which this update has been triggered.
Definition at line 68 of file LinksUpdate.php.
array LinksUpdate::$mTemplates |
Map of title strings to IDs for the template references, including broken ones.
Definition at line 47 of file LinksUpdate.php.
Title LinksUpdate::$mTitle |
Title object of the article linked from.
Definition at line 35 of file LinksUpdate.php.
Referenced by getTitle().
|
private |
Definition at line 83 of file LinksUpdate.php.
Referenced by getTriggeringUser(), and setTriggeringUser().