Update wfGetDB calls in Maintenance scripts to use getDB()
[lhc/web/wiklou.git] / maintenance / archives / upgradeLogging.php
index 0749bbf..d5b98b5 100644 (file)
@@ -39,7 +39,7 @@ class UpdateLogging {
        public $minTs = false;
 
        function execute() {
-               $this->dbw = wfGetDB( DB_MASTER );
+               $this->dbw = $this->getDB( DB_MASTER );
                $logging = $this->dbw->tableName( 'logging' );
                $logging_1_10 = $this->dbw->tableName( 'logging_1_10' );
                $logging_pre_1_10 = $this->dbw->tableName( 'logging_pre_1_10' );
@@ -52,6 +52,7 @@ class UpdateLogging {
 
                if ( $this->dbw->tableExists( 'logging_pre_1_10' ) ) {
                        echo "This script has already been run to completion\n";
+
                        return;
                }
 
@@ -124,6 +125,8 @@ EOT;
 
        /**
         * Copy all rows from $srcTable to $dstTable
+        * @param string $srcTable
+        * @param string $dstTable
         */
        function sync( $srcTable, $dstTable ) {
                $batchSize = 1000;
@@ -158,7 +161,7 @@ EOT;
                        $srcRes = $this->dbw->select( $srcTable, '*', $conds, __METHOD__,
                                array( 'LIMIT' => $batchSize, 'ORDER BY' => 'log_timestamp' ) );
 
-                       if ( ! $srcRes->numRows() ) {
+                       if ( !$srcRes->numRows() ) {
                                # All done
                                break;
                        }
@@ -205,6 +208,7 @@ EOT;
                                }
                        }
                }
+
                return $numRowsCopied;
        }
 }