3 * Bootstrapping for test image file generation
8 // Start up MediaWiki in command-line mode
9 require_once __DIR__
. "/../../../../maintenance/Maintenance.php";
10 require __DIR__
. "/RandomImageGenerator.php";
12 class GenerateRandomImages
extends Maintenance
{
14 public function getDbType() {
15 return Maintenance
::DB_NONE
;
18 public function execute() {
32 $options = getopt( null, $getOptSpec );
34 $format = isset( $options['format'] ) ?
$options['format'] : 'jpg';
35 unset( $options['format'] );
37 $number = isset( $options['number'] ) ?
intval( $options['number'] ) : 10;
38 unset( $options['number'] );
40 $randomImageGenerator = new RandomImageGenerator( $options );
41 $randomImageGenerator->writeImages( $number, $format );
45 $maintClass = 'GenerateRandomImages';
46 require RUN_MAINTENANCE_IF_MAIN
;