X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FrebuildImages.php;h=f67739bae1fd157e4083208c7e2108089f32c312;hb=27d3f08d4e41ca5745c80a57afd441f9250db7e1;hp=1b0a27df66152a267023986174be2090ea451d9e;hpb=b24a0048185fe7c4d86f8b55872ad749c6ab52e6;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/rebuildImages.php b/maintenance/rebuildImages.php index 1b0a27df66..f67739bae1 100644 --- a/maintenance/rebuildImages.php +++ b/maintenance/rebuildImages.php @@ -51,7 +51,7 @@ class ImageBuilder extends Maintenance { // make sure to update old, but compatible img_metadata fields. $wgUpdateCompatibleMetadata = true; - $this->mDescription = 'Script to update image metadata records'; + $this->addDescription( 'Script to update image metadata records' ); $this->addOption( 'missing', 'Check for files without associated database record' ); $this->addOption( 'dry-run', 'Only report, don\'t update the database' ); @@ -127,7 +127,7 @@ class ImageBuilder extends Maintenance { $this->init( $count, $table ); $this->output( "Processing $table...\n" ); - $result = $this->getDB( DB_SLAVE )->select( $table, '*', array(), __METHOD__ ); + $result = $this->getDB( DB_SLAVE )->select( $table, '*', [], __METHOD__ ); foreach ( $result as $row ) { $update = call_user_func( $callback, $row, null ); @@ -141,7 +141,7 @@ class ImageBuilder extends Maintenance { } function buildImage() { - $callback = array( $this, 'imageCallback' ); + $callback = [ $this, 'imageCallback' ]; $this->buildTable( 'image', 'img_name', $callback ); } @@ -154,7 +154,7 @@ class ImageBuilder extends Maintenance { } function buildOldImage() { - $this->buildTable( 'oldimage', 'oi_archive_name', array( $this, 'oldimageCallback' ) ); + $this->buildTable( 'oldimage', 'oi_archive_name', [ $this, 'oldimageCallback' ] ); } function oldimageCallback( $row, $copy ) { @@ -171,14 +171,14 @@ class ImageBuilder extends Maintenance { } function crawlMissing() { - $this->getRepo()->enumFiles( array( $this, 'checkMissingImage' ) ); + $this->getRepo()->enumFiles( [ $this, 'checkMissingImage' ] ); } function checkMissingImage( $fullpath ) { $filename = wfBaseName( $fullpath ); $row = $this->dbw->selectRow( 'image', - array( 'img_name' ), - array( 'img_name' => $filename ), + [ 'img_name' ], + [ 'img_name' => $filename ], __METHOD__ ); if ( !$row ) { // file not registered