Fixed spacing in files direct in includes folder
[lhc/web/wiklou.git] / includes / HistoryBlob.php
index 55c2ae5..8d83751 100644 (file)
@@ -183,7 +183,6 @@ class ConcatenatedGzipHistoryBlob implements HistoryBlob
        }
 }
 
-
 /**
  * Pointer object for an item within a CGZ blob stored in the text table.
  */
@@ -199,7 +198,7 @@ class HistoryBlobStub {
        var $mOldId, $mHash, $mRef;
 
        /**
-        * @param $hash string the content hash of the text
+        * @param string $hash the content hash of the text
         * @param $oldid Integer the old_id for the CGZ object
         */
        function __construct( $hash = '', $oldid = 0 ) {
@@ -232,29 +231,29 @@ class HistoryBlobStub {
         * @return string
         */
        function getText() {
-               if( isset( self::$blobCache[$this->mOldId] ) ) {
+               if ( isset( self::$blobCache[$this->mOldId] ) ) {
                        $obj = self::$blobCache[$this->mOldId];
                } else {
                        $dbr = wfGetDB( DB_SLAVE );
                        $row = $dbr->selectRow( 'text', array( 'old_flags', 'old_text' ), array( 'old_id' => $this->mOldId ) );
-                       if( !$row ) {
+                       if ( !$row ) {
                                return false;
                        }
                        $flags = explode( ',', $row->old_flags );
-                       if( in_array( 'external', $flags ) ) {
+                       if ( in_array( 'external', $flags ) ) {
                                $url = $row->old_text;
                                $parts = explode( '://', $url, 2 );
                                if ( !isset( $parts[1] ) || $parts[1] == '' ) {
                                        return false;
                                }
-                               $row->old_text = ExternalStore::fetchFromUrl($url);
+                               $row->old_text = ExternalStore::fetchFromUrl( $url );
 
                        }
-                       if( !in_array( 'object', $flags ) ) {
+                       if ( !in_array( 'object', $flags ) ) {
                                return false;
                        }
 
-                       if( in_array( 'gzip', $flags ) ) {
+                       if ( in_array( 'gzip', $flags ) ) {
                                // This shouldn't happen, but a bug in the compress script
                                // may at times gzip-compress a HistoryBlob object row.
                                $obj = unserialize( gzinflate( $row->old_text ) );
@@ -262,7 +261,7 @@ class HistoryBlobStub {
                                $obj = unserialize( $row->old_text );
                        }
 
-                       if( !is_object( $obj ) ) {
+                       if ( !is_object( $obj ) ) {
                                // Correct for old double-serialization bug.
                                $obj = unserialize( $obj );
                        }
@@ -285,7 +284,6 @@ class HistoryBlobStub {
        }
 }
 
-
 /**
  * To speed up conversion from 1.4 to 1.5 schema, text rows can refer to the
  * leftover cur table as the backend. This avoids expensively copying hundreds
@@ -320,7 +318,7 @@ class HistoryBlobCurStub {
        function getText() {
                $dbr = wfGetDB( DB_SLAVE );
                $row = $dbr->selectRow( 'cur', array( 'cur_text' ), array( 'cur_id' => $this->mCurId ) );
-               if( !$row ) {
+               if ( !$row ) {
                        return false;
                }
                return $row->cur_text;
@@ -395,7 +393,7 @@ class DiffHistoryBlob implements HistoryBlob {
         */
        function addItem( $text ) {
                if ( $this->mFrozen ) {
-                       throw new MWException( __METHOD__.": Cannot add more items after sleep/wakeup" );
+                       throw new MWException( __METHOD__ . ": Cannot add more items after sleep/wakeup" );
                }
 
                $this->mItems[] = $text;
@@ -430,7 +428,7 @@ class DiffHistoryBlob implements HistoryBlob {
         * @throws MWException
         */
        function compress() {
-               if ( !function_exists( 'xdiff_string_rabdiff' ) ){
+               if ( !function_exists( 'xdiff_string_rabdiff' ) ) {
                        throw new MWException( "Need xdiff 1.5+ support to write DiffHistoryBlob\n" );
                }
                if ( isset( $this->mDiffs ) ) {
@@ -535,11 +533,11 @@ class DiffHistoryBlob implements HistoryBlob {
                # Check the checksum if hash/mhash is available
                $ofp = $this->xdiffAdler32( $base );
                if ( $ofp !== false && $ofp !== substr( $diff, 0, 4 ) ) {
-                       wfDebug( __METHOD__. ": incorrect base checksum\n" );
+                       wfDebug( __METHOD__ . ": incorrect base checksum\n" );
                        return false;
                }
                if ( $header['csize'] != strlen( $base ) ) {
-                       wfDebug( __METHOD__. ": incorrect base length\n" );
+                       wfDebug( __METHOD__ . ": incorrect base length\n" );
                        return false;
                }
 
@@ -568,7 +566,7 @@ class DiffHistoryBlob implements HistoryBlob {
                                $out .= substr( $base, $x['off'], $x['csize'] );
                                break;
                        default:
-                               wfDebug( __METHOD__.": invalid op\n" );
+                               wfDebug( __METHOD__ . ": invalid op\n" );
                                return false;
                        }
                }