MediaWiki
REL1_19
|
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. | |
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. | |
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) | |
invalidatePages ($namespace, $dbkeys) | |
Invalidate the cache of a list of pages from a single namespace. | |
queueRecursiveJobs () | |
updateCategoryCounts ($added, $deleted) | |
Update all the appropriate counts in the category table. | |
Public Attributes | |
$mId | |
Page ID of the article linked from. | |
$mTitle | |
Title object of the article linked from. | |
$mParserOutput | |
Parser output. | |
$mLinks | |
Map of title strings to IDs for the links in the document. | |
$mImages | |
DB keys of the images used, in the array key only. | |
$mTemplates | |
Map of title strings to IDs for the template references, including broken ones. | |
$mExternals | |
URLs of external links, array key only. | |
$mCategories | |
Map of category names to sort keys. | |
$mInterlangs | |
Map of language codes to titles. | |
$mProperties | |
Map of arbitrary name to value. | |
$mDb | |
Database connection reference. | |
$mOptions | |
SELECT options to be used (array) | |
$mRecursive | |
Whether to queue jobs for recursive updates. | |
Protected Member Functions | |
doDumbUpdate () | |
Link update which clears the previous entries and inserts new ones May be slower or faster depending on level of lock contention and write speed of DB Also useful where link table corruption needs to be repaired, e.g. | |
doIncrementalUpdate () | |
getExistingInterwikis () | |
Get an array of existing inline interwiki links, as a 2-D array. | |
Private Member Functions | |
dumbTableUpdate ($table, $insertions, $fromField) | |
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. | |
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. |
See docs/deferred.txt.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. http://www.gnu.org/copyleft/gpl.html
Definition at line 22 of file LinksUpdate.php.
LinksUpdate::__construct | ( | $ | title, |
$ | parserOutput, | ||
$ | recursive = true |
||
) |
Constructor.
$title | Title of the page we're updating |
$parserOutput | ParserOutput: output from a full parse of this page |
$recursive | Boolean: queue jobs for recursive updates? |
Definition at line 49 of file LinksUpdate.php.
References $title, $wgAntiLockFlags, wfGetDB(), and wfRunHooks().
LinksUpdate::doDumbUpdate | ( | ) | [protected] |
Link update which clears the previous entries and inserts new ones May be slower or faster depending on level of lock contention and write speed of DB Also useful where link table corruption needs to be repaired, e.g.
Definition at line 196 of file LinksUpdate.php.
References dumbTableUpdate(), getCategoryInsertions(), getExistingCategories(), getExistingImages(), getExternalInsertions(), getImageInsertions(), getInterlangInsertions(), getInterwikiInsertions(), getLinkInsertions(), getPropertyInsertions(), getTemplateInsertions(), invalidateCategories(), invalidateImageDescriptions(), queueRecursiveJobs(), updateCategoryCounts(), wfProfileIn(), and wfProfileOut().
Referenced by doUpdate().
LinksUpdate::doIncrementalUpdate | ( | ) | [protected] |
Definition at line 117 of file LinksUpdate.php.
References $changed, 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(), wfProfileIn(), and wfProfileOut().
Referenced by doUpdate().
Update link tables with outgoing links from an updated article.
Definition at line 105 of file LinksUpdate.php.
References $wgUseDumbLinkUpdate, doDumbUpdate(), doIncrementalUpdate(), and wfRunHooks().
LinksUpdate::dumbTableUpdate | ( | $ | table, |
$ | insertions, | ||
$ | fromField | ||
) | [private] |
$table | |
$insertions | |
$fromField |
Definition at line 332 of file LinksUpdate.php.
Referenced by doDumbUpdate().
LinksUpdate::getCategoryDeletions | ( | $ | existing | ) | [private] |
Given an array of existing categories, returns those categories which are not in $this and thus should be deleted.
$existing | array |
Definition at line 636 of file LinksUpdate.php.
Referenced by doIncrementalUpdate().
LinksUpdate::getCategoryInsertions | ( | $ | existing = array() | ) | [private] |
Get an array of category insertions.
$existing | array 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 479 of file LinksUpdate.php.
References $wgCategoryCollation, $wgContLang, Title\makeTitleSafe(), and Collation\singleton().
Referenced by doDumbUpdate(), and doIncrementalUpdate().
LinksUpdate::getExistingCategories | ( | ) | [private] |
Get an array of existing categories, with the name in the key and sort key in the value.
Definition at line 748 of file LinksUpdate.php.
References $res.
Referenced by doDumbUpdate(), and doIncrementalUpdate().
LinksUpdate::getExistingExternals | ( | ) | [private] |
Get an array of existing external links, URLs in the keys.
Definition at line 733 of file LinksUpdate.php.
References $res.
Referenced by doIncrementalUpdate().
LinksUpdate::getExistingImages | ( | ) | [private] |
Get an array of existing images, image names in the keys.
Definition at line 718 of file LinksUpdate.php.
References $res.
Referenced by doDumbUpdate(), and doIncrementalUpdate().
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 764 of file LinksUpdate.php.
References $res.
Referenced by doIncrementalUpdate().
LinksUpdate::getExistingInterwikis | ( | ) | [protected] |
Get an array of existing inline interwiki links, as a 2-D array.
Definition at line 778 of file LinksUpdate.php.
References $res.
Referenced by doIncrementalUpdate().
LinksUpdate::getExistingLinks | ( | ) | [private] |
Get an array of existing links, as a 2-D array.
Definition at line 682 of file LinksUpdate.php.
References $res.
Referenced by doIncrementalUpdate().
LinksUpdate::getExistingProperties | ( | ) | [private] |
Get an array of existing categories, with the name in the key and sort key in the value.
Definition at line 796 of file LinksUpdate.php.
References $res.
Referenced by doIncrementalUpdate().
LinksUpdate::getExistingTemplates | ( | ) | [private] |
Get an array of existing templates, as a 2-D array.
Definition at line 700 of file LinksUpdate.php.
References $res.
Referenced by doIncrementalUpdate().
LinksUpdate::getExternalDeletions | ( | $ | existing | ) | [private] |
Given an array of existing external links, returns those links which are not in $this and thus should be deleted.
$existing | array |
Definition at line 626 of file LinksUpdate.php.
Referenced by doIncrementalUpdate().
LinksUpdate::getExternalInsertions | ( | $ | existing = array() | ) | [private] |
Get an array of externallinks insertions.
Skips the names specified in $existing
$existing | array |
Definition at line 456 of file LinksUpdate.php.
References $url, and wfMakeUrlIndexes().
Referenced by doDumbUpdate(), and doIncrementalUpdate().
LinksUpdate::getImageDeletions | ( | $ | existing | ) | [private] |
Given an array of existing images, returns those images which are not in $this and thus should be deleted.
$existing | array |
Definition at line 616 of file LinksUpdate.php.
Referenced by doIncrementalUpdate().
LinksUpdate::getImageInsertions | ( | $ | existing = array() | ) | [private] |
Get an array of image insertions Skips the names specified in $existing.
$existing | array |
Definition at line 439 of file LinksUpdate.php.
Referenced by doDumbUpdate(), and doIncrementalUpdate().
Return the list of images used as generated by the parser.
Definition at line 827 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.
$existing | array |
Definition at line 646 of file LinksUpdate.php.
Referenced by doIncrementalUpdate().
LinksUpdate::getInterlangInsertions | ( | $ | existing = array() | ) | [private] |
Get an array of interlanguage link insertions.
$existing | Array mapping existing language codes to titles |
Definition at line 522 of file LinksUpdate.php.
References $title.
Referenced by doDumbUpdate(), and doIncrementalUpdate().
LinksUpdate::getInterwikiDeletions | ( | $ | existing | ) | [private] |
Given an array of existing interwiki links, returns those links which are not in $this and thus should be deleted.
$existing | array |
Definition at line 665 of file LinksUpdate.php.
Referenced by doIncrementalUpdate().
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.
$existing | array |
Definition at line 559 of file LinksUpdate.php.
Referenced by doDumbUpdate(), and doIncrementalUpdate().
LinksUpdate::getLinkDeletions | ( | $ | existing | ) | [private] |
Given an array of existing links, returns those links which are not in $this and thus should be deleted.
$existing | array |
Definition at line 580 of file LinksUpdate.php.
Referenced by doIncrementalUpdate().
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.
$existing | array |
Definition at line 396 of file LinksUpdate.php.
Referenced by doDumbUpdate(), and doIncrementalUpdate().
Returns parser output.
Definition at line 819 of file LinksUpdate.php.
LinksUpdate::getPropertyDeletions | ( | $ | existing | ) |
Get array of properties which should be deleted.
$existing | array |
Definition at line 655 of file LinksUpdate.php.
Referenced by doIncrementalUpdate().
LinksUpdate::getPropertyInsertions | ( | $ | existing = array() | ) |
Get an array of page property insertions.
$existing | array |
Definition at line 540 of file LinksUpdate.php.
Referenced by doDumbUpdate(), and doIncrementalUpdate().
LinksUpdate::getTemplateDeletions | ( | $ | existing | ) | [private] |
Given an array of existing templates, returns those templates which are not in $this and thus should be deleted.
$existing | array |
Definition at line 598 of file LinksUpdate.php.
Referenced by doIncrementalUpdate().
LinksUpdate::getTemplateInsertions | ( | $ | existing = array() | ) | [private] |
Get an array of template insertions.
Like getLinkInsertions()
$existing | array |
Definition at line 418 of file LinksUpdate.php.
Referenced by doDumbUpdate(), and doIncrementalUpdate().
Return the title object of the page being updated.
Definition at line 810 of file LinksUpdate.php.
LinksUpdate::incrTableUpdate | ( | $ | table, |
$ | prefix, | ||
$ | deletions, | ||
$ | insertions | ||
) |
Update a table by doing a delete query then an insert query.
$table | |
$prefix | |
$deletions | |
$insertions |
Definition at line 349 of file LinksUpdate.php.
Referenced by doIncrementalUpdate().
LinksUpdate::invalidateCategories | ( | $ | cats | ) |
$cats |
Definition at line 304 of file LinksUpdate.php.
References invalidatePages().
Referenced by doDumbUpdate(), and doIncrementalUpdate().
LinksUpdate::invalidateImageDescriptions | ( | $ | images | ) |
$images |
Definition at line 323 of file LinksUpdate.php.
References invalidatePages().
Referenced by doDumbUpdate(), and doIncrementalUpdate().
LinksUpdate::invalidatePages | ( | $ | namespace, |
$ | dbkeys | ||
) |
Invalidate the cache of a list of pages from a single namespace.
$namespace | Integer |
$dbkeys | Array |
Definition at line 262 of file LinksUpdate.php.
References $res.
Referenced by invalidateCategories(), and invalidateImageDescriptions().
LinksUpdate::invalidateProperties | ( | $ | changed | ) | [private] |
Invalidate any necessary link lists related to page property changes.
$changed |
Definition at line 835 of file LinksUpdate.php.
References $changed, and $wgPagePropLinkInvalidations.
Referenced by doIncrementalUpdate().
Definition at line 231 of file LinksUpdate.php.
References $wgUpdateRowsPerJob, Job\batchInsert(), wfProfileIn(), and wfProfileOut().
Referenced by doDumbUpdate(), and doIncrementalUpdate().
LinksUpdate::updateCategoryCounts | ( | $ | added, |
$ | deleted | ||
) |
Update all the appropriate counts in the category table.
$added | array associative array of category name => sort key |
$deleted | array associative array of category name => sort key |
Definition at line 313 of file LinksUpdate.php.
References WikiPage\factory().
Referenced by doDumbUpdate(), and doIncrementalUpdate().
LinksUpdate::$mCategories |
Map of category names to sort keys.
Definition at line 27 of file LinksUpdate.php.
LinksUpdate::$mDb |
Database connection reference.
Definition at line 27 of file LinksUpdate.php.
LinksUpdate::$mExternals |
URLs of external links, array key only.
Definition at line 27 of file LinksUpdate.php.
LinksUpdate::$mId |
LinksUpdate::$mImages |
DB keys of the images used, in the array key only.
Definition at line 27 of file LinksUpdate.php.
LinksUpdate::$mInterlangs |
Map of language codes to titles.
Definition at line 27 of file LinksUpdate.php.
LinksUpdate::$mLinks |
Map of title strings to IDs for the links in the document.
Definition at line 27 of file LinksUpdate.php.
LinksUpdate::$mOptions |
SELECT options to be used (array)
Definition at line 27 of file LinksUpdate.php.
LinksUpdate::$mParserOutput |
Parser output.
Definition at line 27 of file LinksUpdate.php.
LinksUpdate::$mProperties |
Map of arbitrary name to value.
Definition at line 27 of file LinksUpdate.php.
LinksUpdate::$mRecursive |
Whether to queue jobs for recursive updates.
Definition at line 27 of file LinksUpdate.php.
LinksUpdate::$mTemplates |
Map of title strings to IDs for the template references, including broken ones.
Definition at line 27 of file LinksUpdate.php.
LinksUpdate::$mTitle |
Title object of the article linked from.
Definition at line 27 of file LinksUpdate.php.