fix r88378: fix CSS id in modern skin
[lhc/web/wiklou.git] / maintenance / upgrade1_5.php
index 45fbd21..709d0b2 100644 (file)
@@ -101,7 +101,6 @@ class FiveUpgrade extends Maintenance {
 
                $this->cleanupSwaps = array();
                $this->emailAuth = false; # don't preauthenticate emails
-               $this->maxLag    = 10; # if slaves are lagged more than 10 secs, wait
                $this->step      = $this->getOption( 'step', null );
        }
 
@@ -316,10 +315,16 @@ class FiveUpgrade extends Maintenance {
         */
        function insertChunk( &$chunk ) {
                // Give slaves a chance to catch up
-               wfWaitForSlaves( $this->maxLag );
+               wfWaitForSlaves();
                $this->dbw->insert( $this->chunkTable, $chunk, $this->chunkFunction, $this->chunkOptions );
        }
 
+       /**
+        * Helper function for copyTable array_filter
+        */
+       static private function notUpgradeNull( $x ) {
+               return $x !== MW_UPGRADE_NULL;
+       }
 
        /**
         * Copy and transcode a table to table_temp.
@@ -349,8 +354,7 @@ class FiveUpgrade extends Maintenance {
                $this->setChunkScale( 100, $numRecords, $name_temp, __METHOD__ );
 
                // Pull all records from the second, streaming database connection.
-               $sourceFields = array_keys( array_filter( $fields,
-                       create_function( '$x', 'return $x !== MW_UPGRADE_NULL;' ) ) );
+               $sourceFields = array_keys( array_filter( $fields, 'FiveUpgrade::notUpgradeNull' ) );
                $result = $this->dbr->select( $name,
                        $sourceFields,
                        '',
@@ -1320,4 +1324,4 @@ END
 }
 
 $maintClass = 'FiveUpgrade';
-require( DO_MAINTENANCE );
+require( RUN_MAINTENANCE_IF_MAIN );