AutoLoad OutputPage, HistoryBlob, Block, MessageCache, move $wgBlobCache to HistoryBl...
authorDomas Mituzas <midom@users.mediawiki.org>
Thu, 8 Jun 2006 14:11:16 +0000 (14:11 +0000)
committerDomas Mituzas <midom@users.mediawiki.org>
Thu, 8 Jun 2006 14:11:16 +0000 (14:11 +0000)
includes/HistoryBlob.php
includes/Setup.php

index 8f5d362..f7c9aea 100644 (file)
@@ -174,15 +174,14 @@ class ConcatenatedGzipHistoryBlob extends HistoryBlob
  * the same blob. By keeping the last-used one open, we avoid
  * redundant unserialization and decompression overhead.
  */
-global $wgBlobCache;
-$wgBlobCache = array();
-
 
 /**
  * @package MediaWiki
  */
 class HistoryBlobStub {
        var $mOldId, $mHash, $mRef;
+       
+       static private blobCache = array();
 
        /** @todo document */
        function HistoryBlobStub( $hash = '', $oldid = 0 ) {
@@ -214,9 +213,8 @@ class HistoryBlobStub {
        /** @todo document */
        function getText() {
                $fname = 'HistoryBlob::getText';
-               global $wgBlobCache;
-               if( isset( $wgBlobCache[$this->mOldId] ) ) {
-                       $obj = $wgBlobCache[$this->mOldId];
+               if( isset( HistoryBlobStub::$blobCache[$this->mOldId] ) ) {
+                       $obj = HistoryBlobStub::$blobCache[$this->mOldId];
                } else {
                        $dbr =& wfGetDB( DB_SLAVE );
                        $row = $dbr->selectRow( 'text', array( 'old_flags', 'old_text' ), array( 'old_id' => $this->mOldId ) );
@@ -255,7 +253,7 @@ class HistoryBlobStub {
                        // Save this item for reference; if pulling many
                        // items in a row we'll likely use it again.
                        $obj->uncompress();
-                       $wgBlobCache = array( $this->mOldId => $obj );
+                       HistoryBlobStub::$blobCache = array( $this->mOldId => $obj );
                }
                return $obj->getItem( $this->mHash );
        }
index 14dad72..2ead1b2 100644 (file)
@@ -56,13 +56,9 @@ require_once( 'GlobalFunctions.php' );
 require_once( 'Hooks.php' );
 require_once( 'Namespace.php' );
 require_once( 'User.php' );
-require_once( 'OutputPage.php' );
 require_once( 'MagicWord.php' );
-require_once( 'Block.php' );
-require_once( 'MessageCache.php' );
 require_once( 'Parser.php' );
 require_once( 'LoadBalancer.php' );
-require_once( 'HistoryBlob.php' );
 require_once( 'ProxyTools.php' );
 require_once( 'ObjectCache.php' );
 require_once( 'SpecialPage.php' );