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 foreach ( $res as $row ) {
17 $start = $row->img_name
;
18 $file = $localRepo->newFileFromRow( $row );
19 $path = $file->getPath();
21 echo "{$row->img_name}: not locally accessible\n";
24 $stat = @stat
( $file->getPath() );
26 echo "{$row->img_name}: missing\n";
30 if ( $stat['size'] == 0 && $row->img_size
!= 0 ) {
31 echo "{$row->img_name}: truncated, was {$row->img_size}\n";
35 if ( $stat['size'] != $row->img_size
) {
36 echo "{$row->img_name}: size mismatch DB={$row->img_size}, actual={$stat['size']}\n";
43 } while ( $res->numRows() );
45 echo "Good images: $numGood/$numImages\n";