Index: trunk/phase3/maintenance/parserTests.inc |
— | — | @@ -454,7 +454,7 @@ |
455 | 455 | 'protected_titles', 'revision', 'text', 'pagelinks', 'imagelinks', |
456 | 456 | 'categorylinks', 'templatelinks', 'externallinks', 'langlinks', |
457 | 457 | 'site_stats', 'hitcounter', 'ipblocks', 'image', 'oldimage', |
458 | | - 'recentchanges', 'recentlinkchanges', 'watchlist', 'math', 'interwiki', |
| 458 | + 'recentchanges', 'watchlist', 'math', 'interwiki', |
459 | 459 | 'querycache', 'objectcache', 'job', 'redirect', 'querycachetwo', |
460 | 460 | 'archive', 'user_groups', 'page_props', 'category' |
461 | 461 | ); |
Index: trunk/phase3/maintenance/postgres/archives/patch-recentlinkchanges.sql |
— | — | @@ -1,12 +0,0 @@ |
2 | | -CREATE SEQUENCE recentlinkchanges_rcl_id_seq; |
3 | | -CREATE TABLE recentlinkchanges ( |
4 | | - rlc_id INTEGER NOT NULL PRIMARY KEY DEFAULT nextval('recentlinkchanges_rcl_id_seq'), |
5 | | - rlc_type TEXT NOT NULL, |
6 | | - rlc_timestamp TIMESTAMPTZ NOT NULL, |
7 | | - rlc_action SMALLINT NOT NULL DEFAULT 0, |
8 | | - rlc_from INTEGER NOT NULL, |
9 | | - rlc_to_namespace SMALLINT, |
10 | | - rlc_to_title TEXT, |
11 | | - rlc_to_blob TEXT |
12 | | -); |
13 | | -CREATE INDEX recentlinkchanges_type ON recentlinkchanges(rlc_type); |
Index: trunk/phase3/maintenance/postgres/tables.sql |
— | — | @@ -538,19 +538,6 @@ |
539 | 539 | ); |
540 | 540 | |
541 | 541 | |
542 | | -CREATE SEQUENCE recentlinkchanges_rcl_id_seq; |
543 | | -CREATE TABLE recentlinkchanges ( |
544 | | - rlc_id INTEGER NOT NULL PRIMARY KEY DEFAULT nextval('recentlinkchanges_rcl_id_seq'), |
545 | | - rlc_type TEXT NOT NULL, |
546 | | - rlc_timestamp TIMESTAMPTZ NOT NULL, |
547 | | - rlc_action SMALLINT NOT NULL DEFAULT 0, |
548 | | - rlc_from INTEGER NOT NULL, |
549 | | - rlc_to_namespace SMALLINT, |
550 | | - rlc_to_title TEXT, |
551 | | - rlc_to_blob TEXT |
552 | | -); |
553 | | -CREATE INDEX recentlinkchanges_type ON recentlinkchanges(rlc_type); |
554 | | - |
555 | 542 | CREATE SEQUENCE category_id_seq; |
556 | 543 | CREATE TABLE category ( |
557 | 544 | cat_id INTEGER NOT NULL PRIMARY KEY DEFAULT nextval('category_id_seq'), |
Index: trunk/phase3/maintenance/updaters.inc |
— | — | @@ -1423,7 +1423,6 @@ |
1424 | 1424 | array("page_restrictions", "patch-page_restrictions.sql"), |
1425 | 1425 | array("profiling", "patch-profiling.sql"), |
1426 | 1426 | array("protected_titles", "patch-protected_titles.sql"), |
1427 | | - array("recentlinkchanges", "patch-recentlinkchanges.sql"), |
1428 | 1427 | array("redirect", "patch-redirect.sql"), |
1429 | 1428 | array("updatelog", "patch-updatelog.sql"), |
1430 | 1429 | ); |
Index: trunk/phase3/maintenance/tables.sql |
— | — | @@ -1237,28 +1237,4 @@ |
1238 | 1238 | PRIMARY KEY (ul_key) |
1239 | 1239 | ) /*$wgDBTableOptions*/; |
1240 | 1240 | |
1241 | | -CREATE TABLE /*$wgDBprefix*/recentlinkchanges ( |
1242 | | - rlc_id int unsigned NOT NULL auto_increment, |
1243 | | - |
1244 | | - -- page, image, category, ... |
1245 | | - rlc_type varchar(15) binary NOT NULL, |
1246 | | - rlc_timestamp binary(14) NOT NULL default '', |
1247 | | - -- 1: insert; 2: deletion; |
1248 | | - -- should probably make this an enum... |
1249 | | - rlc_action tinyint NOT NULL default 0, |
1250 | | - |
1251 | | - -- page where the links are on |
1252 | | - rlc_from int NOT NULL, |
1253 | | - |
1254 | | - rlc_to_namespace int, |
1255 | | - rlc_to_title varchar(255) binary, |
1256 | | - rlc_to_blob blob, |
1257 | | - |
1258 | | - PRIMARY KEY (rlc_id), |
1259 | | - KEY from_timestamp (rlc_type, rlc_timestamp), |
1260 | | - KEY to_timestamp (rlc_to_namespace, rlc_to_title, rlc_timestamp) |
1261 | | -) /*$wgDBTableOptions*/; |
1262 | | - |
1263 | 1241 | -- vim: sw=2 sts=2 et |
Index: trunk/phase3/includes/LinksUpdate.php |
— | — | @@ -12,19 +12,12 @@ |
13 | 13 | var $mId, //!< Page ID of the article linked from |
14 | 14 | $mTitle, //!< Title object of the article linked from |
15 | 15 | $mLinks, //!< Map of title strings to IDs for the links in the document |
16 | | - $mExistingLinks, |
17 | 16 | $mImages, //!< DB keys of the images used, in the array key only |
18 | | - $mExistingImages, |
19 | 17 | $mTemplates, //!< Map of title strings to IDs for the template references, including broken ones |
20 | | - $mExistingTemplates, |
21 | 18 | $mExternals, //!< URLs of external links, array key only |
22 | | - $mExistingExternals, |
23 | 19 | $mCategories, //!< Map of category names to sort keys |
24 | | - $mExistingCategories, |
25 | 20 | $mInterlangs, //!< Map of language codes to titles |
26 | | - $mExistingInterlangs, |
27 | 21 | $mProperties, //!< Map of arbitrary name to value |
28 | | - $mExistingProperties, |
29 | 22 | $mDb, //!< Database connection reference |
30 | 23 | $mOptions, //!< SELECT options to be used (array) |
31 | 24 | $mRecursive; //!< Whether to queue jobs for recursive updates |
— | — | @@ -82,7 +75,7 @@ |
83 | 76 | * Update link tables with outgoing links from an updated article |
84 | 77 | */ |
85 | 78 | function doUpdate() { |
86 | | - global $wgUseDumbLinkUpdate, $wgTrackLinkChanges; |
| 79 | + global $wgUseDumbLinkUpdate; |
87 | 80 | |
88 | 81 | wfRunHooks( 'LinksUpdate', array( &$this ) ); |
89 | 82 | if ( $wgUseDumbLinkUpdate ) { |
— | — | @@ -90,8 +83,6 @@ |
91 | 84 | } else { |
92 | 85 | $this->doIncrementalUpdate(); |
93 | 86 | } |
94 | | - if ( $wgTrackLinkChanges ) |
95 | | - $this->makeRecentlinkchanges(); |
96 | 87 | wfRunHooks( 'LinksUpdateComplete', array( &$this ) ); |
97 | 88 | |
98 | 89 | } |
— | — | @@ -574,9 +565,6 @@ |
575 | 566 | * @private |
576 | 567 | */ |
577 | 568 | function getExistingLinks() { |
578 | | - if ( is_array( $this->mExistingLinks ) ) |
579 | | - return $this->mExistingLinks; |
580 | | - |
581 | 569 | $res = $this->mDb->select( 'pagelinks', array( 'pl_namespace', 'pl_title' ), |
582 | 570 | array( 'pl_from' => $this->mId ), __METHOD__, $this->mOptions ); |
583 | 571 | $arr = array(); |
— | — | @@ -587,7 +575,7 @@ |
588 | 576 | $arr[$row->pl_namespace][$row->pl_title] = 1; |
589 | 577 | } |
590 | 578 | $this->mDb->freeResult( $res ); |
591 | | - return $this->mExistingLinks = $arr; |
| 579 | + return $arr; |
592 | 580 | } |
593 | 581 | |
594 | 582 | /** |
— | — | @@ -595,9 +583,6 @@ |
596 | 584 | * @private |
597 | 585 | */ |
598 | 586 | function getExistingTemplates() { |
599 | | - if ( is_array( $this->mExistingTemplates ) ) |
600 | | - return $this->mExistingTemplates; |
601 | | - |
602 | 587 | $res = $this->mDb->select( 'templatelinks', array( 'tl_namespace', 'tl_title' ), |
603 | 588 | array( 'tl_from' => $this->mId ), __METHOD__, $this->mOptions ); |
604 | 589 | $arr = array(); |
— | — | @@ -608,7 +593,7 @@ |
609 | 594 | $arr[$row->tl_namespace][$row->tl_title] = 1; |
610 | 595 | } |
611 | 596 | $this->mDb->freeResult( $res ); |
612 | | - return $this->mExistingTemplates = $arr; |
| 597 | + return $arr; |
613 | 598 | } |
614 | 599 | |
615 | 600 | /** |
— | — | @@ -616,9 +601,6 @@ |
617 | 602 | * @private |
618 | 603 | */ |
619 | 604 | function getExistingImages() { |
620 | | - if ( is_array( $this->mExistingImages ) ) |
621 | | - return $this->mExistingImages; |
622 | | - |
623 | 605 | $res = $this->mDb->select( 'imagelinks', array( 'il_to' ), |
624 | 606 | array( 'il_from' => $this->mId ), __METHOD__, $this->mOptions ); |
625 | 607 | $arr = array(); |
— | — | @@ -626,7 +608,7 @@ |
627 | 609 | $arr[$row->il_to] = 1; |
628 | 610 | } |
629 | 611 | $this->mDb->freeResult( $res ); |
630 | | - return $this->mExistingImages = $arr; |
| 612 | + return $arr; |
631 | 613 | } |
632 | 614 | |
633 | 615 | /** |
— | — | @@ -634,9 +616,6 @@ |
635 | 617 | * @private |
636 | 618 | */ |
637 | 619 | function getExistingExternals() { |
638 | | - if ( is_array( $this->mExistingExternals ) ) |
639 | | - return $this->mExistingExternals; |
640 | | - |
641 | 620 | $res = $this->mDb->select( 'externallinks', array( 'el_to' ), |
642 | 621 | array( 'el_from' => $this->mId ), __METHOD__, $this->mOptions ); |
643 | 622 | $arr = array(); |
— | — | @@ -644,7 +623,7 @@ |
645 | 624 | $arr[$row->el_to] = 1; |
646 | 625 | } |
647 | 626 | $this->mDb->freeResult( $res ); |
648 | | - return $this->mExistingExternals = $arr; |
| 627 | + return $arr; |
649 | 628 | } |
650 | 629 | |
651 | 630 | /** |
— | — | @@ -652,9 +631,6 @@ |
653 | 632 | * @private |
654 | 633 | */ |
655 | 634 | function getExistingCategories() { |
656 | | - if ( is_array( $this->mExistingCategories ) ) |
657 | | - return $this->mExistingCategories; |
658 | | - |
659 | 635 | $res = $this->mDb->select( 'categorylinks', array( 'cl_to', 'cl_sortkey' ), |
660 | 636 | array( 'cl_from' => $this->mId ), __METHOD__, $this->mOptions ); |
661 | 637 | $arr = array(); |
— | — | @@ -662,7 +638,7 @@ |
663 | 639 | $arr[$row->cl_to] = $row->cl_sortkey; |
664 | 640 | } |
665 | 641 | $this->mDb->freeResult( $res ); |
666 | | - return $this->mExistingCategories = $arr; |
| 642 | + return $arr; |
667 | 643 | } |
668 | 644 | |
669 | 645 | /** |
— | — | @@ -671,16 +647,13 @@ |
672 | 648 | * @private |
673 | 649 | */ |
674 | 650 | function getExistingInterlangs() { |
675 | | - if ( is_array( $this->mExistingInterlangs ) ) |
676 | | - return $this->mExistingInterlangs; |
677 | | - |
678 | 651 | $res = $this->mDb->select( 'langlinks', array( 'll_lang', 'll_title' ), |
679 | 652 | array( 'll_from' => $this->mId ), __METHOD__, $this->mOptions ); |
680 | 653 | $arr = array(); |
681 | 654 | while ( $row = $this->mDb->fetchObject( $res ) ) { |
682 | 655 | $arr[$row->ll_lang] = $row->ll_title; |
683 | 656 | } |
684 | | - return $this->mExistingInterlangs = $arr; |
| 657 | + return $arr; |
685 | 658 | } |
686 | 659 | |
687 | 660 | /** |
— | — | @@ -688,9 +661,6 @@ |
689 | 662 | * @private |
690 | 663 | */ |
691 | 664 | function getExistingProperties() { |
692 | | - if ( is_array( $this->mExistingProperties ) ) |
693 | | - return $this->mExistingProperties; |
694 | | - |
695 | 665 | $res = $this->mDb->select( 'page_props', array( 'pp_propname', 'pp_value' ), |
696 | 666 | array( 'pp_page' => $this->mId ), __METHOD__, $this->mOptions ); |
697 | 667 | $arr = array(); |
— | — | @@ -698,7 +668,7 @@ |
699 | 669 | $arr[$row->pp_propname] = $row->pp_value; |
700 | 670 | } |
701 | 671 | $this->mDb->freeResult( $res ); |
702 | | - return $this->mExistingProperties = $arr; |
| 672 | + return $arr; |
703 | 673 | } |
704 | 674 | |
705 | 675 | |
— | — | @@ -728,124 +698,4 @@ |
729 | 699 | } |
730 | 700 | } |
731 | 701 | } |
732 | | - |
733 | | - // Recentlinkchanges constants |
734 | | - const INSERTION = 1; |
735 | | - const DELETION = 2; |
736 | | - private static $rlcFields = array( |
737 | | - 'rlc_type', |
738 | | - 'rlc_timestamp', |
739 | | - 'rlc_action', |
740 | | - 'rlc_from', |
741 | | - 'rlc_to_namespace', |
742 | | - 'rlc_to_title', |
743 | | - 'rlc_to_blob' |
744 | | - ); |
745 | | - /* |
746 | | - * Insert items to recentlinkchanges |
747 | | - */ |
748 | | - function makeRecentlinkchanges() { |
749 | | - $insert = array(); |
750 | | - $now = $this->mDb->timestamp(); |
751 | | - |
752 | | - // Category changes |
753 | | - $existing = array_keys( $this->getExistingCategories() ); |
754 | | - $current = array_keys( $this->mCategories ); |
755 | | - $this->simpleAddToLinkchanges( $insert, 'category', $now, $existing, $current, NS_CATEGORY ); |
756 | | - |
757 | | - // External links |
758 | | - $existing = array_keys( $this->getExistingExternals() ); |
759 | | - $current = array_keys( $this->mExternals ); |
760 | | - $insertions = array_diff( $current, $existing ); |
761 | | - foreach ( $insertions as $item ) |
762 | | - $insert[] = array( |
763 | | - 'external', $now, self::INSERTION, |
764 | | - $this->mId, null, null, $item ); |
765 | | - $deletions = array_diff( $existing, $current ); |
766 | | - foreach ( $deletions as $item ) |
767 | | - $insert[] = array( |
768 | | - 'external', $now, self::DELETION, |
769 | | - $this->mId, null, null, $item ); |
770 | | - |
771 | | - // Image changes |
772 | | - $existing = array_keys( $this->getExistingImages() ); |
773 | | - $current = array_keys( $this->mImages ); |
774 | | - $this->simpleAddToLinkchanges( $insert, 'image', $now, $existing, $current, NS_IMAGE ); |
775 | | - |
776 | | - // Interlangs |
777 | | - $existing = $this->getExistingInterlangs(); |
778 | | - $current = $this->mInterlangs; |
779 | | - $this->assocAddToLinkchanges( $insert, 'interlang', $existing, $current ); |
780 | | - |
781 | | - // Page links |
782 | | - $existing = $this->getExistingLinks(); |
783 | | - $current = $this->mLinks; |
784 | | - $this->addToLinkChangesByNamespace( $insert, 'page', $now, $existing, $current); |
785 | | - |
786 | | - // Properties |
787 | | - $existing = $this->getExistingProperties(); |
788 | | - $current = $this->mProperties; |
789 | | - $this->assocAddToLinkchanges( $insert, 'property', $existing, $current ); |
790 | | - |
791 | | - // Templates |
792 | | - $existing = $this->getExistingTemplates(); |
793 | | - $current = $this->mTemplates; |
794 | | - $this->addToLinkChangesByNamespace( $insert, 'template', $now, $existing, $current); |
795 | | - |
796 | | - $this->mDb->insert( 'recentlinkchanges', $insert, __METHOD__ ); |
797 | | - |
798 | | - } |
799 | | - |
800 | | - /* |
801 | | - * Compute the difference for arrays of titles with namespace $ns and add |
802 | | - * them to $insert. |
803 | | - */ |
804 | | - private function simpleAddToLinkchanges( &$insert, $type, $now, $existing, $current, $ns ) { |
805 | | - |
806 | | - $insertions = array_diff( $current, $existing ); |
807 | | - foreach ( $insertions as $item ) |
808 | | - $insert[] = array_combine(self::$rlcFields, array( |
809 | | - $type, $now, self::INSERTION, |
810 | | - $this->mId, $ns, $item, null |
811 | | - ) ); |
812 | | - $deletions = array_diff( $existing, $current ); |
813 | | - foreach ( $deletions as $item ) |
814 | | - $insert[] = array_combine(self::$rlcFields, array( |
815 | | - $type, $now, self::DELETION, |
816 | | - $this->mId, $ns, $item, null |
817 | | - ) ); |
818 | | - |
819 | | - } |
820 | | - |
821 | | - /* |
822 | | - * Compute the difference for associative arrays and insert them to |
823 | | - * $insert as title => blob. |
824 | | - */ |
825 | | - function assocAddToLinkChanges( &$insert, $type, $now, $existing, $current ) { |
826 | | - $insertions = array_diff_assoc( $current, $existing ); |
827 | | - foreach ( $insertions as $key => $value ) |
828 | | - $insert[] = array_combine(self::$rlcFields, array( |
829 | | - $type, $now, self::INSERTION, |
830 | | - $this->mId, null, $key, $value |
831 | | - ) ); |
832 | | - $deletions = array_diff_assoc( $existing, $current ); |
833 | | - foreach ( $deletions as $key => $value ) |
834 | | - $insert[] = array_combine(self::$rlcFields, array( |
835 | | - $type, $now, self::DELETION, |
836 | | - $this->mId, null, $key, $value |
837 | | - ) ); |
838 | | - } |
839 | | - |
840 | | - /* |
841 | | - * Format arrays in the form $namespace => $titleArray for use in |
842 | | - * simpleAddLinkLinkChanges |
843 | | - */ |
844 | | - function addToLinkChangesByNamespace( &$insert, $type, $now, $existing, $current ) { |
845 | | - $namespaces = array_merge( array_keys( $existing ), array_keys( $current ) ); |
846 | | - foreach ( $namespaces as $ns ) |
847 | | - $this->simpleAddToLinkchanges( $insert, $type, $now, |
848 | | - isset( $existing[$ns] ) ? array_keys( $existing[$ns] ) : array(), |
849 | | - isset( $current[$ns] ) ? array_keys( $current[$ns] ) : array(), |
850 | | - $ns ); |
851 | | - } |
852 | 702 | } |
Index: trunk/phase3/includes/DefaultSettings.php |
— | — | @@ -3265,8 +3265,3 @@ |
3266 | 3266 | * ting this variable false. |
3267 | 3267 | */ |
3268 | 3268 | $wgUseAutomaticEditSummaries = true; |
3269 | | - |
3270 | | -/* |
3271 | | - * Track link changes |
3272 | | - */ |
3273 | | -$wgTrackLinkChanges = false; |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -185,9 +185,7 @@ |
186 | 186 | * Add a new hook NormalizeMessageKey to allow extensions to replace messages before |
187 | 187 | the database is potentially queried |
188 | 188 | * (bug 9736) Redirects on Special:Fewestrevisions are now marked as such. |
189 | | -* (bug 13588) Experimentally track link changes if $wgTrackLinkChanges is set |
190 | | - to true. Requires schema change. |
191 | | - |
| 189 | + |
192 | 190 | === Bug fixes in 1.13 === |
193 | 191 | |
194 | 192 | * (bug 10677) Add link to the file description page on the shared repository |