Postgres: make sure ar_len is added when updating, alpha stuff in updaters.inc
[lhc/web/wiklou.git] / includes / HistoryBlob.php
index f7c9aea..3ce4ffd 100644 (file)
@@ -1,12 +1,10 @@
 <?php
 /**
  *
- * @package MediaWiki
  */
 
 /**
  * Pure virtual parent
- * @package MediaWiki
  */
 class HistoryBlob
 {
@@ -50,7 +48,6 @@ class HistoryBlob
 
 /**
  * The real object
- * @package MediaWiki
  */
 class ConcatenatedGzipHistoryBlob extends HistoryBlob
 {
@@ -174,14 +171,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 ) {
@@ -212,11 +209,12 @@ class HistoryBlobStub {
 
        /** @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;
@@ -224,12 +222,11 @@ class HistoryBlobStub {
                        $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);
 
                        }
@@ -253,7 +250,7 @@ class HistoryBlobStub {
                        // 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 );
        }
@@ -273,7 +270,6 @@ class HistoryBlobStub {
  * Serialized HistoryBlobCurStub objects will be inserted into the text table
  * on conversion if $wgFastSchemaUpgrades is set to true.
  *
- * @package MediaWiki
  */
 class HistoryBlobCurStub {
        var $mCurId;
@@ -293,7 +289,7 @@ class HistoryBlobCurStub {
 
        /** @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;