3 require( 'commandLine.inc' );
7 $dbr = wfGetDB( DB_SLAVE
);
8 $localRepo = RepoGroup
::singleton()->getLocalRepo();
14 $res = $dbr->select( 'image', '*', array( 'img_name > ' . $dbr->addQuotes( $start ) ),
15 'checkImages.php', array( 'LIMIT' => $batchSize ) );
16 foreach ( $res as $row ) {
18 $start = $row->img_name
;
19 $file = $localRepo->newFileFromRow( $row );
20 $path = $file->getPath();
22 echo "{$row->img_name}: not locally accessible\n";
25 $stat = @stat
( $file->getPath() );
27 echo "{$row->img_name}: missing\n";
31 if ( $stat['mode'] & 040000 ) {
32 echo "{$row->img_name}: is a directory\n";
36 if ( $stat['size'] == 0 && $row->img_size
!= 0 ) {
37 echo "{$row->img_name}: truncated, was {$row->img_size}\n";
41 if ( $stat['size'] != $row->img_size
) {
42 echo "{$row->img_name}: size mismatch DB={$row->img_size}, actual={$stat['size']}\n";
49 } while ( $res->numRows() );
51 echo "Good images: $numGood/$numImages\n";