X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FrefreshFileHeaders.php;h=bd625ba129203f6041dcc3b6d41843d0fdf99ed0;hb=2f15b22b91c0426b06e9ece9ffd2aa14fbdaa621;hp=16702350f6d069a4b6e828213807f086a9a15c9c;hpb=fa4a909def47f176f9c3f732a32e8cad3a8a50d5;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/refreshFileHeaders.php b/maintenance/refreshFileHeaders.php index 16702350f6..bd625ba129 100644 --- a/maintenance/refreshFileHeaders.php +++ b/maintenance/refreshFileHeaders.php @@ -57,6 +57,8 @@ class RefreshFileHeaders extends Maintenance { $count = 0; $dbr = $this->getDB( DB_REPLICA ); + $fileQuery = LocalFile::getQueryInfo(); + do { $conds = [ "img_name > {$dbr->addQuotes( $start )}" ]; @@ -76,8 +78,16 @@ class RefreshFileHeaders extends Maintenance { $conds[] = "img_minor_mime = {$dbr->addQuotes( $minor_mime )}"; } - $res = $dbr->select( 'image', LocalFile::selectFields(), $conds, - __METHOD__, [ 'LIMIT' => $this->mBatchSize, 'ORDER BY' => 'img_name ASC' ] ); + $res = $dbr->select( $fileQuery['tables'], + $fileQuery['fields'], + $conds, + __METHOD__, + [ + 'LIMIT' => $this->getBatchSize(), + 'ORDER BY' => 'img_name ASC' + ], + $fileQuery['joins'] + ); if ( $res->numRows() > 0 ) { $row1 = $res->current(); @@ -119,7 +129,7 @@ class RefreshFileHeaders extends Maintenance { $this->output( "Updating headers for {$backendOperationsCount} file(s).\n" ); $this->updateFileHeaders( $repo, $backendOperations ); - } while ( $res->numRows() === $this->mBatchSize ); + } while ( $res->numRows() === $this->getBatchSize() ); $this->output( "Done. Updated headers for $count file(s).\n" ); }