Remove messages.inc, rebuildLanguage.php, writeMessagesArray.inc
[mediawiki.git] / tests / phpunit / includes / api / generateRandomImages.php
blob87f5c4c0601cc91fb0a56d410c570c85f9b33ad2
1 <?php
2 /**
3 * Bootstrapping for test image file generation
5 * @file
6 */
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() {
20 $getOptSpec = array(
21 'dictionaryFile::',
22 'minWidth::',
23 'maxWidth::',
24 'minHeight::',
25 'maxHeight::',
26 'shapesToDraw::',
27 'shape::',
29 'number::',
30 'format::'
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;