Merge "Add CollationFa"
[lhc/web/wiklou.git] / maintenance / archives / upgradeLogging.php
index d5b98b5..0beff7c 100644 (file)
@@ -32,7 +32,7 @@ require __DIR__ . '/../commandLine.inc';
 class UpdateLogging {
 
        /**
-        * @var DatabaseBase
+        * @var Database
         */
        public $dbw;
        public $batchSize = 1000;
@@ -156,17 +156,17 @@ EOT;
                        if ( $copyPos === null ) {
                                $conds = false;
                        } else {
-                               $conds = array( 'log_timestamp > ' . $this->dbw->addQuotes( $copyPos ) );
+                               $conds = [ 'log_timestamp > ' . $this->dbw->addQuotes( $copyPos ) ];
                        }
                        $srcRes = $this->dbw->select( $srcTable, '*', $conds, __METHOD__,
-                               array( 'LIMIT' => $batchSize, 'ORDER BY' => 'log_timestamp' ) );
+                               [ 'LIMIT' => $batchSize, 'ORDER BY' => 'log_timestamp' ] );
 
                        if ( !$srcRes->numRows() ) {
                                # All done
                                break;
                        }
 
-                       $batch = array();
+                       $batch = [];
                        foreach ( $srcRes as $srcRow ) {
                                $batch[] = (array)$srcRow;
                        }
@@ -180,18 +180,18 @@ EOT;
 
        function copyExactMatch( $srcTable, $dstTable, $copyPos ) {
                $numRowsCopied = 0;
-               $srcRes = $this->dbw->select( $srcTable, '*', array( 'log_timestamp' => $copyPos ), __METHOD__ );
-               $dstRes = $this->dbw->select( $dstTable, '*', array( 'log_timestamp' => $copyPos ), __METHOD__ );
+               $srcRes = $this->dbw->select( $srcTable, '*', [ 'log_timestamp' => $copyPos ], __METHOD__ );
+               $dstRes = $this->dbw->select( $dstTable, '*', [ 'log_timestamp' => $copyPos ], __METHOD__ );
 
                if ( $srcRes->numRows() ) {
                        $srcRow = $srcRes->fetchObject();
                        $srcFields = array_keys( (array)$srcRow );
                        $srcRes->seek( 0 );
-                       $dstRowsSeen = array();
+                       $dstRowsSeen = [];
 
                        # Make a hashtable of rows that already exist in the destination
                        foreach ( $dstRes as $dstRow ) {
-                               $reducedDstRow = array();
+                               $reducedDstRow = [];
                                foreach ( $srcFields as $field ) {
                                        $reducedDstRow[$field] = $dstRow->$field;
                                }