3 * See docs/deferred.txt
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 * http://www.gnu.org/copyleft/gpl.html
20 * @todo document (e.g. one-sentence top-level class description).
22 class LinksUpdate
extends SecondaryDBDataUpdate
{
27 var $mId, //!< Page ID of the article linked from
28 $mTitle, //!< Title object of the article linked from
29 $mParserOutput, //!< Whether to queue jobs for recursive update
30 $mLinks, //!< Map of title strings to IDs for the links in the document
31 $mImages, //!< DB keys of the images used, in the array key only
32 $mTemplates, //!< Map of title strings to IDs for the template references, including broken ones
33 $mExternals, //!< URLs of external links, array key only
34 $mCategories, //!< Map of category names to sort keys
35 $mInterlangs, //!< Map of language codes to titles
36 $mProperties, //!< Map of arbitrary name to value
37 $mRecursive; //!< Whether to queue jobs for recursive updates
43 * @param $title Title of the page we're updating
44 * @param $parserOutput ParserOutput: output from a full parse of this page
45 * @param $recursive Boolean: queue jobs for recursive updates?
47 function __construct( $title, $parserOutput, $recursive = true ) {
48 parent
::__construct( );
50 if ( !is_object( $title ) ) {
51 throw new MWException( "The calling convention to LinksUpdate::LinksUpdate() has changed. " .
52 "Please see Article::editUpdates() for an invocation example.\n" );
55 if ( !is_object( $parserOutput ) ) {
56 throw new MWException( "The calling convention to LinksUpdate::__construct() has changed. " .
57 "Please see WikiPage::doEditUpdates() for an invocation example.\n" );
60 $this->mTitle
= $title;
61 $this->mId
= $title->getArticleID();
63 $this->mParserOutput
= $parserOutput;
65 $this->mLinks
= $parserOutput->getLinks();
66 $this->mImages
= $parserOutput->getImages();
67 $this->mTemplates
= $parserOutput->getTemplates();
68 $this->mExternals
= $parserOutput->getExternalLinks();
69 $this->mCategories
= $parserOutput->getCategories();
70 $this->mProperties
= $parserOutput->getProperties();
71 $this->mInterwikis
= $parserOutput->getInterwikiLinks();
73 # Convert the format of the interlanguage links
74 # I didn't want to change it in the ParserOutput, because that array is passed all
75 # the way back to the skin, so either a skin API break would be required, or an
76 # inefficient back-conversion.
77 $ill = $parserOutput->getLanguageLinks();
78 $this->mInterlangs
= array();
79 foreach ( $ill as $link ) {
80 list( $key, $title ) = explode( ':', $link, 2 );
81 $this->mInterlangs
[$key] = $title;
84 foreach ( $this->mCategories
as &$sortkey ) {
85 # If the sortkey is longer then 255 bytes,
86 # it truncated by DB, and then doesn't get
87 # matched when comparing existing vs current
88 # categories, causing bug 25254.
89 # Also. substr behaves weird when given "".
90 if ( $sortkey !== '' ) {
91 $sortkey = substr( $sortkey, 0, 255 );
95 $this->mRecursive
= $recursive;
97 wfRunHooks( 'LinksUpdateConstructed', array( &$this ) );
101 * Update link tables with outgoing links from an updated article
103 public function doUpdate() {
104 global $wgUseDumbLinkUpdate;
106 wfRunHooks( 'LinksUpdate', array( &$this ) );
107 if ( $wgUseDumbLinkUpdate ) {
108 $this->doDumbUpdate();
110 $this->doIncrementalUpdate();
112 wfRunHooks( 'LinksUpdateComplete', array( &$this ) );
115 protected function doIncrementalUpdate() {
116 wfProfileIn( __METHOD__
);
119 $existing = $this->getExistingLinks();
120 $this->incrTableUpdate( 'pagelinks', 'pl', $this->getLinkDeletions( $existing ),
121 $this->getLinkInsertions( $existing ) );
124 $existing = $this->getExistingImages();
126 $imageDeletes = $this->getImageDeletions( $existing );
127 $this->incrTableUpdate( 'imagelinks', 'il', $imageDeletes,
128 $this->getImageInsertions( $existing ) );
130 # Invalidate all image description pages which had links added or removed
131 $imageUpdates = $imageDeletes +
array_diff_key( $this->mImages
, $existing );
132 $this->invalidateImageDescriptions( $imageUpdates );
135 $existing = $this->getExistingExternals();
136 $this->incrTableUpdate( 'externallinks', 'el', $this->getExternalDeletions( $existing ),
137 $this->getExternalInsertions( $existing ) );
140 $existing = $this->getExistingInterlangs();
141 $this->incrTableUpdate( 'langlinks', 'll', $this->getInterlangDeletions( $existing ),
142 $this->getInterlangInsertions( $existing ) );
144 # Inline interwiki links
145 $existing = $this->getExistingInterwikis();
146 $this->incrTableUpdate( 'iwlinks', 'iwl', $this->getInterwikiDeletions( $existing ),
147 $this->getInterwikiInsertions( $existing ) );
150 $existing = $this->getExistingTemplates();
151 $this->incrTableUpdate( 'templatelinks', 'tl', $this->getTemplateDeletions( $existing ),
152 $this->getTemplateInsertions( $existing ) );
155 $existing = $this->getExistingCategories();
157 $categoryDeletes = $this->getCategoryDeletions( $existing );
159 $this->incrTableUpdate( 'categorylinks', 'cl', $categoryDeletes,
160 $this->getCategoryInsertions( $existing ) );
162 # Invalidate all categories which were added, deleted or changed (set symmetric difference)
163 $categoryInserts = array_diff_assoc( $this->mCategories
, $existing );
164 $categoryUpdates = $categoryInserts +
$categoryDeletes;
165 $this->invalidateCategories( $categoryUpdates );
166 $this->updateCategoryCounts( $categoryInserts, $categoryDeletes );
169 $existing = $this->getExistingProperties();
171 $propertiesDeletes = $this->getPropertyDeletions( $existing );
173 $this->incrTableUpdate( 'page_props', 'pp', $propertiesDeletes,
174 $this->getPropertyInsertions( $existing ) );
176 # Invalidate the necessary pages
177 $changed = $propertiesDeletes +
array_diff_assoc( $this->mProperties
, $existing );
178 $this->invalidateProperties( $changed );
180 # Refresh links of all pages including this page
181 # This will be in a separate transaction
182 if ( $this->mRecursive
) {
183 $this->queueRecursiveJobs();
186 wfProfileOut( __METHOD__
);
190 * Link update which clears the previous entries and inserts new ones
191 * May be slower or faster depending on level of lock contention and write speed of DB
192 * Also useful where link table corruption needs to be repaired, e.g. in refreshLinks.php
194 protected function doDumbUpdate() {
195 wfProfileIn( __METHOD__
);
197 # Refresh category pages and image description pages
198 $existing = $this->getExistingCategories();
199 $categoryInserts = array_diff_assoc( $this->mCategories
, $existing );
200 $categoryDeletes = array_diff_assoc( $existing, $this->mCategories
);
201 $categoryUpdates = $categoryInserts +
$categoryDeletes;
202 $existing = $this->getExistingImages();
203 $imageUpdates = array_diff_key( $existing, $this->mImages
) +
array_diff_key( $this->mImages
, $existing );
205 $this->dumbTableUpdate( 'pagelinks', $this->getLinkInsertions(), 'pl_from' );
206 $this->dumbTableUpdate( 'imagelinks', $this->getImageInsertions(), 'il_from' );
207 $this->dumbTableUpdate( 'categorylinks', $this->getCategoryInsertions(), 'cl_from' );
208 $this->dumbTableUpdate( 'templatelinks', $this->getTemplateInsertions(), 'tl_from' );
209 $this->dumbTableUpdate( 'externallinks', $this->getExternalInsertions(), 'el_from' );
210 $this->dumbTableUpdate( 'langlinks', $this->getInterlangInsertions(),'ll_from' );
211 $this->dumbTableUpdate( 'iwlinks', $this->getInterwikiInsertions(),'iwl_from' );
212 $this->dumbTableUpdate( 'page_props', $this->getPropertyInsertions(), 'pp_page' );
214 # Update the cache of all the category pages and image description
215 # pages which were changed, and fix the category table count
216 $this->invalidateCategories( $categoryUpdates );
217 $this->updateCategoryCounts( $categoryInserts, $categoryDeletes );
218 $this->invalidateImageDescriptions( $imageUpdates );
220 # Refresh links of all pages including this page
221 # This will be in a separate transaction
222 if ( $this->mRecursive
) {
223 $this->queueRecursiveJobs();
226 wfProfileOut( __METHOD__
);
229 function queueRecursiveJobs() {
230 global $wgUpdateRowsPerJob;
231 wfProfileIn( __METHOD__
);
233 $cache = $this->mTitle
->getBacklinkCache();
234 $batches = $cache->partition( 'templatelinks', $wgUpdateRowsPerJob );
236 wfProfileOut( __METHOD__
);
240 foreach ( $batches as $batch ) {
241 list( $start, $end ) = $batch;
243 'table' => 'templatelinks',
247 $jobs[] = new RefreshLinksJob2( $this->mTitle
, $params );
249 Job
::batchInsert( $jobs );
251 wfProfileOut( __METHOD__
);
257 function invalidateCategories( $cats ) {
258 $this->invalidatePages( NS_CATEGORY
, array_keys( $cats ) );
262 * Update all the appropriate counts in the category table.
263 * @param $added array associative array of category name => sort key
264 * @param $deleted array associative array of category name => sort key
266 function updateCategoryCounts( $added, $deleted ) {
267 $a = WikiPage
::factory( $this->mTitle
);
268 $a->updateCategoryCounts(
269 array_keys( $added ), array_keys( $deleted )
276 function invalidateImageDescriptions( $images ) {
277 $this->invalidatePages( NS_FILE
, array_keys( $images ) );
285 private function dumbTableUpdate( $table, $insertions, $fromField ) {
286 $this->mDb
->delete( $table, array( $fromField => $this->mId
), __METHOD__
);
287 if ( count( $insertions ) ) {
288 # The link array was constructed without FOR UPDATE, so there may
289 # be collisions. This may cause minor link table inconsistencies,
290 # which is better than crippling the site with lock contention.
291 $this->mDb
->insert( $table, $insertions, __METHOD__
, array( 'IGNORE' ) );
296 * Update a table by doing a delete query then an insert query
302 function incrTableUpdate( $table, $prefix, $deletions, $insertions ) {
303 if ( $table == 'page_props' ) {
304 $fromField = 'pp_page';
306 $fromField = "{$prefix}_from";
308 $where = array( $fromField => $this->mId
);
309 if ( $table == 'pagelinks' ||
$table == 'templatelinks' ||
$table == 'iwlinks' ) {
310 if ( $table == 'iwlinks' ) {
311 $baseKey = 'iwl_prefix';
313 $baseKey = "{$prefix}_namespace";
315 $clause = $this->mDb
->makeWhereFrom2d( $deletions, $baseKey, "{$prefix}_title" );
322 if ( $table == 'langlinks' ) {
323 $toField = 'll_lang';
324 } elseif ( $table == 'page_props' ) {
325 $toField = 'pp_propname';
327 $toField = $prefix . '_to';
329 if ( count( $deletions ) ) {
330 $where[] = "$toField IN (" . $this->mDb
->makeList( array_keys( $deletions ) ) . ')';
336 $this->mDb
->delete( $table, $where, __METHOD__
);
338 if ( count( $insertions ) ) {
339 $this->mDb
->insert( $table, $insertions, __METHOD__
, 'IGNORE' );
344 * Get an array of pagelinks insertions for passing to the DB
345 * Skips the titles specified by the 2-D array $existing
346 * @param $existing array
349 private function getLinkInsertions( $existing = array() ) {
351 foreach( $this->mLinks
as $ns => $dbkeys ) {
352 $diffs = isset( $existing[$ns] )
353 ?
array_diff_key( $dbkeys, $existing[$ns] )
355 foreach ( $diffs as $dbk => $id ) {
357 'pl_from' => $this->mId
,
358 'pl_namespace' => $ns,
367 * Get an array of template insertions. Like getLinkInsertions()
368 * @param $existing array
371 private function getTemplateInsertions( $existing = array() ) {
373 foreach( $this->mTemplates
as $ns => $dbkeys ) {
374 $diffs = isset( $existing[$ns] ) ?
array_diff_key( $dbkeys, $existing[$ns] ) : $dbkeys;
375 foreach ( $diffs as $dbk => $id ) {
377 'tl_from' => $this->mId
,
378 'tl_namespace' => $ns,
387 * Get an array of image insertions
388 * Skips the names specified in $existing
389 * @param $existing array
392 private function getImageInsertions( $existing = array() ) {
394 $diffs = array_diff_key( $this->mImages
, $existing );
395 foreach( $diffs as $iname => $dummy ) {
397 'il_from' => $this->mId
,
405 * Get an array of externallinks insertions. Skips the names specified in $existing
406 * @param $existing array
409 private function getExternalInsertions( $existing = array() ) {
411 $diffs = array_diff_key( $this->mExternals
, $existing );
412 foreach( $diffs as $url => $dummy ) {
413 foreach( wfMakeUrlIndexes( $url ) as $index ) {
415 'el_from' => $this->mId
,
417 'el_index' => $index,
425 * Get an array of category insertions
427 * @param $existing array mapping existing category names to sort keys. If both
428 * match a link in $this, the link will be omitted from the output
432 private function getCategoryInsertions( $existing = array() ) {
433 global $wgContLang, $wgCategoryCollation;
434 $diffs = array_diff_assoc( $this->mCategories
, $existing );
436 foreach ( $diffs as $name => $prefix ) {
437 $nt = Title
::makeTitleSafe( NS_CATEGORY
, $name );
438 $wgContLang->findVariantLink( $name, $nt, true );
440 if ( $this->mTitle
->getNamespace() == NS_CATEGORY
) {
442 } elseif ( $this->mTitle
->getNamespace() == NS_FILE
) {
448 # Treat custom sortkeys as a prefix, so that if multiple
449 # things are forced to sort as '*' or something, they'll
450 # sort properly in the category rather than in page_id
452 $sortkey = Collation
::singleton()->getSortKey(
453 $this->mTitle
->getCategorySortkey( $prefix ) );
456 'cl_from' => $this->mId
,
458 'cl_sortkey' => $sortkey,
459 'cl_timestamp' => $this->mDb
->timestamp(),
460 'cl_sortkey_prefix' => $prefix,
461 'cl_collation' => $wgCategoryCollation,
469 * Get an array of interlanguage link insertions
471 * @param $existing Array mapping existing language codes to titles
475 private function getInterlangInsertions( $existing = array() ) {
476 $diffs = array_diff_assoc( $this->mInterlangs
, $existing );
478 foreach( $diffs as $lang => $title ) {
480 'll_from' => $this->mId
,
489 * Get an array of page property insertions
490 * @param $existing array
493 function getPropertyInsertions( $existing = array() ) {
494 $diffs = array_diff_assoc( $this->mProperties
, $existing );
496 foreach ( $diffs as $name => $value ) {
498 'pp_page' => $this->mId
,
499 'pp_propname' => $name,
500 'pp_value' => $value,
507 * Get an array of interwiki insertions for passing to the DB
508 * Skips the titles specified by the 2-D array $existing
509 * @param $existing array
512 private function getInterwikiInsertions( $existing = array() ) {
514 foreach( $this->mInterwikis
as $prefix => $dbkeys ) {
515 $diffs = isset( $existing[$prefix] ) ?
array_diff_key( $dbkeys, $existing[$prefix] ) : $dbkeys;
516 foreach ( $diffs as $dbk => $id ) {
518 'iwl_from' => $this->mId
,
519 'iwl_prefix' => $prefix,
528 * Given an array of existing links, returns those links which are not in $this
529 * and thus should be deleted.
530 * @param $existing array
533 private function getLinkDeletions( $existing ) {
535 foreach ( $existing as $ns => $dbkeys ) {
536 if ( isset( $this->mLinks
[$ns] ) ) {
537 $del[$ns] = array_diff_key( $existing[$ns], $this->mLinks
[$ns] );
539 $del[$ns] = $existing[$ns];
546 * Given an array of existing templates, returns those templates which are not in $this
547 * and thus should be deleted.
548 * @param $existing array
551 private function getTemplateDeletions( $existing ) {
553 foreach ( $existing as $ns => $dbkeys ) {
554 if ( isset( $this->mTemplates
[$ns] ) ) {
555 $del[$ns] = array_diff_key( $existing[$ns], $this->mTemplates
[$ns] );
557 $del[$ns] = $existing[$ns];
564 * Given an array of existing images, returns those images which are not in $this
565 * and thus should be deleted.
566 * @param $existing array
569 private function getImageDeletions( $existing ) {
570 return array_diff_key( $existing, $this->mImages
);
574 * Given an array of existing external links, returns those links which are not
575 * in $this and thus should be deleted.
576 * @param $existing array
579 private function getExternalDeletions( $existing ) {
580 return array_diff_key( $existing, $this->mExternals
);
584 * Given an array of existing categories, returns those categories which are not in $this
585 * and thus should be deleted.
586 * @param $existing array
589 private function getCategoryDeletions( $existing ) {
590 return array_diff_assoc( $existing, $this->mCategories
);
594 * Given an array of existing interlanguage links, returns those links which are not
595 * in $this and thus should be deleted.
596 * @param $existing array
599 private function getInterlangDeletions( $existing ) {
600 return array_diff_assoc( $existing, $this->mInterlangs
);
604 * Get array of properties which should be deleted.
605 * @param $existing array
608 function getPropertyDeletions( $existing ) {
609 return array_diff_assoc( $existing, $this->mProperties
);
613 * Given an array of existing interwiki links, returns those links which are not in $this
614 * and thus should be deleted.
615 * @param $existing array
618 private function getInterwikiDeletions( $existing ) {
620 foreach ( $existing as $prefix => $dbkeys ) {
621 if ( isset( $this->mInterwikis
[$prefix] ) ) {
622 $del[$prefix] = array_diff_key( $existing[$prefix], $this->mInterwikis
[$prefix] );
624 $del[$prefix] = $existing[$prefix];
631 * Get an array of existing links, as a 2-D array
635 private function getExistingLinks() {
636 $res = $this->mDb
->select( 'pagelinks', array( 'pl_namespace', 'pl_title' ),
637 array( 'pl_from' => $this->mId
), __METHOD__
, $this->mOptions
);
639 foreach ( $res as $row ) {
640 if ( !isset( $arr[$row->pl_namespace
] ) ) {
641 $arr[$row->pl_namespace
] = array();
643 $arr[$row->pl_namespace
][$row->pl_title
] = 1;
649 * Get an array of existing templates, as a 2-D array
653 private function getExistingTemplates() {
654 $res = $this->mDb
->select( 'templatelinks', array( 'tl_namespace', 'tl_title' ),
655 array( 'tl_from' => $this->mId
), __METHOD__
, $this->mOptions
);
657 foreach ( $res as $row ) {
658 if ( !isset( $arr[$row->tl_namespace
] ) ) {
659 $arr[$row->tl_namespace
] = array();
661 $arr[$row->tl_namespace
][$row->tl_title
] = 1;
667 * Get an array of existing images, image names in the keys
671 private function getExistingImages() {
672 $res = $this->mDb
->select( 'imagelinks', array( 'il_to' ),
673 array( 'il_from' => $this->mId
), __METHOD__
, $this->mOptions
);
675 foreach ( $res as $row ) {
676 $arr[$row->il_to
] = 1;
682 * Get an array of existing external links, URLs in the keys
686 private function getExistingExternals() {
687 $res = $this->mDb
->select( 'externallinks', array( 'el_to' ),
688 array( 'el_from' => $this->mId
), __METHOD__
, $this->mOptions
);
690 foreach ( $res as $row ) {
691 $arr[$row->el_to
] = 1;
697 * Get an array of existing categories, with the name in the key and sort key in the value.
701 private function getExistingCategories() {
702 $res = $this->mDb
->select( 'categorylinks', array( 'cl_to', 'cl_sortkey_prefix' ),
703 array( 'cl_from' => $this->mId
), __METHOD__
, $this->mOptions
);
705 foreach ( $res as $row ) {
706 $arr[$row->cl_to
] = $row->cl_sortkey_prefix
;
712 * Get an array of existing interlanguage links, with the language code in the key and the
713 * title in the value.
717 private function getExistingInterlangs() {
718 $res = $this->mDb
->select( 'langlinks', array( 'll_lang', 'll_title' ),
719 array( 'll_from' => $this->mId
), __METHOD__
, $this->mOptions
);
721 foreach ( $res as $row ) {
722 $arr[$row->ll_lang
] = $row->ll_title
;
728 * Get an array of existing inline interwiki links, as a 2-D array
729 * @return array (prefix => array(dbkey => 1))
731 protected function getExistingInterwikis() {
732 $res = $this->mDb
->select( 'iwlinks', array( 'iwl_prefix', 'iwl_title' ),
733 array( 'iwl_from' => $this->mId
), __METHOD__
, $this->mOptions
);
735 foreach ( $res as $row ) {
736 if ( !isset( $arr[$row->iwl_prefix
] ) ) {
737 $arr[$row->iwl_prefix
] = array();
739 $arr[$row->iwl_prefix
][$row->iwl_title
] = 1;
745 * Get an array of existing categories, with the name in the key and sort key in the value.
749 private function getExistingProperties() {
750 $res = $this->mDb
->select( 'page_props', array( 'pp_propname', 'pp_value' ),
751 array( 'pp_page' => $this->mId
), __METHOD__
, $this->mOptions
);
753 foreach ( $res as $row ) {
754 $arr[$row->pp_propname
] = $row->pp_value
;
760 * Return the title object of the page being updated
763 public function getTitle() {
764 return $this->mTitle
;
768 * Returns parser output
770 * @return ParserOutput
772 public function getParserOutput() {
773 return $this->mParserOutput
;
777 * Return the list of images used as generated by the parser
780 public function getImages() {
781 return $this->mImages
;
785 * Invalidate any necessary link lists related to page property changes
788 private function invalidateProperties( $changed ) {
789 global $wgPagePropLinkInvalidations;
791 foreach ( $changed as $name => $value ) {
792 if ( isset( $wgPagePropLinkInvalidations[$name] ) ) {
793 $inv = $wgPagePropLinkInvalidations[$name];
794 if ( !is_array( $inv ) ) {
795 $inv = array( $inv );
797 foreach ( $inv as $table ) {
798 $update = new HTMLCacheUpdate( $this->mTitle
, $table );
807 * Update object handling the cleanup of links tables after a page was deleted.
809 class LinksDeletionUpdate
extends SecondaryDBDataUpdate
{
814 var $mWikiPage; //!< WikiPage the wikipage that was deleted
820 * @param $title Title of the page we're updating
821 * @param $parserOutput ParserOutput: output from a full parse of this page
822 * @param $recursive Boolean: queue jobs for recursive updates?
824 function __construct( WikiPage
$page ) {
825 parent
::__construct( );
827 $this->mPage
= $page;
831 * Do some database updates after deletion
833 public function doUpdate() {
834 $title = $this->mPage
->getTitle();
835 $id = $this->mPage
->getId();
837 # Delete restrictions for it
838 $this->mDb
->delete( 'page_restrictions', array ( 'pr_page' => $id ), __METHOD__
);
840 # Fix category table counts
842 $res = $this->mDb
->select( 'categorylinks', 'cl_to', array( 'cl_from' => $id ), __METHOD__
);
844 foreach ( $res as $row ) {
845 $cats [] = $row->cl_to
;
848 $this->mPage
->updateCategoryCounts( array(), $cats );
850 # If using cascading deletes, we can skip some explicit deletes
851 if ( !$this->mDb
->cascadingDeletes() ) {
852 $this->mDb
->delete( 'revision', array( 'rev_page' => $id ), __METHOD__
);
854 # Delete outgoing links
855 $this->mDb
->delete( 'pagelinks', array( 'pl_from' => $id ), __METHOD__
);
856 $this->mDb
->delete( 'imagelinks', array( 'il_from' => $id ), __METHOD__
);
857 $this->mDb
->delete( 'categorylinks', array( 'cl_from' => $id ), __METHOD__
);
858 $this->mDb
->delete( 'templatelinks', array( 'tl_from' => $id ), __METHOD__
);
859 $this->mDb
->delete( 'externallinks', array( 'el_from' => $id ), __METHOD__
);
860 $this->mDb
->delete( 'langlinks', array( 'll_from' => $id ), __METHOD__
);
861 $this->mDb
->delete( 'iwlinks', array( 'iwl_from' => $id ), __METHOD__
);
862 $this->mDb
->delete( 'redirect', array( 'rd_from' => $id ), __METHOD__
);
863 $this->mDb
->delete( 'page_props', array( 'pp_page' => $id ), __METHOD__
);
866 # If using cleanup triggers, we can skip some manual deletes
867 if ( !$this->mDb
->cleanupTriggers() ) {
868 # Clean up recentchanges entries...
869 $this->mDb
->delete( 'recentchanges',
870 array( 'rc_type != ' . RC_LOG
,
871 'rc_namespace' => $title->getNamespace(),
872 'rc_title' => $title->getDBkey() ),
874 $this->mDb
->delete( 'recentchanges',
875 array( 'rc_type != ' . RC_LOG
, 'rc_cur_id' => $id ),