* Remove linkscc table code, no longer used.
authorBrion Vibber <brion@users.mediawiki.org>
Tue, 31 May 2005 07:21:31 +0000 (07:21 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Tue, 31 May 2005 07:21:31 +0000 (07:21 +0000)
13 files changed:
RELEASE-NOTES
config/index.php
includes/Article.php
includes/DefaultSettings.php
includes/LinkCache.php
includes/LinksUpdate.php
includes/Setup.php
includes/Title.php
maintenance/convertUtf8.php
maintenance/parserTests.php
maintenance/refreshLinks.inc
maintenance/tables.sql
maintenance/updaters.inc

index fd39faa..bfe233f 100644 (file)
@@ -224,6 +224,7 @@ Various bugfixes, small features, and a few experimental things:
 * (bug 2262) Hide math preferences when TeX is not enabled
 * (bug 2267) Don't generate thumbnail at the same size as the source image.
 * Fix rebuildtextindex.inc for new schema
+* Remove linkscc table code, no longer used.
 
 
 === Caveats ===
index 1a94942..8d9223e 100644 (file)
@@ -1099,7 +1099,7 @@ if ( \$wgCommandLineMode ) {
 \$wgDBprefix         = \"{$slconf['DBprefix']}\";
 
 # If you're on MySQL 3.x, this next line must be FALSE:
-\$wgDBmysql4 = \$wgEnablePersistentLC = {$conf->DBmysql4};
+\$wgDBmysql4 = {$conf->DBmysql4};
 
 ## Shared memory settings
 \$wgMainCacheType = $cacheType;
index e22da0b..d4f4384 100644 (file)
@@ -2222,18 +2222,17 @@ class Article {
                        $u = new SquidUpdate( $urls );
                        array_push( $wgPostCommitUpdateList, $u );
                }
-
-               # Clear persistent link cache
-               LinkCache::linksccClearLinksTo( $title_obj );
        }
 
        function onArticleDelete($title_obj) {
                $title_obj->touchLinks();
-               LinkCache::linksccClearLinksTo( $title_obj );
        }
+       
        function onArticleEdit($title_obj) {
-               LinkCache::linksccClearPage( $title_obj->getArticleID() );
+               // This would be an appropriate place to purge caches.
+               // Why's this not in here now?
        }
+       
        /**#@-*/
 
        /**
index 508747d..14e5c17 100644 (file)
@@ -616,10 +616,6 @@ $wgUseCategoryMagic                = true;
  */
 $wgUseCategoryBrowser   = false;
 
-$wgEnablePersistentLC  = false;        # Obsolete, do not use
-$wgCompressedPersistentLC = true; # use gzcompressed blobs
-$wgUseOldExistenceCheck = false;  # use old prefill link method, for debugging only
-
 /**
  * Keep parsed pages in a cache (objectcache table, turck, or memcached)
  * to speed up output of the same page viewed by another user with the
index 66545ea..ef275ca 100644 (file)
@@ -181,8 +181,6 @@ class LinkCache {
         * @param Title $fromtitle
         */
        function preFill( &$fromtitle ) {
-               global $wgEnablePersistentLC;
-
                $fname = 'LinkCache::preFill';
                wfProfileIn( $fname );
 
@@ -196,12 +194,6 @@ class LinkCache {
                        return;
                }
                
-               if ( $wgEnablePersistentLC ) {
-                       if( $this->fillFromLinkscc( $id ) ){
-                               wfProfileOut( $fname );
-                               return;
-                       }
-               }
                if ( $this->mForUpdate ) {
                        $db =& wfGetDB( DB_MASTER );
                        $options = 'FOR UPDATE';
@@ -229,9 +221,6 @@ class LinkCache {
                }
                $this->mPreFilled = true;
 
-               if ( $wgEnablePersistentLC ) {
-                       $this->saveToLinkscc( $id );
-               }
                wfProfileOut( $fname );
        }
 
@@ -334,95 +323,6 @@ class LinkCache {
                $this->mOldPageLinks = array();
        }
 
-       /**
-        * @access private
-        */
-       function fillFromLinkscc( $id ){ 
-               $fname = 'LinkCache::fillFromLinkscc';
-
-               $id = IntVal( $id );
-               if ( $this->mForUpdate ) {
-                       $db =& wfGetDB( DB_MASTER );
-                       $options = 'FOR UPDATE';
-               } else {
-                       $db =& wfGetDB( DB_SLAVE );
-                       $options = '';
-               }
-               $raw = $db->selectField( 'linkscc', 'lcc_cacheobj', array( 'lcc_pageid' => $id ), $fname, $options );
-               if ( $raw === false ) {
-                       return false;
-               }
-               
-               $cacheobj = false;
-               if( function_exists( 'gzuncompress' ) )
-                       $cacheobj = @gzuncompress( $raw );
-
-               if($cacheobj == FALSE){
-                       $cacheobj = $raw;
-               }
-               $cc = @unserialize( $cacheobj );
-               if( isset( $cc->mClassVer ) and ($cc->mClassVer == $this->mClassVer ) ){
-                       $this->mOldPageLinks = $this->mPageLinks = $cc->mPageLinks;
-                       $this->mOldGoodLinks = $this->mGoodLinks = $cc->mGoodLinks;
-                       $this->mOldBadLinks = $this->mBadLinks = $cc->mBadLinks;
-                       $this->mPreFilled = true;
-                       return TRUE;
-               } else {
-                       return FALSE;
-               }
-
-       }
-
-       /**
-        * @access private
-        */
-       function saveToLinkscc( $pid ){
-               global $wgCompressedPersistentLC;
-               if( $wgCompressedPersistentLC and function_exists( 'gzcompress' ) ) {
-                       $ser = gzcompress( serialize( $this ), 3 );
-               } else {
-                       $ser = serialize( $this );
-               }
-               $db =& wfGetDB( DB_MASTER );
-               $db->replace( 'linkscc', array( 'lcc_pageid' ), array( 'lcc_pageid' => $pid, 'lcc_cacheobj' => $ser ) );
-       }
-
-       /**
-        * Delete linkscc rows which link to here
-        * @param $title The page linked to
-        * @static
-        */
-       function linksccClearLinksTo( $title ){
-               global $wgEnablePersistentLC;
-               if ( $wgEnablePersistentLC ) {
-                       $fname = 'LinkCache::linksccClearLinksTo';
-                       $pid = intval( $pid );
-                       $dbw =& wfGetDB( DB_MASTER );
-                       # Delete linkscc rows which link to here
-                       $dbw->deleteJoin( 'linkscc', 'pagelinks', 'lcc_pageid', 'pl_from',
-                               array(
-                                       'pl_namespace' => $title->getNamespace(),
-                                       'pl-title'     => $title->getDbKey() ),
-                               $fname );
-                       # Delete linkscc row representing this page
-                       $dbw->delete( 'linkscc', array( 'lcc_pageid' => $pid ), $fname);
-               }
-
-       }
-
-       /**
-        * @param $pid is a page id
-        * @static
-        */
-       function linksccClearPage( $pid ){
-               global $wgEnablePersistentLC;
-               if ( $wgEnablePersistentLC ) {
-                       $pid = intval( $pid );
-                       $dbw =& wfGetDB( DB_MASTER );
-                       $dbw->delete( 'linkscc', array( 'lcc_pageid' => $pid ) );
-               }
-       }
-
        /**
         * Swaps old and current link registers
         */
index 506402e..b0fac36 100644 (file)
@@ -34,7 +34,7 @@ class LinksUpdate {
        
        function doUpdate() {
                global $wgUseDumbLinkUpdate, $wgLinkCache, $wgDBtransactions;
-               global $wgEnablePersistentLC, $wgUseCategoryMagic;
+               global $wgUseCategoryMagic;
 
                if ( $wgUseDumbLinkUpdate ) {
                        $this->doDumbUpdate();
index a9969dd..e098396 100644 (file)
@@ -97,11 +97,6 @@ if ( $wgCommandLineMode ) {
        wfDebug( $_SERVER['REQUEST_METHOD'] . ' ' . $_SERVER['REQUEST_URI'] . "\n" );
 }
 
-# Disable linkscc except if the old existence check method is enabled
-if (!$wgUseOldExistenceCheck) {
-       $wgEnablePersistentLC = false;
-}
-
 if ( $wgSkipSkin ) {
        $wgSkipSkins[] = $wgSkipSkin;
 }
index af25e70..d2b47e0 100644 (file)
@@ -1652,10 +1652,6 @@ class Title {
                                'pl_title'     => $this->getDbKey() ),
                        $fname );
                
-               # Clear linkscc
-               LinkCache::linksccClearLinksTo( $this );
-               LinkCache::linksccClearLinksTo( $nt );
-               
                # Purge squid
                if ( $wgUseSquid ) {
                        $urls = array_merge( $nt->getSquidURLs(), $this->getSquidURLs() );
@@ -1722,7 +1718,7 @@ class Title {
                $log = new LogPage( 'move' );
                $log->addEntry( 'move', $this, $reason, array( 1 => $nt->getPrefixedText()) );
 
-               # Purge squid and linkscc as per article creation
+               # Purge caches as per article creation
                Article::onArticleCreate( $nt );
 
                # Record the just-created redirect's linking to the page
index 14096cf..309784b 100644 (file)
@@ -130,13 +130,12 @@ class UtfUpdater {
         */     
        function updateAll() {
                $this->lockTables( array(
-                       'linkscc', 'objectcache', 'searchindex', 'querycache',
+                       'objectcache', 'searchindex', 'querycache',
                        'ipblocks', 'user', 'page', 'revision', 'recentchanges',
                        'brokenlinks', 'categorylinks', 'imagelinks', 'watchlist',
                        'image', 'oldimage', 'archive' ) );
                
                # These are safe to clear out:
-               $this->clearTable( 'linkscc' );
                $this->clearTable( 'objectcache' );
 
                # These need to be rebuild if used:
index 1205090..e18cb72 100644 (file)
@@ -30,6 +30,7 @@ $optionsWithArgs = array( 'regex' );
 
 require_once( 'commandLine.inc' );
 require_once( "$IP/includes/ObjectCache.php" );
+require_once( "$IP/includes/BagOStuff.php" );
 require_once( "$IP/languages/LanguageUtf8.php" );
 
 /**
@@ -321,7 +322,7 @@ class ParserTest {
        function listTables() {
                return array('user', 'page', 'revision', 'text',
                        'pagelinks', 'imagelinks', 'categorylinks',
-                       'linkscc', 'site_stats', 'hitcounter',
+                       'site_stats', 'hitcounter',
                        'ipblocks', 'image', 'oldimage',
                        'recentchanges',
                        'watchlist', 'math', 'searchindex',
index b7e1a23..7eb6c60 100644 (file)
@@ -10,7 +10,7 @@ define( "REPORTING_INTERVAL", 50 );
 define( "PAUSE_INTERVAL", 50 );
 
 function refreshLinks( $start ) {
-       global $wgUser, $wgTitle, $wgArticle, $wgEnablePersistentLC, $wgLinkCache, $wgOut;
+       global $wgUser, $wgTitle, $wgArticle, $wgLinkCache, $wgOut;
 
        $dbw =& wfGetDB( DB_MASTER );
        
@@ -59,10 +59,6 @@ function refreshLinks( $start ) {
                $wgOut->transformBuffer( RLH_FOR_UPDATE );
                $wgOut->clearHTML();
 
-               if ( $wgEnablePersistentLC ) {
-                       $wgLinkCache->saveToLinkscc( $id, $dbw->strencode( $wgTitle->getPrefixedDBkey() ) );
-               }
-
                $linksUpdate = new LinksUpdate( $id, $wgTitle->getPrefixedDBkey() );
                $linksUpdate->doDumbUpdate();
                $dbw->query("COMMIT");
index 8b73be6..2bf8de4 100644 (file)
@@ -404,17 +404,6 @@ CREATE TABLE /*$wgDBprefix*/categorylinks (
 
 ) TYPE=InnoDB;
 
---
--- Stores (possibly gzipped) serialized objects with
--- cache arrays to reduce database load slurping up
--- from links and brokenlinks.
---
-CREATE TABLE /*$wgDBprefix*/linkscc (
-  lcc_pageid INT UNSIGNED NOT NULL UNIQUE KEY,
-  lcc_cacheobj MEDIUMBLOB NOT NULL
-
-) TYPE=InnoDB;
-
 --
 -- Contains a single row with some aggregate info
 -- on the state of the site.
index c319c9c..e2255c7 100644 (file)
@@ -16,7 +16,6 @@ $wgRenamedTables = array(
 
 $wgNewTables = array(
 #            table          patch file (in maintenance/archives)
-       array( 'linkscc',       'patch-linkscc.sql' ),
        array( 'hitcounter',    'patch-hitcounter.sql' ),
        array( 'querycache',    'patch-querycache.sql' ),
        array( 'objectcache',   'patch-objectcache.sql' ),
@@ -156,19 +155,6 @@ function do_index_update() {
        return false;
 }
 
-function do_linkscc_1_3_update() {
-       // Update linkscc table to 1.3 schema if necessary
-       global $wgDatabase, $wgVersion;
-       if( $wgDatabase->tableExists( "linkscc" )
-               && $wgDatabase->fieldExists( "linkscc", "lcc_title" ) ) {
-               echo "Altering lcc_title field from linkscc table... ";
-               dbsource( "maintenance/archives/patch-linkscc-1.3.sql", $wgDatabase );
-               echo "ok\n";
-       } else {
-               echo "...linkscc is up to date, or does not exist. Good.\n";
-       }
-}
-
 function do_image_name_unique_update() {
        global $wgDatabase;
        if( $wgDatabase->indexExists( 'image', 'PRIMARY' ) ) {
@@ -596,7 +582,6 @@ function do_all_updates() {
        # Do schema updates which require special handling
        do_interwiki_update(); flush();
        do_index_update(); flush();
-       do_linkscc_1_3_update(); flush();
        do_old_links_update(); flush();
        do_image_name_unique_update(); flush();
        do_watchlist_update(); flush();