forward-ported the changes made in 1.40.2.1
authorTim Starling <tstarling@users.mediawiki.org>
Sun, 29 May 2005 10:17:44 +0000 (10:17 +0000)
committerTim Starling <tstarling@users.mediawiki.org>
Sun, 29 May 2005 10:17:44 +0000 (10:17 +0000)
includes/LinkCache.php

index 9d86a24..66545ea 100644 (file)
@@ -45,6 +45,7 @@ class LinkCache {
                $this->mCategoryLinks = array();
                $this->mOldGoodLinks = array();
                $this->mOldBadLinks = array();
+               $this->mOldPageLinks = array();
        }
 
        /**
@@ -226,9 +227,6 @@ class LinkCache {
                                $this->addBadLinkObj( $title );
                        }
                }
-               $this->mOldPageLinks = $this->mPageLinks;
-               $this->mOldBadLinks  = $this->mBadLinks;
-               $this->mOldGoodLinks = $this->mGoodLinks;
                $this->mPreFilled = true;
 
                if ( $wgEnablePersistentLC ) {
@@ -323,13 +321,17 @@ class LinkCache {
        }
 
        /**
-        * Clears cache but leaves old preFill copies alone
+        * Clears cache 
         */
        function clear() {
                $this->mPageLinks = array();
                $this->mGoodLinks = array();
                $this->mBadLinks = array();
                $this->mImageLinks = array();
+               $this->mCategoryLinks = array();
+               $this->mOldGoodLinks = array();
+               $this->mOldBadLinks = array();
+               $this->mOldPageLinks = array();
        }
 
        /**
@@ -420,6 +422,15 @@ class LinkCache {
                        $dbw->delete( 'linkscc', array( 'lcc_pageid' => $pid ) );
                }
        }
+
+       /**
+        * Swaps old and current link registers
+        */
+       function swapRegisters() {
+               swap( $this->mGoodLinks, $this->mOldGoodLinks );
+               swap( $this->mBadLinks, $this->mOldBadLinks );
+               swap( $this->mImageLinks, $this->mOldImageLinks );
+       }
 }
 
 /**