Add sslCAFile option to DatabaseMysqli
[mediawiki.git] / tests / phpunit / includes / api / generateRandomImages.php
blobd4a5acff0727345e29370bd34e60f34e8eec5fb8
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() {
19 $getOptSpec = [
20 'dictionaryFile::',
21 'minWidth::',
22 'maxWidth::',
23 'minHeight::',
24 'maxHeight::',
25 'shapesToDraw::',
26 'shape::',
28 'number::',
29 'format::'
31 $options = getopt( null, $getOptSpec );
33 $format = isset( $options['format'] ) ? $options['format'] : 'jpg';
34 unset( $options['format'] );
36 $number = isset( $options['number'] ) ? intval( $options['number'] ) : 10;
37 unset( $options['number'] );
39 $randomImageGenerator = new RandomImageGenerator( $options );
40 $randomImageGenerator->writeImages( $number, $format );
44 $maintClass = 'GenerateRandomImages';
45 require RUN_MAINTENANCE_IF_MAIN;