$repo = RepoGroup::singleton()->getLocalRepo();
$dbr = $repo->getReplicaDB();
$be = $repo->getBackend();
+ $batchSize = $this->getBatchSize();
$mtime1 = $dbr->timestampOrNull( $this->getOption( 'mtimeafter', null ) );
$mtime2 = $dbr->timestampOrNull( $this->getOption( 'mtimebefore', null ) );
$joinConds = [];
if ( $mtime1 || $mtime2 ) {
$joinTables[] = 'page';
- $joinConds['page'] = [ 'INNER JOIN',
+ $joinConds['page'] = [ 'JOIN',
[ 'page_title = img_name', 'page_namespace' => NS_FILE ] ];
$joinTables[] = 'logging';
$on = [ 'log_page = page_id', 'log_type' => [ 'upload', 'move', 'delete' ] ];
if ( $mtime2 ) {
$on[] = "log_timestamp < {$dbr->addQuotes($mtime2)}";
}
- $joinConds['logging'] = [ 'INNER JOIN', $on ];
+ $joinConds['logging'] = [ 'JOIN', $on ];
}
do {
__METHOD__,
// DISTINCT causes a pointless filesort
[ 'ORDER BY' => 'name', 'GROUP BY' => 'name',
- 'LIMIT' => $this->mBatchSize ],
+ 'LIMIT' => $batchSize ],
$joinConds
);
$checkPaths[] = $file->getPath();
}
- foreach ( array_chunk( $checkPaths, $this->mBatchSize ) as $paths ) {
+ foreach ( array_chunk( $checkPaths, $batchSize ) as $paths ) {
$be->preloadFileStat( [ 'srcs' => $paths ] );
foreach ( $paths as $path ) {
if ( $be->fileExists( [ 'src' => $path ] ) === false ) {
}
}
}
- } while ( $res->numRows() >= $this->mBatchSize );
+ } while ( $res->numRows() >= $batchSize );
}
}
-$maintClass = 'FindMissingFiles';
+$maintClass = FindMissingFiles::class;
require_once RUN_MAINTENANCE_IF_MAIN;