r14663 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r14662‎ | r14663 | r14664 >
Date:14:11, 8 June 2006
Author:midom
Status:old
Tags:
Comment:
AutoLoad OutputPage, HistoryBlob, Block, MessageCache, move $wgBlobCache to HistoryBlobStub static private.
Modified paths:
  • /trunk/phase3/includes/HistoryBlob.php (modified) (history)
  • /trunk/phase3/includes/Setup.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Setup.php
@@ -56,13 +56,9 @@
5757 require_once( 'Hooks.php' );
5858 require_once( 'Namespace.php' );
5959 require_once( 'User.php' );
60 -require_once( 'OutputPage.php' );
6160 require_once( 'MagicWord.php' );
62 -require_once( 'Block.php' );
63 -require_once( 'MessageCache.php' );
6461 require_once( 'Parser.php' );
6562 require_once( 'LoadBalancer.php' );
66 -require_once( 'HistoryBlob.php' );
6763 require_once( 'ProxyTools.php' );
6864 require_once( 'ObjectCache.php' );
6965 require_once( 'SpecialPage.php' );
Index: trunk/phase3/includes/HistoryBlob.php
@@ -174,15 +174,14 @@
175175 * the same blob. By keeping the last-used one open, we avoid
176176 * redundant unserialization and decompression overhead.
177177 */
178 -global $wgBlobCache;
179 -$wgBlobCache = array();
180178
181 -
182179 /**
183180 * @package MediaWiki
184181 */
185182 class HistoryBlobStub {
186183 var $mOldId, $mHash, $mRef;
 184+
 185+ static private blobCache = array();
187186
188187 /** @todo document */
189188 function HistoryBlobStub( $hash = '', $oldid = 0 ) {
@@ -214,9 +213,8 @@
215214 /** @todo document */
216215 function getText() {
217216 $fname = 'HistoryBlob::getText';
218 - global $wgBlobCache;
219 - if( isset( $wgBlobCache[$this->mOldId] ) ) {
220 - $obj = $wgBlobCache[$this->mOldId];
 217+ if( isset( HistoryBlobStub::$blobCache[$this->mOldId] ) ) {
 218+ $obj = HistoryBlobStub::$blobCache[$this->mOldId];
221219 } else {
222220 $dbr =& wfGetDB( DB_SLAVE );
223221 $row = $dbr->selectRow( 'text', array( 'old_flags', 'old_text' ), array( 'old_id' => $this->mOldId ) );
@@ -255,7 +253,7 @@
256254 // Save this item for reference; if pulling many
257255 // items in a row we'll likely use it again.
258256 $obj->uncompress();
259 - $wgBlobCache = array( $this->mOldId => $obj );
 257+ HistoryBlobStub::$blobCache = array( $this->mOldId => $obj );
260258 }
261259 return $obj->getItem( $this->mHash );
262260 }

Status & tagging log