Remove the showjumplinks user preference
[lhc/web/wiklou.git] / maintenance / storage / compressOld.php
index b0cbf28..8cb5548 100644 (file)
@@ -41,7 +41,7 @@
  * @ingroup Maintenance ExternalStorage
  */
 
-require_once( __DIR__ . '/../Maintenance.php' );
+require_once __DIR__ . '/../Maintenance.php';
 
 /**
  * Maintenance script that compress the text of a wiki.
@@ -115,7 +115,7 @@ class CompressOld extends Maintenance {
                do {
                        $res = $dbw->select( 'text', array( 'old_id', 'old_flags', 'old_text' ),
                                "old_id>=$start", __METHOD__, array( 'ORDER BY' => 'old_id', 'LIMIT' => $chunksize, 'FOR UPDATE' ) );
-                       if( $res->numRows() == 0 ) {
+                       if ( $res->numRows() == 0 ) {
                                break;
                        }
                        $last = $start;
@@ -126,7 +126,7 @@ class CompressOld extends Maintenance {
                        }
                        $start = $last + 1; # Deletion may leave long empty stretches
                        $this->output( "$start...\n" );
-               } while( true );
+               } while ( true );
        }
 
        /**
@@ -223,7 +223,7 @@ class CompressOld extends Maintenance {
                        }
                        $conds[] = "rev_timestamp>'" . $beginDate . "'";
                }
-               if ( $endDate )  {
+               if ( $endDate ) {
                        if ( !preg_match( '/^\d{14}$/', $endDate ) ) {
                                $this->error( "Invalid end date \"$endDate\"\n" );
                                return false;
@@ -282,7 +282,7 @@ class CompressOld extends Maintenance {
                                $revs[] = $revRow;
                        }
 
-                       if ( count( $revs ) < 2) {
+                       if ( count( $revs ) < 2 ) {
                                # No revisions matching, no further processing
                                $this->output( "\n" );
                                continue;
@@ -351,14 +351,15 @@ class CompressOld extends Maintenance {
                                        if ( $extdb != "" ) {
                                                # Move blob objects to External Storage
                                                $stored = $storeObj->store( $extdb, serialize( $chunk ));
-                                               if ($stored === false) {
-                                                       $this->error(  "Unable to store object" );
+                                               if ( $stored === false ) {
+                                                       $this->error( "Unable to store object" );
                                                        return false;
                                                }
                                                # Store External Storage URLs instead of Stub placeholders
-                                               foreach ($stubs as $stub) {
-                                                       if ( $stub === false )
+                                               foreach ( $stubs as $stub ) {
+                                                       if ( $stub === false ) {
                                                                continue;
+                                                       }
                                                        # $stored should provide base path to a BLOB
                                                        $url = $stored . "/" . $stub->getHash();
                                                        $dbw->update( 'text',
@@ -387,7 +388,7 @@ class CompressOld extends Maintenance {
                                                        if ( $stubs[$j] !== false && $revs[$i + $j]->rev_text_id != $primaryOldid ) {
                                                                $dbw->update( 'text',
                                                                        array( /* SET */
-                                                                               'old_text' => serialize($stubs[$j]),
+                                                                               'old_text' => serialize( $stubs[$j] ),
                                                                                'old_flags' => 'object,utf-8',
                                                                        ), array( /* WHERE */
                                                                                'old_id' => $revs[$i + $j]->rev_text_id
@@ -411,4 +412,4 @@ class CompressOld extends Maintenance {
 }
 
 $maintClass = 'CompressOld';
-require_once( RUN_MAINTENANCE_IF_MAIN );
+require_once RUN_MAINTENANCE_IF_MAIN;