From 6df15daa3445c1e4191264054480a1e17773e1ae Mon Sep 17 00:00:00 2001 From: Erik Moeller Date: Sat, 3 Jan 2004 02:46:35 +0000 Subject: [PATCH] $wgUseBetterLinksUpdate no longer needed, removed, doDumbUpdate removed --- LocalSettings.sample | 4 -- includes/Article.php | 8 ++-- includes/DefaultSettings.php | 1 - includes/LinksUpdate.php | 80 ------------------------------------ 4 files changed, 3 insertions(+), 90 deletions(-) diff --git a/LocalSettings.sample b/LocalSettings.sample index b3cffb62db..67b1b4ed2e 100644 --- a/LocalSettings.sample +++ b/LocalSettings.sample @@ -38,10 +38,6 @@ $wgDBsqlpassword = "sqlpass"; $wgDBminWordLen = 3; # Match this to your MySQL fulltext $wgDBtransactions = false; # Set to true if using InnoDB tables -# This code is still slightly experimental. Turn it off if "What links here" -# and similar stuff does not work. -$wgUseBetterLinksUpdate=true; - # Turn this on during database maintenance # $wgReadOnly = true; diff --git a/includes/Article.php b/includes/Article.php index 470fffdf2b..4d1bca9198 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -531,16 +531,14 @@ class Article { function showArticle( $text, $subtitle ) { - global $wgOut, $wgUser, $wgLinkCache, $wgUseBetterLinksUpdate; + global $wgOut, $wgUser, $wgLinkCache; global $wgMwRedir; $wgLinkCache = new LinkCache(); # Get old version of link table to allow incremental link updates - if ( $wgUseBetterLinksUpdate ) { - $wgLinkCache->preFill( $this->mTitle ); - $wgLinkCache->clear(); - } + $wgLinkCache->preFill( $this->mTitle ); + $wgLinkCache->clear(); # Now update the link cache by parsing the text $wgOut = new OutputPage(); diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index a05a687397..f1b66a25bf 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -85,7 +85,6 @@ $wgDebugComments = false; $wgReadOnly = false; $wgSqlLogFile = "{$wgUploadDirectory}/sqllog_mFhyRe6"; $wgLogQueries = false; -$wgUseBetterLinksUpdate = true; $wgUseCategoryMagic = false; $wgEnablePersistentLC = true; # Persistent link cache, needs the linkscc table $wgCompressedPersistentLC = true; # use gzcompressed blobs diff --git a/includes/LinksUpdate.php b/includes/LinksUpdate.php index 8106e58089..1c76afccbb 100644 --- a/includes/LinksUpdate.php +++ b/includes/LinksUpdate.php @@ -21,11 +21,6 @@ class LinksUpdate { /* Update link tables with outgoing links from an updated article */ /* Relies on the 'link cache' to be filled out */ - if ( !$wgUseBetterLinksUpdate ) { - $this->doDumbUpdate(); - return; - } - $fname = "LinksUpdate::doUpdate"; wfProfileIn( $fname ); @@ -147,81 +142,6 @@ class LinksUpdate { wfProfileOut( $fname ); } - function doDumbUpdate() - { - # Old update function. This can probably be removed eventually, if the new one - # proves to be stable - global $wgLinkCache, $wgDBtransactions; - $fname = "LinksUpdate::doDumbUpdate"; - wfProfileIn( $fname ); - - if( $wgDBtransactions ) { - $sql = "BEGIN"; - wfQuery( $sql, DB_WRITE, $fname ); - } - - $sql = "DELETE FROM links WHERE l_from='{$this->mTitleEnc}'"; - wfQuery( $sql, DB_WRITE, $fname ); - - $a = $wgLinkCache->getGoodLinks(); - $sql = ""; - if ( 0 != count( $a ) ) { - $sql = "INSERT INTO links (l_from,l_to) VALUES "; - $first = true; - foreach( $a as $lt => $lid ) { - if ( ! $first ) { $sql .= ","; } - $first = false; - - $sql .= "('{$this->mTitleEnc}',{$lid})"; - } - } - if ( "" != $sql ) { wfQuery( $sql, DB_WRITE, $fname ); } - - $sql = "DELETE FROM brokenlinks WHERE bl_from={$this->mId}"; - wfQuery( $sql, DB_WRITE, $fname ); - - $a = $wgLinkCache->getBadLinks(); - $sql = ""; - if ( 0 != count ( $a ) ) { - $sql = "INSERT INTO brokenlinks (bl_from,bl_to) VALUES "; - $first = true; - foreach( $a as $blt ) { - $blt = wfStrencode( $blt ); - if ( ! $first ) { $sql .= ","; } - $first = false; - - $sql .= "({$this->mId},'{$blt}')"; - } - } - if ( "" != $sql ) { wfQuery( $sql, DB_WRITE, $fname ); } - - $sql = "DELETE FROM imagelinks WHERE il_from='{$this->mTitleEnc}'"; - wfQuery( $sql, DB_WRITE, $fname ); - - $a = $wgLinkCache->getImageLinks(); - $sql = ""; - if ( 0 != count ( $a ) ) { - $sql = "INSERT INTO imagelinks (il_from,il_to) VALUES "; - $first = true; - foreach( $a as $iname => $val ) { - $iname = wfStrencode( $iname ); - if ( ! $first ) { $sql .= ","; } - $first = false; - - $sql .= "('{$this->mTitleEnc}','{$iname}')"; - } - } - if ( "" != $sql ) { wfQuery( $sql, DB_WRITE, $fname ); } - - $this->fixBrokenLinks(); - - if( $wgDBtransactions ) { - $sql = "COMMIT"; - wfQuery( $sql, DB_WRITE, $fname ); - } - wfProfileOut( $fname ); - } - function fixBrokenLinks() { /* Update any brokenlinks *to* this page */ /* Call for a newly created page, or just to make sure state is consistent */ -- 2.20.1