<?php
/**
*
- * @package MediaWiki
*/
/**
* Pure virtual parent
- * @package MediaWiki
*/
class HistoryBlob
{
/**
* The real object
- * @package MediaWiki
*/
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 ) {
/** @todo document */
function getText() {
- $fname = 'HistoryBlob::getText';
- if( isset( HistoryBlobStub::$blobCache[$this->mOldId] ) ) {
- $obj = HistoryBlobStub::$blobCache[$this->mOldId];
+ $fname = 'HistoryBlobStub::getText';
+ global $wgBlobCache;
+ if( isset( $wgBlobCache[$this->mOldId] ) ) {
+ $obj = $wgBlobCache[$this->mOldId];
} else {
- $dbr =& wfGetDB( DB_SLAVE );
+ $dbr = wfGetDB( DB_SLAVE );
$row = $dbr->selectRow( 'text', array( 'old_flags', 'old_text' ), array( 'old_id' => $this->mOldId ) );
if( !$row ) {
return false;
$flags = explode( ',', $row->old_flags );
if( in_array( 'external', $flags ) ) {
$url=$row->old_text;
- @list($proto,$path)=explode('://',$url,2);
+ @list( /* $proto */ ,$path)=explode('://',$url,2);
if ($path=="") {
wfProfileOut( $fname );
return false;
}
- require_once('ExternalStore.php');
$row->old_text=ExternalStore::fetchFromUrl($url);
}
// Save this item for reference; if pulling many
// items in a row we'll likely use it again.
$obj->uncompress();
- HistoryBlobStub::$blobCache = array( $this->mOldId => $obj );
+ $wgBlobCache = array( $this->mOldId => $obj );
}
return $obj->getItem( $this->mHash );
}
* Serialized HistoryBlobCurStub objects will be inserted into the text table
* on conversion if $wgFastSchemaUpgrades is set to true.
*
- * @package MediaWiki
*/
class HistoryBlobCurStub {
var $mCurId;
/** @todo document */
function getText() {
- $dbr =& wfGetDB( DB_SLAVE );
+ $dbr = wfGetDB( DB_SLAVE );
$row = $dbr->selectRow( 'cur', array( 'cur_text' ), array( 'cur_id' => $this->mCurId ) );
if( !$row ) {
return false;