MediaWiki
REL1_24
|
See docs/deferred.txt. More...
Public Member Functions | |
__construct ($title, $parserOutput, $recursive=true) | |
Constructor. | |
doUpdate () | |
Update link tables with outgoing links from an updated article. | |
getAddedLinks () | |
Fetch page links added by this LinksUpdate. | |
getImages () | |
Return the list of images used as generated by the parser. | |
getParserOutput () | |
Returns parser output. | |
getPropertyDeletions ($existing) | |
Get array of properties which should be deleted. | |
getPropertyInsertions ($existing=array()) | |
Get an array of page property insertions. | |
getRemovedLinks () | |
Fetch page links removed by this LinksUpdate. | |
getTitle () | |
Return the title object of the page being updated. | |
incrTableUpdate ($table, $prefix, $deletions, $insertions) | |
Update a table by doing a delete query then an insert query. | |
invalidateCategories ($cats) | |
invalidateImageDescriptions ($images) | |
queueRecursiveJobs () | |
Queue recursive jobs for this page. | |
updateCategoryCounts ($added, $deleted) | |
Update all the appropriate counts in the category table. | |
Static Public Member Functions | |
static | queueRecursiveJobsForTable (Title $title, $table) |
Queue a RefreshLinks job for any table. | |
Public Attributes | |
array | $mCategories |
Map of category names to sort keys *. | |
DatabaseBase | $mDb |
Database connection reference *. | |
array | $mExternals |
URLs of external links, array key only *. | |
int | $mId |
Page ID of the article linked from *. | |
array | $mImages |
DB keys of the images used, in the array key only *. | |
array | $mInterlangs |
Map of language codes to titles *. | |
array | $mLinks |
Map of title strings to IDs for the links in the document *. | |
array | $mOptions |
SELECT options to be used *. | |
ParserOutput | $mParserOutput |
* | |
array | $mProperties |
Map of arbitrary name to value *. | |
bool | $mRecursive |
Whether to queue jobs for recursive updates *. | |
array | $mTemplates |
Map of title strings to IDs for the template references, including broken ones *. | |
Title | $mTitle |
Title object of the article linked from *. | |
Protected Member Functions | |
doIncrementalUpdate () | |
getExistingInterwikis () | |
Get an array of existing inline interwiki links, as a 2-D array. | |
updateLinksTimestamp () | |
Update links table freshness. | |
Private Member Functions | |
getCategoryDeletions ($existing) | |
Given an array of existing categories, returns those categories which are not in $this and thus should be deleted. | |
getCategoryInsertions ($existing=array()) | |
Get an array of category insertions. | |
getExistingCategories () | |
Get an array of existing categories, with the name in the key and sort key in the value. | |
getExistingExternals () | |
Get an array of existing external links, URLs in the keys. | |
getExistingImages () | |
Get an array of existing images, image names in the keys. | |
getExistingInterlangs () | |
Get an array of existing interlanguage links, with the language code in the key and the title in the value. | |
getExistingLinks () | |
Get an array of existing links, as a 2-D array. | |
getExistingProperties () | |
Get an array of existing categories, with the name in the key and sort key in the value. | |
getExistingTemplates () | |
Get an array of existing templates, as a 2-D array. | |
getExternalDeletions ($existing) | |
Given an array of existing external links, returns those links which are not in $this and thus should be deleted. | |
getExternalInsertions ($existing=array()) | |
Get an array of externallinks insertions. | |
getImageDeletions ($existing) | |
Given an array of existing images, returns those images which are not in $this and thus should be deleted. | |
getImageInsertions ($existing=array()) | |
Get an array of image insertions Skips the names specified in $existing. | |
getInterlangDeletions ($existing) | |
Given an array of existing interlanguage links, returns those links which are not in $this and thus should be deleted. | |
getInterlangInsertions ($existing=array()) | |
Get an array of interlanguage link insertions. | |
getInterwikiDeletions ($existing) | |
Given an array of existing interwiki links, returns those links which are not in $this and thus should be deleted. | |
getInterwikiInsertions ($existing=array()) | |
Get an array of interwiki insertions for passing to the DB Skips the titles specified by the 2-D array $existing. | |
getLinkDeletions ($existing) | |
Given an array of existing links, returns those links which are not in $this and thus should be deleted. | |
getLinkInsertions ($existing=array()) | |
Get an array of pagelinks insertions for passing to the DB Skips the titles specified by the 2-D array $existing. | |
getPagePropRowData ($prop) | |
Returns an associative array to be used for inserting a row into the page_props table. | |
getPropertySortKeyValue ($value) | |
Determines the sort key for the given property value. | |
getTemplateDeletions ($existing) | |
Given an array of existing templates, returns those templates which are not in $this and thus should be deleted. | |
getTemplateInsertions ($existing=array()) | |
Get an array of template insertions. | |
invalidateProperties ($changed) | |
Invalidate any necessary link lists related to page property changes. | |
Private Attributes | |
null array | $linkDeletions = null |
Deleted links if calculated. | |
null array | $linkInsertions = null |
Added links if calculated. |
See docs/deferred.txt.
Definition at line 28 of file LinksUpdate.php.
LinksUpdate::__construct | ( | $ | title, |
$ | 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 73 of file LinksUpdate.php.
References $key, $link, $title, DataUpdate\__construct(), array(), as, and list.
LinksUpdate::doIncrementalUpdate | ( | ) | [protected] |
Definition at line 140 of file LinksUpdate.php.
Update link tables with outgoing links from an updated article.
Implements DeferrableUpdate.
Definition at line 134 of file LinksUpdate.php.
Fetch page links added by this LinksUpdate.
Only available after the update is complete.
Definition at line 875 of file LinksUpdate.php.
LinksUpdate::getCategoryDeletions | ( | $ | existing | ) | [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 645 of file LinksUpdate.php.
LinksUpdate::getCategoryInsertions | ( | $ | existing = array() | ) | [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 428 of file LinksUpdate.php.
LinksUpdate::getExistingCategories | ( | ) | [private] |
Get an array of existing categories, with the name in the key and sort key in the value.
Definition at line 762 of file LinksUpdate.php.
LinksUpdate::getExistingExternals | ( | ) | [private] |
Get an array of existing external links, URLs in the keys.
Definition at line 746 of file LinksUpdate.php.
LinksUpdate::getExistingImages | ( | ) | [private] |
Get an array of existing images, image names in the keys.
Definition at line 730 of file LinksUpdate.php.
References array().
LinksUpdate::getExistingInterlangs | ( | ) | [private] |
Get an array of existing interlanguage links, with the language code in the key and the title in the value.
Definition at line 779 of file LinksUpdate.php.
LinksUpdate::getExistingInterwikis | ( | ) | [protected] |
Get an array of existing inline interwiki links, as a 2-D array.
Definition at line 794 of file LinksUpdate.php.
LinksUpdate::getExistingLinks | ( | ) | [private] |
Get an array of existing links, as a 2-D array.
Definition at line 692 of file LinksUpdate.php.
LinksUpdate::getExistingProperties | ( | ) | [private] |
Get an array of existing categories, with the name in the key and sort key in the value.
Definition at line 813 of file LinksUpdate.php.
References array().
LinksUpdate::getExistingTemplates | ( | ) | [private] |
Get an array of existing templates, as a 2-D array.
Definition at line 711 of file LinksUpdate.php.
References array().
LinksUpdate::getExternalDeletions | ( | $ | existing | ) | [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 635 of file LinksUpdate.php.
LinksUpdate::getExternalInsertions | ( | $ | existing = array() | ) | [private] |
Get an array of externallinks insertions.
Skips the names specified in $existing
array | $existing |
Definition at line 403 of file LinksUpdate.php.
LinksUpdate::getImageDeletions | ( | $ | existing | ) | [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 625 of file LinksUpdate.php.
LinksUpdate::getImageInsertions | ( | $ | existing = array() | ) | [private] |
Get an array of image insertions Skips the names specified in $existing.
array | $existing |
Definition at line 384 of file LinksUpdate.php.
Return the list of images used as generated by the parser.
Definition at line 845 of file LinksUpdate.php.
LinksUpdate::getInterlangDeletions | ( | $ | existing | ) | [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 655 of file LinksUpdate.php.
LinksUpdate::getInterlangInsertions | ( | $ | existing = array() | ) | [private] |
Get an array of interlanguage link insertions.
array | $existing | Mapping existing language codes to titles |
Definition at line 472 of file LinksUpdate.php.
LinksUpdate::getInterwikiDeletions | ( | $ | existing | ) | [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 674 of file LinksUpdate.php.
LinksUpdate::getInterwikiInsertions | ( | $ | existing = array() | ) | [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 562 of file LinksUpdate.php.
LinksUpdate::getLinkDeletions | ( | $ | existing | ) | [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 587 of file LinksUpdate.php.
LinksUpdate::getLinkInsertions | ( | $ | existing = array() | ) | [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 337 of file LinksUpdate.php.
LinksUpdate::getPagePropRowData | ( | $ | prop | ) | [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 518 of file LinksUpdate.php.
Returns parser output.
Definition at line 837 of file LinksUpdate.php.
LinksUpdate::getPropertyDeletions | ( | $ | existing | ) |
Get array of properties which should be deleted.
array | $existing |
Definition at line 664 of file LinksUpdate.php.
LinksUpdate::getPropertyInsertions | ( | $ | existing = array() | ) |
Get an array of page property insertions.
array | $existing |
Definition at line 491 of file LinksUpdate.php.
LinksUpdate::getPropertySortKeyValue | ( | $ | value | ) | [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 548 of file LinksUpdate.php.
Fetch page links removed by this LinksUpdate.
Only available after the update is complete.
Definition at line 892 of file LinksUpdate.php.
LinksUpdate::getTemplateDeletions | ( | $ | existing | ) | [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 606 of file LinksUpdate.php.
LinksUpdate::getTemplateInsertions | ( | $ | existing = array() | ) | [private] |
Get an array of template insertions.
Like getLinkInsertions()
array | $existing |
Definition at line 361 of file LinksUpdate.php.
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 289 of file LinksUpdate.php.
References SqlDataUpdate\invalidatePages().
LinksUpdate::invalidateCategories | ( | $ | cats | ) |
array | $cats |
Definition at line 259 of file LinksUpdate.php.
LinksUpdate::invalidateImageDescriptions | ( | $ | images | ) |
array | $images |
Definition at line 278 of file LinksUpdate.php.
LinksUpdate::invalidateProperties | ( | $ | changed | ) | [private] |
Invalidate any necessary link lists related to page property changes.
array | $changed |
Definition at line 853 of file LinksUpdate.php.
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 224 of file LinksUpdate.php.
static LinksUpdate::queueRecursiveJobsForTable | ( | Title $ | title, |
$ | table | ||
) | [static] |
Queue a RefreshLinks job for any table.
Definition at line 238 of file LinksUpdate.php.
Referenced by WikiPage\doDeleteUpdates().
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 268 of file LinksUpdate.php.
LinksUpdate::updateLinksTimestamp | ( | ) | [protected] |
Update links table freshness.
Definition at line 909 of file LinksUpdate.php.
null array LinksUpdate::$linkDeletions = null [private] |
Deleted links if calculated.
Definition at line 63 of file LinksUpdate.php.
null array LinksUpdate::$linkInsertions = null [private] |
Added links if calculated.
Definition at line 59 of file LinksUpdate.php.
array LinksUpdate::$mCategories |
Map of category names to sort keys *.
Definition at line 45 of file LinksUpdate.php.
DatabaseBase LinksUpdate::$mDb |
Database connection reference *.
Reimplemented from SqlDataUpdate.
Definition at line 51 of file LinksUpdate.php.
array LinksUpdate::$mExternals |
URLs of external links, array key only *.
Definition at line 43 of file LinksUpdate.php.
int LinksUpdate::$mId |
Page ID of the article linked from *.
Definition at line 31 of file LinksUpdate.php.
array LinksUpdate::$mImages |
DB keys of the images used, in the array key only *.
Definition at line 39 of file LinksUpdate.php.
array LinksUpdate::$mInterlangs |
Map of language codes to titles *.
Definition at line 47 of file LinksUpdate.php.
array LinksUpdate::$mLinks |
Map of title strings to IDs for the links in the document *.
Definition at line 37 of file LinksUpdate.php.
array LinksUpdate::$mOptions |
SELECT options to be used *.
Reimplemented from SqlDataUpdate.
Definition at line 53 of file LinksUpdate.php.
ParserOutput LinksUpdate::$mParserOutput |
*
Definition at line 35 of file LinksUpdate.php.
array LinksUpdate::$mProperties |
Map of arbitrary name to value *.
Definition at line 49 of file LinksUpdate.php.
bool LinksUpdate::$mRecursive |
Whether to queue jobs for recursive updates *.
Definition at line 55 of file LinksUpdate.php.
array LinksUpdate::$mTemplates |
Map of title strings to IDs for the template references, including broken ones *.
Definition at line 41 of file LinksUpdate.php.
Title LinksUpdate::$mTitle |
Title object of the article linked from *.
Definition at line 33 of file LinksUpdate.php.