From 7b8c86bdb25ae5e5981ecdaa046c1c03d54c9945 Mon Sep 17 00:00:00 2001 From: Domas Mituzas Date: Thu, 8 Jun 2006 14:11:16 +0000 Subject: [PATCH] AutoLoad OutputPage, HistoryBlob, Block, MessageCache, move $wgBlobCache to HistoryBlobStub static private. --- includes/HistoryBlob.php | 12 +++++------- includes/Setup.php | 4 ---- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/includes/HistoryBlob.php b/includes/HistoryBlob.php index 8f5d362485..f7c9aea0f2 100644 --- a/includes/HistoryBlob.php +++ b/includes/HistoryBlob.php @@ -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 ); } diff --git a/includes/Setup.php b/includes/Setup.php index 14dad72034..2ead1b26b2 100644 --- a/includes/Setup.php +++ b/includes/Setup.php @@ -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' ); -- 2.20.1