X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FpopulateImageSha1.php;h=2735a1ed8d82b1ebd27f22c7bade112b09dc208f;hb=f600b4ede9a6390cc5e929d2a48ed98af2edbc60;hp=51cc72ad2aebb3c75c426a78e00e0661e1ee7d31;hpb=f132746d2882a8383cb6288325aae048b2b996e3;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/populateImageSha1.php b/maintenance/populateImageSha1.php index 51cc72ad2a..2735a1ed8d 100644 --- a/maintenance/populateImageSha1.php +++ b/maintenance/populateImageSha1.php @@ -71,8 +71,8 @@ class PopulateImageSha1 extends LoggedUpdateMaintenance { if ( $file != '' ) { $res = $dbw->select( 'image', - array( 'img_name' ), - array( 'img_name' => $file ), + [ 'img_name' ], + [ 'img_name' => $file ], __METHOD__ ); if ( !$res ) { @@ -83,20 +83,20 @@ class PopulateImageSha1 extends LoggedUpdateMaintenance { $this->output( "Populating img_sha1 field for specified files\n" ); } else { if ( $this->hasOption( 'multiversiononly' ) ) { - $conds = array(); + $conds = []; $this->output( "Populating and recalculating img_sha1 field for versioned files\n" ); } elseif ( $force ) { - $conds = array(); + $conds = []; $this->output( "Populating and recalculating img_sha1 field\n" ); } else { - $conds = array( 'img_sha1' => '' ); + $conds = [ 'img_sha1' => '' ]; $this->output( "Populating img_sha1 field\n" ); } if ( $this->hasOption( 'multiversiononly' ) ) { $res = $dbw->select( 'oldimage', - array( 'img_name' => 'DISTINCT(oi_name)' ), $conds, __METHOD__ ); + [ 'img_name' => 'DISTINCT(oi_name)' ], $conds, __METHOD__ ); } else { - $res = $dbw->select( 'image', array( 'img_name' ), $conds, __METHOD__ ); + $res = $dbw->select( 'image', [ 'img_name' ], $conds, __METHOD__ ); } } @@ -119,7 +119,7 @@ class PopulateImageSha1 extends LoggedUpdateMaintenance { $numRows = $res->numRows(); $i = 0; foreach ( $res as $row ) { - if ( $i % $this->mBatchSize == 0 ) { + if ( $i % $this->getBatchSize() == 0 ) { $this->output( sprintf( "Done %d of %d, %5.3f%% \r", $i, $numRows, $i / $numRows * 100 ) ); wfWaitForSlaves();