X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FrebuildImages.php;h=8fceedb28cbff3cc4359641d22ab65f42efa1a8c;hb=3d95da4952619f9f773298c4461ccfc646fb18a9;hp=109350cd74687dc372bee0d48ea8152ee7f71bc4;hpb=a4943f548be4cfc8f286f00fc8064ff0e377f2ba;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/rebuildImages.php b/maintenance/rebuildImages.php index 109350cd74..8fceedb28c 100644 --- a/maintenance/rebuildImages.php +++ b/maintenance/rebuildImages.php @@ -125,12 +125,14 @@ class ImageBuilder extends Maintenance { flush(); } - function buildTable( $table, $key, $callback ) { + function buildTable( $table, $key, $queryInfo, $callback ) { $count = $this->dbw->selectField( $table, 'count(*)', '', __METHOD__ ); $this->init( $count, $table ); $this->output( "Processing $table...\n" ); - $result = $this->getDB( DB_REPLICA )->select( $table, '*', [], __METHOD__ ); + $result = $this->getDB( DB_REPLICA )->select( + $queryInfo['tables'], $queryInfo['fields'], [], __METHOD__, [], $queryInfo['joins'] + ); foreach ( $result as $row ) { $update = call_user_func( $callback, $row, null ); @@ -145,7 +147,7 @@ class ImageBuilder extends Maintenance { function buildImage() { $callback = [ $this, 'imageCallback' ]; - $this->buildTable( 'image', 'img_name', $callback ); + $this->buildTable( 'image', 'img_name', LocalFile::getQueryInfo(), $callback ); } function imageCallback( $row, $copy ) { @@ -157,7 +159,8 @@ class ImageBuilder extends Maintenance { } function buildOldImage() { - $this->buildTable( 'oldimage', 'oi_archive_name', [ $this, 'oldimageCallback' ] ); + $this->buildTable( 'oldimage', 'oi_archive_name', OldLocalFile::getQueryInfo(), + [ $this, 'oldimageCallback' ] ); } function oldimageCallback( $row, $copy ) {