Index: trunk/phase3/docs/hooks.txt |
— | — | @@ -469,6 +469,9 @@ |
470 | 470 | &$result: Set this and return false to override the internal checks |
471 | 471 | $user: User the password is being validated for |
472 | 472 | |
| 473 | +'LinksUpdateConstructed': At the end of LinksUpdate() is contruction. |
| 474 | +&$linksUpdate: the LinkUpdate object |
| 475 | + |
473 | 476 | 'LoginAuthenticateAudit': a login attempt for a valid user account either succeeded or failed. |
474 | 477 | No return data is accepted; this hook is for auditing only. |
475 | 478 | $user: the User object being authenticated against |
— | — | @@ -569,9 +572,6 @@ |
570 | 573 | 'SpecialContributionsBeforeMainOutput': Before the form on Special:Contributions |
571 | 574 | $id: User identifier |
572 | 575 | |
573 | | -'TitleLinkUpdatesAfterCompletion': after Linker->doUpdate() is called |
574 | | -&$title: title of the updated page |
575 | | - |
576 | 576 | 'TitleMoveComplete': after moving an article (title) |
577 | 577 | $old: old title |
578 | 578 | $nt: new title |
Index: trunk/phase3/includes/LinksUpdate.php |
— | — | @@ -64,6 +64,8 @@ |
65 | 65 | } |
66 | 66 | |
67 | 67 | $this->mRecursive = $recursive; |
| 68 | + |
| 69 | + wfRunHooks( 'LinksUpdateConstructed', array( &$this ) ); |
68 | 70 | } |
69 | 71 | |
70 | 72 | /** |
— | — | @@ -76,7 +78,6 @@ |
77 | 79 | } else { |
78 | 80 | $this->doIncrementalUpdate(); |
79 | 81 | } |
80 | | - wfRunHooks( 'TitleLinkUpdatesAfterCompletion', array( &$this->mTitle ) ); |
81 | 82 | } |
82 | 83 | |
83 | 84 | function doIncrementalUpdate() { |
Index: trunk/extensions/FlaggedRevs/FlaggedRevs.php |
— | — | @@ -617,74 +617,38 @@ |
618 | 618 | return true; |
619 | 619 | } |
620 | 620 | |
621 | | - public static function extraLinksUpdate( &$title ) { |
| 621 | + public static function extraLinksUpdate( &$linkUpdate ) { |
622 | 622 | $fname = 'FlaggedRevs::extraLinksUpdate'; |
623 | 623 | wfProfileIn( $fname ); |
624 | 624 | |
625 | | - if( !$title->isContentPage() ) |
| 625 | + if( !$linkUpdate->mTitle->isContentPage() ) |
626 | 626 | return true; |
627 | 627 | # Check if this page has a stable version |
628 | | - $sv = self::getOverridingPageRev( $title ); |
629 | | - if( !$sv ) |
| 628 | + $sv = self::getOverridingPageRev( $linkUpdate->mTitle ); |
| 629 | + if( !$sv ) |
630 | 630 | return true; |
631 | 631 | # Retrieve the text |
632 | 632 | $text = self::getFlaggedRevText( $sv->fr_rev_id ); |
633 | 633 | # Parse the revision |
634 | 634 | $options = new ParserOptions; |
635 | | - $poutput = self::parseStableText( $title, $text, $sv->fr_rev_id, $options ); |
636 | | - |
| 635 | + $parserOutput = self::parseStableText( $linkUpdate->mTitle, $text, $sv->fr_rev_id, $options ); |
637 | 636 | # Might as well update the cache while we're at it |
638 | | - $article = new Article( $title ); |
639 | | - FlaggedRevs::updatePageCache( $article, $poutput ); |
640 | | - |
| 637 | + $article = new Article( $linkUpdate->mTitle ); |
| 638 | + FlaggedRevs::updatePageCache( $article, $parserOutput ); |
641 | 639 | # Update the links tables to include these |
642 | 640 | # We want the UNION of links between the current |
643 | 641 | # and stable version. Therefore, we only care about |
644 | 642 | # links that are in the stable version and not the regular one. |
645 | | - $u = new LinksUpdate( $article->mTitle, $poutput ); |
646 | | - |
647 | | - # Page links |
648 | | - $existing = $u->getExistingLinks(); |
649 | | - $u->incrTableUpdate( 'pagelinks', 'pl', array(), |
650 | | - $u->getLinkInsertions( $existing ) ); |
651 | | - |
652 | | - # Image links |
653 | | - $existing = $u->getExistingImages(); |
654 | | - $u->incrTableUpdate( 'imagelinks', 'il', array(), |
655 | | - $u->getImageInsertions( $existing ) ); |
656 | | - |
657 | | - # Invalidate all image description pages which had links added |
658 | | - $imageUpdates = array_diff_key( $u->mImages, $existing ); |
659 | | - $u->invalidateImageDescriptions( $imageUpdates ); |
660 | | - |
661 | | - # External links |
662 | | - $existing = $u->getExistingExternals(); |
663 | | - $u->incrTableUpdate( 'externallinks', 'el', array(), |
664 | | - $u->getExternalInsertions( $existing ) ); |
665 | | - |
666 | | - # Language links |
667 | | - $existing = $u->getExistingInterlangs(); |
668 | | - $u->incrTableUpdate( 'langlinks', 'll', array(), |
669 | | - $u->getInterlangInsertions( $existing ) ); |
670 | | - |
671 | | - # Template links |
672 | | - $existing = $u->getExistingTemplates(); |
673 | | - $u->incrTableUpdate( 'templatelinks', 'tl', array(), |
674 | | - $u->getTemplateInsertions( $existing ) ); |
675 | | - |
676 | | - # Category links |
677 | | - $existing = $u->getExistingCategories(); |
678 | | - $u->incrTableUpdate( 'categorylinks', 'cl', array(), |
679 | | - $u->getCategoryInsertions( $existing ) ); |
680 | | - |
681 | | - # Invalidate all categories which were added, deleted or changed (set symmetric difference) |
682 | | - $categoryUpdates = array_diff_assoc( $u->mCategories, $existing ); |
683 | | - $u->invalidateCategories( $categoryUpdates ); |
684 | | - |
685 | | - # Refresh links of all pages including this page |
686 | | - # This will be in a separate transaction |
687 | | - if( $u->mRecursive ) { |
688 | | - $u->queueRecursiveJobs(); |
| 643 | + $linkUpdate->mLinks += $parserOutput->getLinks(); |
| 644 | + $linkUpdate->mImages += $parserOutput->getImages(); |
| 645 | + $linkUpdate->mTemplates += $parserOutput->getTemplates(); |
| 646 | + $linkUpdate->mExternals += $parserOutput->getExternalLinks(); |
| 647 | + $linkUpdate->mCategories += $parserOutput->getCategories(); |
| 648 | + # Interlanguage links |
| 649 | + $ill = $parserOutput->getLanguageLinks(); |
| 650 | + foreach( $ill as $link ) { |
| 651 | + list( $key, $title ) = explode( ':', $link, 2 ); |
| 652 | + $linkUpdate->mInterlangs[$key] = $title; |
689 | 653 | } |
690 | 654 | |
691 | 655 | wfProfileOut( $fname ); |
— | — | @@ -1430,7 +1394,7 @@ |
1431 | 1395 | // Autopromote Editors |
1432 | 1396 | $wgHooks['ArticleSaveComplete'][] = array($flaggedRevsModifier, 'autoPromoteUser'); |
1433 | 1397 | // Adds table link references to include ones from the stable version |
1434 | | -$wgHooks['TitleLinkUpdatesAfterCompletion'][] = array($flaggedRevsModifier, 'extraLinksUpdate'); |
| 1398 | +$wgHooks['LinksUpdateConstructed'][] = array($flaggedRevsModifier, 'extraLinksUpdate'); |
1435 | 1399 | // If a stable version is hidden, move to the next one if possible, and update things |
1436 | 1400 | $wgHooks['ArticleRevisionVisiblityUpdates'][] = array($flaggedRevsModifier, 'articleLinksUpdate'); |
1437 | 1401 | // Update our table NS/Titles when things are moved |
Index: trunk/extensions/FlaggedRevs/FlaggedRevsPage.i18n.php |
— | — | @@ -29,18 +29,18 @@ |
30 | 30 | 'revreview-quick-none' => '\'\'\'Current\'\'\'. No reviewed revisions.', |
31 | 31 | 'revreview-newest-basic' => 'The [{{fullurl:{{FULLPAGENAMEE}}|stable=1}} latest sighted revision] |
32 | 32 | ([{{fullurl:Special:Stableversions|page={{FULLPAGENAMEE}}}} see all]) of this page was [{{fullurl:Special:Log|type=review&page={{FULLPAGENAMEE}}}} approved] |
33 | | - on <i>$2</i>. <br/> There {{plural:$3|is $3 revision|are $3 revisions}} ([{{fullurl:{{FULLPAGENAMEE}}|oldid=$1&diff=cur}} changes]) awaiting review.', |
| 33 | + on <i>$2</i>. <br/> There {{plural:$3|is|are}} [{{fullurl:{{FULLPAGENAMEE}}|oldid=$1&diff=cur}} $3 {{plural:$3|revision|revisions}}] awaiting review.', |
34 | 34 | 'revreview-newest-quality' => 'The [{{fullurl:{{FULLPAGENAMEE}}|stable=1}} latest quality revision] |
35 | 35 | ([{{fullurl:Special:Stableversions|page={{FULLPAGENAMEE}}}} see all]) of this page was [{{fullurl:Special:Log|type=review&page={{FULLPAGENAMEE}}}} approved] |
36 | | - on <i>$2</i>. <br/> There {{plural:$3|is $3 revision|are $3 revisions}} ([{{fullurl:{{FULLPAGENAMEE}}|oldid=$1&diff=cur}} changes]) awaiting review.', |
| 36 | + on <i>$2</i>. <br/> There {{plural:$3|is|are}} [{{fullurl:{{FULLPAGENAMEE}}|oldid=$1&diff=cur}} $3 {{plural:$3|revision|revisions}}] awaiting review.', |
37 | 37 | 'revreview-basic' => 'This is the latest [[Help:Article validation|sighted]] revision of this page, |
38 | 38 | [{{fullurl:Special:Log|type=review&page={{FULLPAGENAMEE}}}} approved] on <i>$2</i>. The [{{fullurl:{{FULLPAGENAMEE}}|stable=0}} current revision] |
39 | | - is usually [{{fullurl:{{FULLPAGENAMEE}}|action=edit}} editable] and more up to date. There {{plural:$3|is $3 revision|are $3 revisions}} |
40 | | - ([{{fullurl:{{FULLPAGENAMEE}}|oldid=$1&diff=cur}} changes]) awaiting review.', |
| 39 | + is usually [{{fullurl:{{FULLPAGENAMEE}}|action=edit}} editable]. There {{plural:$3|is|are}} [{{fullurl:{{FULLPAGENAMEE}}|oldid=$1&diff=cur}} |
| 40 | + $3 {{plural:$3|revision|revisions}}] awaiting review.', |
41 | 41 | 'revreview-quality' => 'This is the latest [[Help:Article validation|quality]] revision of this page, |
42 | 42 | [{{fullurl:Special:Log|type=review&page={{FULLPAGENAMEE}}}} approved] on <i>$2</i>. The [{{fullurl:{{FULLPAGENAMEE}}|stable=0}} current revision] |
43 | | - is usually [{{fullurl:{{FULLPAGENAMEE}}|action=edit}} editable] and more up to date. There {{plural:$3|is $3 revision|are $3 revisions}} |
44 | | - ([{{fullurl:{{FULLPAGENAMEE}}|oldid=$1&diff=cur}} changes]) awaiting review.', |
| 43 | + is usually [{{fullurl:{{FULLPAGENAMEE}}|action=edit}} editable]. There {{plural:$3|is|are}} |
| 44 | + [{{fullurl:{{FULLPAGENAMEE}}|oldid=$1&diff=cur}} $3 {{plural:$3|revision|revisions}}] awaiting review.', |
45 | 45 | 'revreview-static' => 'This is a [[Help:Article validation|reviewed]] revision of \'\'\'[[:$3|this page]]\'\'\', |
46 | 46 | [{{fullurl:Special:Log/review|page=$1}} approved] on <i>$2</i>. The [{{fullurl:$3|stable=0}} current revision] |
47 | 47 | is usually editable and more up to date.', |
— | — | @@ -196,7 +196,7 @@ |
197 | 197 | |
198 | 198 | 'revreview-newest-quality' => 'Die [{{fullurl:{{FULLPAGENAMEE}}|stable=1}} letzte geprüfte Version] |
199 | 199 | ([{{fullurl:Special:Stableversions|page={{FULLPAGENAMEE}}}} siehe alle]) diese Seite wurde am <i>$2</i> [{{fullurl:Special:Log|type=review&page={{FULLPAGENAMEE}}}} freigegeben]<br/> |
200 | | - There {{plural:$3|is $3 revision|are $3 revisions}} ([{{fullurl:{{FULLPAGENAMEE}}|oldid=$1&diff=cur}} changes]) awaiting review.', |
| 200 | + {{plural:$3|1 Version steht|$3 Versionen stehen}} ([{{fullurl:{{FULLPAGENAMEE}}|oldid=$1&diff=cur}} Änderungen]) noch zur Prüfung an.', |
201 | 201 | |
202 | 202 | 'revreview-basic' => 'Dies ist die letzte [[Help:Gesichtete Versionen|gesichtete]] Version dieser Seite, |
203 | 203 | [{{fullurl:Special:Log|type=review&page={{FULLPAGENAMEE}}}} freigegeben] am <i>$2</i>. Die [{{fullurl:{{FULLPAGENAMEE}}|stable=0}} derzeitige Version] |