Follows-up I1343872de7, Ia533aedf63 and I2df2f80b81. Also updated usage in text in documentation and the installer LocalSettingsGenerator. Most of them were handled by this regex: - find: (require|include|require_once|include_once)\s*\(\s*(.+?)\s*\)\s*;$ - replace: $1 $2; Change-Id: I6b38aad9a5149c9c43ce18bd8edbab14b8ce43fa
46 lines
1,018 B
PHP
46 lines
1,018 B
PHP
<?php
|
|
/**
|
|
* Bootstrapping for test image file generation
|
|
*
|
|
* @file
|
|
*/
|
|
|
|
// Start up MediaWiki in command-line mode
|
|
require_once __DIR__ . "/../../../../maintenance/Maintenance.php";
|
|
require __DIR__ . "/RandomImageGenerator.php";
|
|
|
|
class GenerateRandomImages extends Maintenance {
|
|
|
|
public function getDbType() {
|
|
return Maintenance::DB_NONE;
|
|
}
|
|
|
|
public function execute() {
|
|
|
|
$getOptSpec = array(
|
|
'dictionaryFile::',
|
|
'minWidth::',
|
|
'maxWidth::',
|
|
'minHeight::',
|
|
'maxHeight::',
|
|
'shapesToDraw::',
|
|
'shape::',
|
|
|
|
'number::',
|
|
'format::'
|
|
);
|
|
$options = getopt( null, $getOptSpec );
|
|
|
|
$format = isset( $options['format'] ) ? $options['format'] : 'jpg';
|
|
unset( $options['format'] );
|
|
|
|
$number = isset( $options['number'] ) ? intval( $options['number'] ) : 10;
|
|
unset( $options['number'] );
|
|
|
|
$randomImageGenerator = new RandomImageGenerator( $options );
|
|
$randomImageGenerator->writeImages( $number, $format );
|
|
}
|
|
}
|
|
|
|
$maintClass = 'GenerateRandomImages';
|
|
require RUN_MAINTENANCE_IF_MAIN;
|