Fixed two bugs in message parameter handling:
[mediawiki.git] / includes / LinksUpdate.php
blobb86ea56581153e2d7cc693a57394a2d03194d221
1 <?php
2 /**
3 * See docs/deferred.txt
5 * @todo document (e.g. one-sentence top-level class description).
6 */
7 class LinksUpdate {
9 /**@{{
10 * @private
12 var $mId, //!< Page ID of the article linked from
13 $mTitle, //!< Title object of the article linked from
14 $mLinks, //!< Map of title strings to IDs for the links in the document
15 $mImages, //!< DB keys of the images used, in the array key only
16 $mTemplates, //!< Map of title strings to IDs for the template references, including broken ones
17 $mExternals, //!< URLs of external links, array key only
18 $mCategories, //!< Map of category names to sort keys
19 $mInterlangs, //!< Map of language codes to titles
20 $mProperties, //!< Map of arbitrary name to value
21 $mDb, //!< Database connection reference
22 $mOptions, //!< SELECT options to be used (array)
23 $mRecursive; //!< Whether to queue jobs for recursive updates
24 /**@}}*/
26 /**
27 * Constructor
29 * @param $title Title of the page we're updating
30 * @param $parserOutput ParserOutput: output from a full parse of this page
31 * @param $recursive Boolean: queue jobs for recursive updates?
33 function __construct( $title, $parserOutput, $recursive = true ) {
34 global $wgAntiLockFlags;
36 if ( $wgAntiLockFlags & ALF_NO_LINK_LOCK ) {
37 $this->mOptions = array();
38 } else {
39 $this->mOptions = array( 'FOR UPDATE' );
41 $this->mDb = wfGetDB( DB_MASTER );
43 if ( !is_object( $title ) ) {
44 throw new MWException( "The calling convention to LinksUpdate::LinksUpdate() has changed. " .
45 "Please see Article::editUpdates() for an invocation example.\n" );
47 $this->mTitle = $title;
48 $this->mId = $title->getArticleID();
50 $this->mParserOutput = $parserOutput;
51 $this->mLinks = $parserOutput->getLinks();
52 $this->mImages = $parserOutput->getImages();
53 $this->mTemplates = $parserOutput->getTemplates();
54 $this->mExternals = $parserOutput->getExternalLinks();
55 $this->mCategories = $parserOutput->getCategories();
56 $this->mProperties = $parserOutput->getProperties();
57 $this->mInterwikis = $parserOutput->getInterwikiLinks();
59 # Convert the format of the interlanguage links
60 # I didn't want to change it in the ParserOutput, because that array is passed all
61 # the way back to the skin, so either a skin API break would be required, or an
62 # inefficient back-conversion.
63 $ill = $parserOutput->getLanguageLinks();
64 $this->mInterlangs = array();
65 foreach ( $ill as $link ) {
66 list( $key, $title ) = explode( ':', $link, 2 );
67 $this->mInterlangs[$key] = $title;
70 foreach ( $this->mCategories as $cat => &$sortkey ) {
71 # If the sortkey is longer then 255 bytes,
72 # it truncated by DB, and then doesn't get
73 # matched when comparing existing vs current
74 # categories, causing bug 25254.
75 # Also. substr behaves weird when given "".
76 if ( $sortkey !== '' ) {
77 $sortkey = substr( $sortkey, 0, 255 );
81 $this->mRecursive = $recursive;
83 wfRunHooks( 'LinksUpdateConstructed', array( &$this ) );
86 /**
87 * Update link tables with outgoing links from an updated article
89 public function doUpdate() {
90 global $wgUseDumbLinkUpdate;
92 wfRunHooks( 'LinksUpdate', array( &$this ) );
93 if ( $wgUseDumbLinkUpdate ) {
94 $this->doDumbUpdate();
95 } else {
96 $this->doIncrementalUpdate();
98 wfRunHooks( 'LinksUpdateComplete', array( &$this ) );
101 protected function doIncrementalUpdate() {
102 wfProfileIn( __METHOD__ );
104 # Page links
105 $existing = $this->getExistingLinks();
106 $this->incrTableUpdate( 'pagelinks', 'pl', $this->getLinkDeletions( $existing ),
107 $this->getLinkInsertions( $existing ) );
109 # Image links
110 $existing = $this->getExistingImages();
112 $imageDeletes = $this->getImageDeletions( $existing );
113 $this->incrTableUpdate( 'imagelinks', 'il', $imageDeletes, $this->getImageInsertions( $existing ) );
115 # Invalidate all image description pages which had links added or removed
116 $imageUpdates = $imageDeletes + array_diff_key( $this->mImages, $existing );
117 $this->invalidateImageDescriptions( $imageUpdates );
119 # External links
120 $existing = $this->getExistingExternals();
121 $this->incrTableUpdate( 'externallinks', 'el', $this->getExternalDeletions( $existing ),
122 $this->getExternalInsertions( $existing ) );
124 # Language links
125 $existing = $this->getExistingInterlangs();
126 $this->incrTableUpdate( 'langlinks', 'll', $this->getInterlangDeletions( $existing ),
127 $this->getInterlangInsertions( $existing ) );
129 # Inline interwiki links
130 $existing = $this->getExistingInterwikis();
131 $this->incrTableUpdate( 'iwlinks', 'iwl', $this->getInterwikiDeletions( $existing ),
132 $this->getInterwikiInsertions( $existing ) );
134 # Template links
135 $existing = $this->getExistingTemplates();
136 $this->incrTableUpdate( 'templatelinks', 'tl', $this->getTemplateDeletions( $existing ),
137 $this->getTemplateInsertions( $existing ) );
139 # Category links
140 $existing = $this->getExistingCategories();
142 $categoryDeletes = $this->getCategoryDeletions( $existing );
144 $this->incrTableUpdate( 'categorylinks', 'cl', $categoryDeletes, $this->getCategoryInsertions( $existing ) );
146 # Invalidate all categories which were added, deleted or changed (set symmetric difference)
147 $categoryInserts = array_diff_assoc( $this->mCategories, $existing );
148 $categoryUpdates = $categoryInserts + $categoryDeletes;
149 $this->invalidateCategories( $categoryUpdates );
150 $this->updateCategoryCounts( $categoryInserts, $categoryDeletes );
152 # Page properties
153 $existing = $this->getExistingProperties();
155 $propertiesDeletes = $this->getPropertyDeletions( $existing );
157 $this->incrTableUpdate( 'page_props', 'pp', $propertiesDeletes, $this->getPropertyInsertions( $existing ) );
159 # Invalidate the necessary pages
160 $changed = $propertiesDeletes + array_diff_assoc( $this->mProperties, $existing );
161 $this->invalidateProperties( $changed );
163 # Refresh links of all pages including this page
164 # This will be in a separate transaction
165 if ( $this->mRecursive ) {
166 $this->queueRecursiveJobs();
169 wfProfileOut( __METHOD__ );
173 * Link update which clears the previous entries and inserts new ones
174 * May be slower or faster depending on level of lock contention and write speed of DB
175 * Also useful where link table corruption needs to be repaired, e.g. in refreshLinks.php
177 protected function doDumbUpdate() {
178 wfProfileIn( __METHOD__ );
180 # Refresh category pages and image description pages
181 $existing = $this->getExistingCategories();
182 $categoryInserts = array_diff_assoc( $this->mCategories, $existing );
183 $categoryDeletes = array_diff_assoc( $existing, $this->mCategories );
184 $categoryUpdates = $categoryInserts + $categoryDeletes;
185 $existing = $this->getExistingImages();
186 $imageUpdates = array_diff_key( $existing, $this->mImages ) + array_diff_key( $this->mImages, $existing );
188 $this->dumbTableUpdate( 'pagelinks', $this->getLinkInsertions(), 'pl_from' );
189 $this->dumbTableUpdate( 'imagelinks', $this->getImageInsertions(), 'il_from' );
190 $this->dumbTableUpdate( 'categorylinks', $this->getCategoryInsertions(), 'cl_from' );
191 $this->dumbTableUpdate( 'templatelinks', $this->getTemplateInsertions(), 'tl_from' );
192 $this->dumbTableUpdate( 'externallinks', $this->getExternalInsertions(), 'el_from' );
193 $this->dumbTableUpdate( 'langlinks', $this->getInterlangInsertions(),'ll_from' );
194 $this->dumbTableUpdate( 'iwlinks', $this->getInterwikiInsertions(),'iwl_from' );
195 $this->dumbTableUpdate( 'page_props', $this->getPropertyInsertions(), 'pp_page' );
197 # Update the cache of all the category pages and image description
198 # pages which were changed, and fix the category table count
199 $this->invalidateCategories( $categoryUpdates );
200 $this->updateCategoryCounts( $categoryInserts, $categoryDeletes );
201 $this->invalidateImageDescriptions( $imageUpdates );
203 # Refresh links of all pages including this page
204 # This will be in a separate transaction
205 if ( $this->mRecursive ) {
206 $this->queueRecursiveJobs();
209 wfProfileOut( __METHOD__ );
212 function queueRecursiveJobs() {
213 global $wgUpdateRowsPerJob;
214 wfProfileIn( __METHOD__ );
216 $cache = $this->mTitle->getBacklinkCache();
217 $batches = $cache->partition( 'templatelinks', $wgUpdateRowsPerJob );
218 if ( !$batches ) {
219 wfProfileOut( __METHOD__ );
220 return;
222 $jobs = array();
223 foreach ( $batches as $batch ) {
224 list( $start, $end ) = $batch;
225 $params = array(
226 'start' => $start,
227 'end' => $end,
229 $jobs[] = new RefreshLinksJob2( $this->mTitle, $params );
231 Job::batchInsert( $jobs );
233 wfProfileOut( __METHOD__ );
237 * Invalidate the cache of a list of pages from a single namespace
239 * @param $namespace Integer
240 * @param $dbkeys Array
242 function invalidatePages( $namespace, $dbkeys ) {
243 if ( !count( $dbkeys ) ) {
244 return;
248 * Determine which pages need to be updated
249 * This is necessary to prevent the job queue from smashing the DB with
250 * large numbers of concurrent invalidations of the same page
252 $now = $this->mDb->timestamp();
253 $ids = array();
254 $res = $this->mDb->select( 'page', array( 'page_id' ),
255 array(
256 'page_namespace' => $namespace,
257 'page_title IN (' . $this->mDb->makeList( $dbkeys ) . ')',
258 'page_touched < ' . $this->mDb->addQuotes( $now )
259 ), __METHOD__
261 foreach ( $res as $row ) {
262 $ids[] = $row->page_id;
264 if ( !count( $ids ) ) {
265 return;
269 * Do the update
270 * We still need the page_touched condition, in case the row has changed since
271 * the non-locking select above.
273 $this->mDb->update( 'page', array( 'page_touched' => $now ),
274 array(
275 'page_id IN (' . $this->mDb->makeList( $ids ) . ')',
276 'page_touched < ' . $this->mDb->addQuotes( $now )
277 ), __METHOD__
281 function invalidateCategories( $cats ) {
282 $this->invalidatePages( NS_CATEGORY, array_keys( $cats ) );
286 * Update all the appropriate counts in the category table.
287 * @param $added associative array of category name => sort key
288 * @param $deleted associative array of category name => sort key
290 function updateCategoryCounts( $added, $deleted ) {
291 $a = new Article($this->mTitle);
292 $a->updateCategoryCounts(
293 array_keys( $added ), array_keys( $deleted )
297 function invalidateImageDescriptions( $images ) {
298 $this->invalidatePages( NS_FILE, array_keys( $images ) );
301 function dumbTableUpdate( $table, $insertions, $fromField ) {
302 $this->mDb->delete( $table, array( $fromField => $this->mId ), __METHOD__ );
303 if ( count( $insertions ) ) {
304 # The link array was constructed without FOR UPDATE, so there may
305 # be collisions. This may cause minor link table inconsistencies,
306 # which is better than crippling the site with lock contention.
307 $this->mDb->insert( $table, $insertions, __METHOD__, array( 'IGNORE' ) );
312 * Update a table by doing a delete query then an insert query
313 * @private
315 function incrTableUpdate( $table, $prefix, $deletions, $insertions ) {
316 if ( $table == 'page_props' ) {
317 $fromField = 'pp_page';
318 } else {
319 $fromField = "{$prefix}_from";
321 $where = array( $fromField => $this->mId );
322 if ( $table == 'pagelinks' || $table == 'templatelinks' || $table == 'iwlinks' ) {
323 if ( $table == 'iwlinks' ) {
324 $baseKey = 'iwl_prefix';
325 } else {
326 $baseKey = "{$prefix}_namespace";
328 $clause = $this->mDb->makeWhereFrom2d( $deletions, $baseKey, "{$prefix}_title" );
329 if ( $clause ) {
330 $where[] = $clause;
331 } else {
332 $where = false;
334 } else {
335 if ( $table == 'langlinks' ) {
336 $toField = 'll_lang';
337 } elseif ( $table == 'page_props' ) {
338 $toField = 'pp_propname';
339 } else {
340 $toField = $prefix . '_to';
342 if ( count( $deletions ) ) {
343 $where[] = "$toField IN (" . $this->mDb->makeList( array_keys( $deletions ) ) . ')';
344 } else {
345 $where = false;
348 if ( $where ) {
349 $this->mDb->delete( $table, $where, __METHOD__ );
351 if ( count( $insertions ) ) {
352 $this->mDb->insert( $table, $insertions, __METHOD__, 'IGNORE' );
358 * Get an array of pagelinks insertions for passing to the DB
359 * Skips the titles specified by the 2-D array $existing
360 * @private
362 function getLinkInsertions( $existing = array() ) {
363 $arr = array();
364 foreach( $this->mLinks as $ns => $dbkeys ) {
365 $diffs = isset( $existing[$ns] ) ? array_diff_key( $dbkeys, $existing[$ns] ) : $dbkeys;
366 foreach ( $diffs as $dbk => $id ) {
367 $arr[] = array(
368 'pl_from' => $this->mId,
369 'pl_namespace' => $ns,
370 'pl_title' => $dbk
374 return $arr;
378 * Get an array of template insertions. Like getLinkInsertions()
379 * @private
381 function getTemplateInsertions( $existing = array() ) {
382 $arr = array();
383 foreach( $this->mTemplates as $ns => $dbkeys ) {
384 $diffs = isset( $existing[$ns] ) ? array_diff_key( $dbkeys, $existing[$ns] ) : $dbkeys;
385 foreach ( $diffs as $dbk => $id ) {
386 $arr[] = array(
387 'tl_from' => $this->mId,
388 'tl_namespace' => $ns,
389 'tl_title' => $dbk
393 return $arr;
397 * Get an array of image insertions
398 * Skips the names specified in $existing
399 * @private
401 function getImageInsertions( $existing = array() ) {
402 $arr = array();
403 $diffs = array_diff_key( $this->mImages, $existing );
404 foreach( $diffs as $iname => $dummy ) {
405 $arr[] = array(
406 'il_from' => $this->mId,
407 'il_to' => $iname
410 return $arr;
414 * Get an array of externallinks insertions. Skips the names specified in $existing
415 * @private
417 function getExternalInsertions( $existing = array() ) {
418 $arr = array();
419 $diffs = array_diff_key( $this->mExternals, $existing );
420 foreach( $diffs as $url => $dummy ) {
421 $arr[] = array(
422 'el_from' => $this->mId,
423 'el_to' => $url,
424 'el_index' => wfMakeUrlIndex( $url ),
427 return $arr;
431 * Get an array of category insertions
433 * @param $existing Array mapping existing category names to sort keys. If both
434 * match a link in $this, the link will be omitted from the output
435 * @private
437 function getCategoryInsertions( $existing = array() ) {
438 global $wgContLang, $wgCategoryCollation;
439 $diffs = array_diff_assoc( $this->mCategories, $existing );
440 $arr = array();
441 foreach ( $diffs as $name => $prefix ) {
442 $nt = Title::makeTitleSafe( NS_CATEGORY, $name );
443 $wgContLang->findVariantLink( $name, $nt, true );
445 if ( $this->mTitle->getNamespace() == NS_CATEGORY ) {
446 $type = 'subcat';
447 } elseif ( $this->mTitle->getNamespace() == NS_FILE ) {
448 $type = 'file';
449 } else {
450 $type = 'page';
453 # Treat custom sortkeys as a prefix, so that if multiple
454 # things are forced to sort as '*' or something, they'll
455 # sort properly in the category rather than in page_id
456 # order or such.
457 $sortkey = Collation::singleton()->getSortKey(
458 $this->mTitle->getCategorySortkey( $prefix ) );
460 $arr[] = array(
461 'cl_from' => $this->mId,
462 'cl_to' => $name,
463 'cl_sortkey' => $sortkey,
464 'cl_timestamp' => $this->mDb->timestamp(),
465 'cl_sortkey_prefix' => $prefix,
466 'cl_collation' => $wgCategoryCollation,
467 'cl_type' => $type,
470 return $arr;
474 * Get an array of interlanguage link insertions
476 * @param $existing Array mapping existing language codes to titles
477 * @private
479 function getInterlangInsertions( $existing = array() ) {
480 $diffs = array_diff_assoc( $this->mInterlangs, $existing );
481 $arr = array();
482 foreach( $diffs as $lang => $title ) {
483 $arr[] = array(
484 'll_from' => $this->mId,
485 'll_lang' => $lang,
486 'll_title' => $title
489 return $arr;
493 * Get an array of page property insertions
495 function getPropertyInsertions( $existing = array() ) {
496 $diffs = array_diff_assoc( $this->mProperties, $existing );
497 $arr = array();
498 foreach ( $diffs as $name => $value ) {
499 $arr[] = array(
500 'pp_page' => $this->mId,
501 'pp_propname' => $name,
502 'pp_value' => $value,
505 return $arr;
509 * Get an array of interwiki insertions for passing to the DB
510 * Skips the titles specified by the 2-D array $existing
511 * @private
513 function getInterwikiInsertions( $existing = array() ) {
514 $arr = array();
515 foreach( $this->mInterwikis as $prefix => $dbkeys ) {
516 $diffs = isset( $existing[$prefix] ) ? array_diff_key( $dbkeys, $existing[$prefix] ) : $dbkeys;
517 foreach ( $diffs as $dbk => $id ) {
518 $arr[] = array(
519 'iwl_from' => $this->mId,
520 'iwl_prefix' => $prefix,
521 'iwl_title' => $dbk
525 return $arr;
529 * Given an array of existing links, returns those links which are not in $this
530 * and thus should be deleted.
531 * @private
533 function getLinkDeletions( $existing ) {
534 $del = array();
535 foreach ( $existing as $ns => $dbkeys ) {
536 if ( isset( $this->mLinks[$ns] ) ) {
537 $del[$ns] = array_diff_key( $existing[$ns], $this->mLinks[$ns] );
538 } else {
539 $del[$ns] = $existing[$ns];
542 return $del;
546 * Given an array of existing templates, returns those templates which are not in $this
547 * and thus should be deleted.
548 * @private
550 function getTemplateDeletions( $existing ) {
551 $del = array();
552 foreach ( $existing as $ns => $dbkeys ) {
553 if ( isset( $this->mTemplates[$ns] ) ) {
554 $del[$ns] = array_diff_key( $existing[$ns], $this->mTemplates[$ns] );
555 } else {
556 $del[$ns] = $existing[$ns];
559 return $del;
563 * Given an array of existing images, returns those images which are not in $this
564 * and thus should be deleted.
565 * @private
567 function getImageDeletions( $existing ) {
568 return array_diff_key( $existing, $this->mImages );
572 * Given an array of existing external links, returns those links which are not
573 * in $this and thus should be deleted.
574 * @private
576 function getExternalDeletions( $existing ) {
577 return array_diff_key( $existing, $this->mExternals );
581 * Given an array of existing categories, returns those categories which are not in $this
582 * and thus should be deleted.
583 * @private
585 function getCategoryDeletions( $existing ) {
586 return array_diff_assoc( $existing, $this->mCategories );
590 * Given an array of existing interlanguage links, returns those links which are not
591 * in $this and thus should be deleted.
592 * @private
594 function getInterlangDeletions( $existing ) {
595 return array_diff_assoc( $existing, $this->mInterlangs );
599 * Get array of properties which should be deleted.
600 * @private
602 function getPropertyDeletions( $existing ) {
603 return array_diff_assoc( $existing, $this->mProperties );
607 * Given an array of existing interwiki links, returns those links which are not in $this
608 * and thus should be deleted.
609 * @private
611 function getInterwikiDeletions( $existing ) {
612 $del = array();
613 foreach ( $existing as $prefix => $dbkeys ) {
614 if ( isset( $this->mInterwikis[$prefix] ) ) {
615 $del[$prefix] = array_diff_key( $existing[$prefix], $this->mInterwikis[$prefix] );
616 } else {
617 $del[$prefix] = $existing[$prefix];
620 return $del;
624 * Get an array of existing links, as a 2-D array
625 * @private
627 function getExistingLinks() {
628 $res = $this->mDb->select( 'pagelinks', array( 'pl_namespace', 'pl_title' ),
629 array( 'pl_from' => $this->mId ), __METHOD__, $this->mOptions );
630 $arr = array();
631 foreach ( $res as $row ) {
632 if ( !isset( $arr[$row->pl_namespace] ) ) {
633 $arr[$row->pl_namespace] = array();
635 $arr[$row->pl_namespace][$row->pl_title] = 1;
637 return $arr;
641 * Get an array of existing templates, as a 2-D array
642 * @private
644 function getExistingTemplates() {
645 $res = $this->mDb->select( 'templatelinks', array( 'tl_namespace', 'tl_title' ),
646 array( 'tl_from' => $this->mId ), __METHOD__, $this->mOptions );
647 $arr = array();
648 foreach ( $res as $row ) {
649 if ( !isset( $arr[$row->tl_namespace] ) ) {
650 $arr[$row->tl_namespace] = array();
652 $arr[$row->tl_namespace][$row->tl_title] = 1;
654 return $arr;
658 * Get an array of existing images, image names in the keys
659 * @private
661 function getExistingImages() {
662 $res = $this->mDb->select( 'imagelinks', array( 'il_to' ),
663 array( 'il_from' => $this->mId ), __METHOD__, $this->mOptions );
664 $arr = array();
665 foreach ( $res as $row ) {
666 $arr[$row->il_to] = 1;
668 return $arr;
672 * Get an array of existing external links, URLs in the keys
673 * @private
675 function getExistingExternals() {
676 $res = $this->mDb->select( 'externallinks', array( 'el_to' ),
677 array( 'el_from' => $this->mId ), __METHOD__, $this->mOptions );
678 $arr = array();
679 foreach ( $res as $row ) {
680 $arr[$row->el_to] = 1;
682 return $arr;
686 * Get an array of existing categories, with the name in the key and sort key in the value.
687 * @private
689 function getExistingCategories() {
690 $res = $this->mDb->select( 'categorylinks', array( 'cl_to', 'cl_sortkey_prefix' ),
691 array( 'cl_from' => $this->mId ), __METHOD__, $this->mOptions );
692 $arr = array();
693 foreach ( $res as $row ) {
694 $arr[$row->cl_to] = $row->cl_sortkey_prefix;
696 return $arr;
700 * Get an array of existing interlanguage links, with the language code in the key and the
701 * title in the value.
702 * @private
704 function getExistingInterlangs() {
705 $res = $this->mDb->select( 'langlinks', array( 'll_lang', 'll_title' ),
706 array( 'll_from' => $this->mId ), __METHOD__, $this->mOptions );
707 $arr = array();
708 foreach ( $res as $row ) {
709 $arr[$row->ll_lang] = $row->ll_title;
711 return $arr;
715 * Get an array of existing inline interwiki links, as a 2-D array
716 * @return array (prefix => array(dbkey => 1))
718 protected function getExistingInterwikis() {
719 $res = $this->mDb->select( 'iwlinks', array( 'iwl_prefix', 'iwl_title' ),
720 array( 'iwl_from' => $this->mId ), __METHOD__, $this->mOptions );
721 $arr = array();
722 foreach ( $res as $row ) {
723 if ( !isset( $arr[$row->iwl_prefix] ) ) {
724 $arr[$row->iwl_prefix] = array();
726 $arr[$row->iwl_prefix][$row->iwl_title] = 1;
728 return $arr;
732 * Get an array of existing categories, with the name in the key and sort key in the value.
733 * @private
735 function getExistingProperties() {
736 $res = $this->mDb->select( 'page_props', array( 'pp_propname', 'pp_value' ),
737 array( 'pp_page' => $this->mId ), __METHOD__, $this->mOptions );
738 $arr = array();
739 foreach ( $res as $row ) {
740 $arr[$row->pp_propname] = $row->pp_value;
742 return $arr;
747 * Return the title object of the page being updated
749 function getTitle() {
750 return $this->mTitle;
754 * Return the list of images used as generated by the parser
756 public function getImages() {
757 return $this->mImages;
761 * Invalidate any necessary link lists related to page property changes
763 function invalidateProperties( $changed ) {
764 global $wgPagePropLinkInvalidations;
766 foreach ( $changed as $name => $value ) {
767 if ( isset( $wgPagePropLinkInvalidations[$name] ) ) {
768 $inv = $wgPagePropLinkInvalidations[$name];
769 if ( !is_array( $inv ) ) {
770 $inv = array( $inv );
772 foreach ( $inv as $table ) {
773 $update = new HTMLCacheUpdate( $this->mTitle, $table );
774 $update->doUpdate();