From: Brion Vibber Date: Tue, 25 Nov 2003 06:57:24 +0000 (+0000) Subject: Fix incremental link update with persistent linkcache X-Git-Tag: 1.1.0~86 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22auteur_infos%22%2C%20%22id_auteur=%24id%22%29%20.%20%22?a=commitdiff_plain;h=b292c89f24eb8668d0df7a09b31a7a32d6a8465f;p=lhc%2Fweb%2Fwiklou.git Fix incremental link update with persistent linkcache --- diff --git a/includes/Article.php b/includes/Article.php index 08594baeeb..282886a752 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -492,6 +492,7 @@ class Article { "WHERE rc_cur_id=" . $this->getID(); wfQuery( $sql, DB_WRITE, $fname ); + global $wgEnablePersistentLC; if ( $wgEnablePersistentLC ) { // Purge link cache for this page diff --git a/includes/LinkCache.php b/includes/LinkCache.php index 80e7c5cae9..108f88783c 100644 --- a/includes/LinkCache.php +++ b/includes/LinkCache.php @@ -154,10 +154,11 @@ class LinkCache { if( $row != FALSE){ $cacheobj = gzuncompress( $row->lcc_cacheobj ); $cc = unserialize( $cacheobj ); - $this->mGoodLinks = $cc->mGoodLinks; - $this->mBadLinks = $cc->mBadLinks; + $this->mOldGoodLinks = $this->mGoodLinks = $cc->mGoodLinks; + $this->mOldBadLinks = $this->mBadLinks = $cc->mBadLinks; $this->mPreFilled = true; wfProfileOut( $fname ); + wfDebug( "LinkCache::preFill - got from linkscc\n" ); return; } } @@ -194,6 +195,7 @@ class LinkCache { $serCachegz = wfStrencode( gzcompress( serialize( $this ), 3) ); wfQuery("REPLACE INTO linkscc VALUES({$id}, '{$dbkeyfrom}', '{$serCachegz}')", DB_WRITE); + wfDebug( "LinkCache::preFill - saved to linkscc\n" ); } wfProfileOut( $fname ); @@ -206,6 +208,8 @@ class LinkCache { function getBadAdditions() { + #wfDebug( "mOldBadLinks: " . implode( ', ', array_keys( $this->mOldBadLinks ) ) . "\n" ); + #wfDebug( "mBadLinks: " . implode( ', ', array_keys( $this->mBadLinks ) ) . "\n" ); return array_values( array_diff( array_keys( $this->mBadLinks ), array_keys( $this->mOldBadLinks ) ) ); }