$count = 0;
$dbr = $this->getDB( DB_REPLICA );
+ $fileQuery = LocalFile::getQueryInfo();
+
do {
$conds = [ "img_name > {$dbr->addQuotes( $start )}" ];
$conds[] = "img_minor_mime = {$dbr->addQuotes( $minor_mime )}";
}
- $res = $dbr->select( 'image', '*', $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();
$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" );
}