X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FrebuildImages.php;h=6aa1f37a8c5582b8ace97661e18729cff900eadc;hb=fd84e8580fffd2a65b109364731fba678ec7c694;hp=521ab54f43b045c9c42275be7d467fcae3bd3563;hpb=4b069cd1b88877fbb253af8780e358d96ba2587c;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/rebuildImages.php b/maintenance/rebuildImages.php index 521ab54f43..6aa1f37a8c 100644 --- a/maintenance/rebuildImages.php +++ b/maintenance/rebuildImages.php @@ -40,7 +40,7 @@ require_once __DIR__ . '/Maintenance.php'; class ImageBuilder extends Maintenance { /** - * @var DatabaseBase + * @var Database */ protected $dbw; @@ -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_REPLICA )->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