Localization update for he.
[lhc/web/wiklou.git] / includes / LinksUpdate.php
1 <?php
2 /**
3 * See docs/deferred.txt
4 *
5 * @todo document (e.g. one-sentence top-level class description).
6 */
7 class LinksUpdate {
8
9 /**@{{
10 * @private
11 */
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 /**@}}*/
25
26 /**
27 * Constructor
28 *
29 * @param Title $title Title of the page we're updating
30 * @param ParserOutput $parserOutput Output from a full parse of this page
31 * @param bool $recursive Queue jobs for recursive updates?
32 */
33 function LinksUpdate( $title, $parserOutput, $recursive = true ) {
34 global $wgAntiLockFlags;
35
36 if ( $wgAntiLockFlags & ALF_NO_LINK_LOCK ) {
37 $this->mOptions = array();
38 } else {
39 $this->mOptions = array( 'FOR UPDATE' );
40 }
41 $this->mDb = wfGetDB( DB_MASTER );
42
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" );
46 }
47 $this->mTitle = $title;
48 $this->mId = $title->getArticleID();
49
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
58 # Convert the format of the interlanguage links
59 # I didn't want to change it in the ParserOutput, because that array is passed all
60 # the way back to the skin, so either a skin API break would be required, or an
61 # inefficient back-conversion.
62 $ill = $parserOutput->getLanguageLinks();
63 $this->mInterlangs = array();
64 foreach ( $ill as $link ) {
65 list( $key, $title ) = explode( ':', $link, 2 );
66 $this->mInterlangs[$key] = $title;
67 }
68
69 $this->mRecursive = $recursive;
70 $this->mTouchTmplLinks = false;
71
72 wfRunHooks( 'LinksUpdateConstructed', array( &$this ) );
73 }
74
75 /**
76 * Update link tables with outgoing links from an updated article
77 */
78 public function doUpdate() {
79 global $wgUseDumbLinkUpdate;
80
81 wfRunHooks( 'LinksUpdate', array( &$this ) );
82 if ( $wgUseDumbLinkUpdate ) {
83 $this->doDumbUpdate();
84 } else {
85 $this->doIncrementalUpdate();
86 }
87 wfRunHooks( 'LinksUpdateComplete', array( &$this ) );
88 }
89
90 protected function doIncrementalUpdate() {
91 wfProfileIn( __METHOD__ );
92
93 # Page links
94 $existing = $this->getExistingLinks();
95 $this->incrTableUpdate( 'pagelinks', 'pl', $this->getLinkDeletions( $existing ),
96 $this->getLinkInsertions( $existing ) );
97
98 # Image links
99 $existing = $this->getExistingImages();
100
101 $imageDeletes = $this->getImageDeletions( $existing );
102 $this->incrTableUpdate( 'imagelinks', 'il', $imageDeletes, $this->getImageInsertions( $existing ) );
103
104 # Invalidate all image description pages which had links added or removed
105 $imageUpdates = $imageDeletes + array_diff_key( $this->mImages, $existing );
106 $this->invalidateImageDescriptions( $imageUpdates );
107
108 # External links
109 $existing = $this->getExistingExternals();
110 $this->incrTableUpdate( 'externallinks', 'el', $this->getExternalDeletions( $existing ),
111 $this->getExternalInsertions( $existing ) );
112
113 # Language links
114 $existing = $this->getExistingInterlangs();
115 $this->incrTableUpdate( 'langlinks', 'll', $this->getInterlangDeletions( $existing ),
116 $this->getInterlangInsertions( $existing ) );
117
118 # Template links
119 $existing = $this->getExistingTemplates();
120 $this->incrTableUpdate( 'templatelinks', 'tl', $this->getTemplateDeletions( $existing ),
121 $this->getTemplateInsertions( $existing ) );
122
123 # Category links
124 $existing = $this->getExistingCategories();
125
126 $categoryDeletes = $this->getCategoryDeletions( $existing );
127
128 $this->incrTableUpdate( 'categorylinks', 'cl', $categoryDeletes, $this->getCategoryInsertions( $existing ) );
129
130 # Invalidate all categories which were added, deleted or changed (set symmetric difference)
131 $categoryInserts = array_diff_assoc( $this->mCategories, $existing );
132 $categoryUpdates = $categoryInserts + $categoryDeletes;
133 $this->invalidateCategories( $categoryUpdates );
134 $this->updateCategoryCounts( $categoryInserts, $categoryDeletes );
135
136 # Page properties
137 $existing = $this->getExistingProperties();
138
139 $propertiesDeletes = $this->getPropertyDeletions( $existing );
140
141 $this->incrTableUpdate( 'page_props', 'pp', $propertiesDeletes, $this->getPropertyInsertions( $existing ) );
142
143 # Invalidate the necessary pages
144 $changed = $propertiesDeletes + array_diff_assoc( $this->mProperties, $existing );
145 $this->invalidateProperties( $changed );
146
147 # Refresh links of all pages including this page
148 # This will be in a separate transaction
149 if ( $this->mRecursive ) {
150 $this->queueRecursiveJobs();
151 }
152
153 wfProfileOut( __METHOD__ );
154 }
155
156 /**
157 * Link update which clears the previous entries and inserts new ones
158 * May be slower or faster depending on level of lock contention and write speed of DB
159 * Also useful where link table corruption needs to be repaired, e.g. in refreshLinks.php
160 */
161 protected function doDumbUpdate() {
162 wfProfileIn( __METHOD__ );
163
164 # Refresh category pages and image description pages
165 $existing = $this->getExistingCategories();
166 $categoryInserts = array_diff_assoc( $this->mCategories, $existing );
167 $categoryDeletes = array_diff_assoc( $existing, $this->mCategories );
168 $categoryUpdates = $categoryInserts + $categoryDeletes;
169 $existing = $this->getExistingImages();
170 $imageUpdates = array_diff_key( $existing, $this->mImages ) + array_diff_key( $this->mImages, $existing );
171
172 $this->dumbTableUpdate( 'pagelinks', $this->getLinkInsertions(), 'pl_from' );
173 $this->dumbTableUpdate( 'imagelinks', $this->getImageInsertions(), 'il_from' );
174 $this->dumbTableUpdate( 'categorylinks', $this->getCategoryInsertions(), 'cl_from' );
175 $this->dumbTableUpdate( 'templatelinks', $this->getTemplateInsertions(), 'tl_from' );
176 $this->dumbTableUpdate( 'externallinks', $this->getExternalInsertions(), 'el_from' );
177 $this->dumbTableUpdate( 'langlinks', $this->getInterlangInsertions(),'ll_from' );
178 $this->dumbTableUpdate( 'page_props', $this->getPropertyInsertions(), 'pp_page' );
179
180 # Update the cache of all the category pages and image description
181 # pages which were changed, and fix the category table count
182 $this->invalidateCategories( $categoryUpdates );
183 $this->updateCategoryCounts( $categoryInserts, $categoryDeletes );
184 $this->invalidateImageDescriptions( $imageUpdates );
185
186 # Refresh links of all pages including this page
187 # This will be in a separate transaction
188 if ( $this->mRecursive ) {
189 $this->queueRecursiveJobs();
190 }
191
192 wfProfileOut( __METHOD__ );
193 }
194
195 function queueRecursiveJobs() {
196 global $wgUpdateRowsPerJob;
197 wfProfileIn( __METHOD__ );
198
199 $cache = $this->mTitle->getBacklinkCache();
200 $batches = $cache->partition( 'templatelinks', $wgUpdateRowsPerJob );
201 if ( !$batches ) {
202 return;
203 }
204 $jobs = array();
205 foreach ( $batches as $batch ) {
206 list( $start, $end ) = $batch;
207 $params = array(
208 'start' => $start,
209 'end' => $end,
210 );
211 $jobs[] = new RefreshLinksJob2( $this->mTitle, $params );
212 }
213 Job::batchInsert( $jobs );
214
215 wfProfileOut( __METHOD__ );
216 }
217
218 /**
219 * Invalidate the cache of a list of pages from a single namespace
220 *
221 * @param integer $namespace
222 * @param array $dbkeys
223 */
224 function invalidatePages( $namespace, $dbkeys ) {
225 if ( !count( $dbkeys ) ) {
226 return;
227 }
228
229 /**
230 * Determine which pages need to be updated
231 * This is necessary to prevent the job queue from smashing the DB with
232 * large numbers of concurrent invalidations of the same page
233 */
234 $now = $this->mDb->timestamp();
235 $ids = array();
236 $res = $this->mDb->select( 'page', array( 'page_id' ),
237 array(
238 'page_namespace' => $namespace,
239 'page_title IN (' . $this->mDb->makeList( $dbkeys ) . ')',
240 'page_touched < ' . $this->mDb->addQuotes( $now )
241 ), __METHOD__
242 );
243 while ( $row = $this->mDb->fetchObject( $res ) ) {
244 $ids[] = $row->page_id;
245 }
246 if ( !count( $ids ) ) {
247 return;
248 }
249
250 /**
251 * Do the update
252 * We still need the page_touched condition, in case the row has changed since
253 * the non-locking select above.
254 */
255 $this->mDb->update( 'page', array( 'page_touched' => $now ),
256 array(
257 'page_id IN (' . $this->mDb->makeList( $ids ) . ')',
258 'page_touched < ' . $this->mDb->addQuotes( $now )
259 ), __METHOD__
260 );
261 }
262
263 function invalidateCategories( $cats ) {
264 $this->invalidatePages( NS_CATEGORY, array_keys( $cats ) );
265 }
266
267 /**
268 * Update all the appropriate counts in the category table.
269 * @param $added associative array of category name => sort key
270 * @param $deleted associative array of category name => sort key
271 */
272 function updateCategoryCounts( $added, $deleted ) {
273 $a = new Article($this->mTitle);
274 $a->updateCategoryCounts(
275 array_keys( $added ), array_keys( $deleted )
276 );
277 }
278
279 function invalidateImageDescriptions( $images ) {
280 $this->invalidatePages( NS_FILE, array_keys( $images ) );
281 }
282
283 function dumbTableUpdate( $table, $insertions, $fromField ) {
284 $this->mDb->delete( $table, array( $fromField => $this->mId ), __METHOD__ );
285 if ( count( $insertions ) ) {
286 # The link array was constructed without FOR UPDATE, so there may
287 # be collisions. This may cause minor link table inconsistencies,
288 # which is better than crippling the site with lock contention.
289 $this->mDb->insert( $table, $insertions, __METHOD__, array( 'IGNORE' ) );
290 }
291 }
292
293 /**
294 * Make a WHERE clause from a 2-d NS/dbkey array
295 *
296 * @param array $arr 2-d array indexed by namespace and DB key
297 * @param string $prefix Field name prefix, without the underscore
298 */
299 function makeWhereFrom2d( &$arr, $prefix ) {
300 $lb = new LinkBatch;
301 $lb->setArray( $arr );
302 return $lb->constructSet( $prefix, $this->mDb );
303 }
304
305 /**
306 * Update a table by doing a delete query then an insert query
307 * @private
308 */
309 function incrTableUpdate( $table, $prefix, $deletions, $insertions ) {
310 if ( $table == 'page_props' ) {
311 $fromField = 'pp_page';
312 } else {
313 $fromField = "{$prefix}_from";
314 }
315 $where = array( $fromField => $this->mId );
316 if ( $table == 'pagelinks' || $table == 'templatelinks' ) {
317 $clause = $this->makeWhereFrom2d( $deletions, $prefix );
318 if ( $clause ) {
319 $where[] = $clause;
320 } else {
321 $where = false;
322 }
323 } else {
324 if ( $table == 'langlinks' ) {
325 $toField = 'll_lang';
326 } elseif ( $table == 'page_props' ) {
327 $toField = 'pp_propname';
328 } else {
329 $toField = $prefix . '_to';
330 }
331 if ( count( $deletions ) ) {
332 $where[] = "$toField IN (" . $this->mDb->makeList( array_keys( $deletions ) ) . ')';
333 } else {
334 $where = false;
335 }
336 }
337 if ( $where ) {
338 $this->mDb->delete( $table, $where, __METHOD__ );
339 }
340 if ( count( $insertions ) ) {
341 $this->mDb->insert( $table, $insertions, __METHOD__, 'IGNORE' );
342 }
343 }
344
345
346 /**
347 * Get an array of pagelinks insertions for passing to the DB
348 * Skips the titles specified by the 2-D array $existing
349 * @private
350 */
351 function getLinkInsertions( $existing = array() ) {
352 $arr = array();
353 foreach( $this->mLinks as $ns => $dbkeys ) {
354 # array_diff_key() was introduced in PHP 5.1, there is a compatibility function
355 # in GlobalFunctions.php
356 $diffs = isset( $existing[$ns] ) ? array_diff_key( $dbkeys, $existing[$ns] ) : $dbkeys;
357 foreach ( $diffs as $dbk => $id ) {
358 $arr[] = array(
359 'pl_from' => $this->mId,
360 'pl_namespace' => $ns,
361 'pl_title' => $dbk
362 );
363 }
364 }
365 return $arr;
366 }
367
368 /**
369 * Get an array of template insertions. Like getLinkInsertions()
370 * @private
371 */
372 function getTemplateInsertions( $existing = array() ) {
373 $arr = array();
374 foreach( $this->mTemplates as $ns => $dbkeys ) {
375 $diffs = isset( $existing[$ns] ) ? array_diff_key( $dbkeys, $existing[$ns] ) : $dbkeys;
376 foreach ( $diffs as $dbk => $id ) {
377 $arr[] = array(
378 'tl_from' => $this->mId,
379 'tl_namespace' => $ns,
380 'tl_title' => $dbk
381 );
382 }
383 }
384 return $arr;
385 }
386
387 /**
388 * Get an array of image insertions
389 * Skips the names specified in $existing
390 * @private
391 */
392 function getImageInsertions( $existing = array() ) {
393 $arr = array();
394 $diffs = array_diff_key( $this->mImages, $existing );
395 foreach( $diffs as $iname => $dummy ) {
396 $arr[] = array(
397 'il_from' => $this->mId,
398 'il_to' => $iname
399 );
400 }
401 return $arr;
402 }
403
404 /**
405 * Get an array of externallinks insertions. Skips the names specified in $existing
406 * @private
407 */
408 function getExternalInsertions( $existing = array() ) {
409 $arr = array();
410 $diffs = array_diff_key( $this->mExternals, $existing );
411 foreach( $diffs as $url => $dummy ) {
412 $arr[] = array(
413 'el_from' => $this->mId,
414 'el_to' => $url,
415 'el_index' => wfMakeUrlIndex( $url ),
416 );
417 }
418 return $arr;
419 }
420
421 /**
422 * Get an array of category insertions
423 * @param array $existing Array mapping existing category names to sort keys. If both
424 * match a link in $this, the link will be omitted from the output
425 * @private
426 */
427 function getCategoryInsertions( $existing = array() ) {
428 global $wgContLang;
429 $diffs = array_diff_assoc( $this->mCategories, $existing );
430 foreach ( $this->mCategories as $name => $sortkey ) {
431 $newname = $name;
432 $nt = Title::makeTitleSafe( NS_CATEGORY, $newname );
433 $wgContLang->findVariantLink( $newname, $nt, true );
434 // for category redirection
435 if ( $nt->isRedirect() ) {
436 $at = new Article( $nt );
437 $nt = $at->getRedirectTarget();
438 $newname = $nt->getText();
439 // we only redirect a category to another category
440 if ( ! array_key_exists( $newname, $existing )
441 and $nt->getNamespace() == NS_CATEGORY )
442 $diffs[$newname] = $sortkey;
443 }
444 }
445 $arr = array();
446 foreach ( $diffs as $name => $sortkey ) {
447 $nt = Title::makeTitleSafe( NS_CATEGORY, $name );
448 $wgContLang->findVariantLink( $name, $nt, true );
449 $arr[] = array(
450 'cl_from' => $this->mId,
451 'cl_to' => $name,
452 'cl_sortkey' => $sortkey,
453 'cl_timestamp' => $this->mDb->timestamp()
454 );
455 }
456 return $arr;
457 }
458
459 /**
460 * Get an array of interlanguage link insertions
461 * @param array $existing Array mapping existing language codes to titles
462 * @private
463 */
464 function getInterlangInsertions( $existing = array() ) {
465 $diffs = array_diff_assoc( $this->mInterlangs, $existing );
466 $arr = array();
467 foreach( $diffs as $lang => $title ) {
468 $arr[] = array(
469 'll_from' => $this->mId,
470 'll_lang' => $lang,
471 'll_title' => $title
472 );
473 }
474 return $arr;
475 }
476
477 /**
478 * Get an array of page property insertions
479 */
480 function getPropertyInsertions( $existing = array() ) {
481 $diffs = array_diff_assoc( $this->mProperties, $existing );
482 $arr = array();
483 foreach ( $diffs as $name => $value ) {
484 $arr[] = array(
485 'pp_page' => $this->mId,
486 'pp_propname' => $name,
487 'pp_value' => $value,
488 );
489 }
490 return $arr;
491 }
492
493
494 /**
495 * Given an array of existing links, returns those links which are not in $this
496 * and thus should be deleted.
497 * @private
498 */
499 function getLinkDeletions( $existing ) {
500 $del = array();
501 foreach ( $existing as $ns => $dbkeys ) {
502 if ( isset( $this->mLinks[$ns] ) ) {
503 $del[$ns] = array_diff_key( $existing[$ns], $this->mLinks[$ns] );
504 } else {
505 $del[$ns] = $existing[$ns];
506 }
507 }
508 return $del;
509 }
510
511 /**
512 * Given an array of existing templates, returns those templates which are not in $this
513 * and thus should be deleted.
514 * @private
515 */
516 function getTemplateDeletions( $existing ) {
517 $del = array();
518 foreach ( $existing as $ns => $dbkeys ) {
519 if ( isset( $this->mTemplates[$ns] ) ) {
520 $del[$ns] = array_diff_key( $existing[$ns], $this->mTemplates[$ns] );
521 } else {
522 $del[$ns] = $existing[$ns];
523 }
524 }
525 return $del;
526 }
527
528 /**
529 * Given an array of existing images, returns those images which are not in $this
530 * and thus should be deleted.
531 * @private
532 */
533 function getImageDeletions( $existing ) {
534 return array_diff_key( $existing, $this->mImages );
535 }
536
537 /**
538 * Given an array of existing external links, returns those links which are not
539 * in $this and thus should be deleted.
540 * @private
541 */
542 function getExternalDeletions( $existing ) {
543 return array_diff_key( $existing, $this->mExternals );
544 }
545
546 /**
547 * Given an array of existing categories, returns those categories which are not in $this
548 * and thus should be deleted.
549 * @private
550 */
551 function getCategoryDeletions( $existing ) {
552 return array_diff_assoc( $existing, $this->mCategories );
553 }
554
555 /**
556 * Given an array of existing interlanguage links, returns those links which are not
557 * in $this and thus should be deleted.
558 * @private
559 */
560 function getInterlangDeletions( $existing ) {
561 return array_diff_assoc( $existing, $this->mInterlangs );
562 }
563
564 /**
565 * Get array of properties which should be deleted.
566 * @private
567 */
568 function getPropertyDeletions( $existing ) {
569 return array_diff_assoc( $existing, $this->mProperties );
570 }
571
572 /**
573 * Get an array of existing links, as a 2-D array
574 * @private
575 */
576 function getExistingLinks() {
577 $res = $this->mDb->select( 'pagelinks', array( 'pl_namespace', 'pl_title' ),
578 array( 'pl_from' => $this->mId ), __METHOD__, $this->mOptions );
579 $arr = array();
580 while ( $row = $this->mDb->fetchObject( $res ) ) {
581 if ( !isset( $arr[$row->pl_namespace] ) ) {
582 $arr[$row->pl_namespace] = array();
583 }
584 $arr[$row->pl_namespace][$row->pl_title] = 1;
585 }
586 $this->mDb->freeResult( $res );
587 return $arr;
588 }
589
590 /**
591 * Get an array of existing templates, as a 2-D array
592 * @private
593 */
594 function getExistingTemplates() {
595 $res = $this->mDb->select( 'templatelinks', array( 'tl_namespace', 'tl_title' ),
596 array( 'tl_from' => $this->mId ), __METHOD__, $this->mOptions );
597 $arr = array();
598 while ( $row = $this->mDb->fetchObject( $res ) ) {
599 if ( !isset( $arr[$row->tl_namespace] ) ) {
600 $arr[$row->tl_namespace] = array();
601 }
602 $arr[$row->tl_namespace][$row->tl_title] = 1;
603 }
604 $this->mDb->freeResult( $res );
605 return $arr;
606 }
607
608 /**
609 * Get an array of existing images, image names in the keys
610 * @private
611 */
612 function getExistingImages() {
613 $res = $this->mDb->select( 'imagelinks', array( 'il_to' ),
614 array( 'il_from' => $this->mId ), __METHOD__, $this->mOptions );
615 $arr = array();
616 while ( $row = $this->mDb->fetchObject( $res ) ) {
617 $arr[$row->il_to] = 1;
618 }
619 $this->mDb->freeResult( $res );
620 return $arr;
621 }
622
623 /**
624 * Get an array of existing external links, URLs in the keys
625 * @private
626 */
627 function getExistingExternals() {
628 $res = $this->mDb->select( 'externallinks', array( 'el_to' ),
629 array( 'el_from' => $this->mId ), __METHOD__, $this->mOptions );
630 $arr = array();
631 while ( $row = $this->mDb->fetchObject( $res ) ) {
632 $arr[$row->el_to] = 1;
633 }
634 $this->mDb->freeResult( $res );
635 return $arr;
636 }
637
638 /**
639 * Get an array of existing categories, with the name in the key and sort key in the value.
640 * @private
641 */
642 function getExistingCategories() {
643 $res = $this->mDb->select( 'categorylinks', array( 'cl_to', 'cl_sortkey' ),
644 array( 'cl_from' => $this->mId ), __METHOD__, $this->mOptions );
645 $arr = array();
646 while ( $row = $this->mDb->fetchObject( $res ) ) {
647 $arr[$row->cl_to] = $row->cl_sortkey;
648 }
649 $this->mDb->freeResult( $res );
650 return $arr;
651 }
652
653 /**
654 * Get an array of existing interlanguage links, with the language code in the key and the
655 * title in the value.
656 * @private
657 */
658 function getExistingInterlangs() {
659 $res = $this->mDb->select( 'langlinks', array( 'll_lang', 'll_title' ),
660 array( 'll_from' => $this->mId ), __METHOD__, $this->mOptions );
661 $arr = array();
662 while ( $row = $this->mDb->fetchObject( $res ) ) {
663 $arr[$row->ll_lang] = $row->ll_title;
664 }
665 return $arr;
666 }
667
668 /**
669 * Get an array of existing categories, with the name in the key and sort key in the value.
670 * @private
671 */
672 function getExistingProperties() {
673 $res = $this->mDb->select( 'page_props', array( 'pp_propname', 'pp_value' ),
674 array( 'pp_page' => $this->mId ), __METHOD__, $this->mOptions );
675 $arr = array();
676 while ( $row = $this->mDb->fetchObject( $res ) ) {
677 $arr[$row->pp_propname] = $row->pp_value;
678 }
679 $this->mDb->freeResult( $res );
680 return $arr;
681 }
682
683
684 /**
685 * Return the title object of the page being updated
686 */
687 function getTitle() {
688 return $this->mTitle;
689 }
690
691 /**
692 * Invalidate any necessary link lists related to page property changes
693 */
694 function invalidateProperties( $changed ) {
695 global $wgPagePropLinkInvalidations;
696
697 foreach ( $changed as $name => $value ) {
698 if ( isset( $wgPagePropLinkInvalidations[$name] ) ) {
699 $inv = $wgPagePropLinkInvalidations[$name];
700 if ( !is_array( $inv ) ) {
701 $inv = array( $inv );
702 }
703 foreach ( $inv as $table ) {
704 $update = new HTMLCacheUpdate( $this->mTitle, $table );
705 $update->doUpdate();
706 }
707 }
708 }
709 }
710 }