MediaWiki  1.23.1
generateRandomImages.php
Go to the documentation of this file.
1 <?php
8 // Start up MediaWiki in command-line mode
9 require_once __DIR__ . "/../../../../maintenance/Maintenance.php";
10 require __DIR__ . "/RandomImageGenerator.php";
11 
13 
14  public function getDbType() {
15  return Maintenance::DB_NONE;
16  }
17 
18  public function execute() {
19 
20  $getOptSpec = array(
21  'dictionaryFile::',
22  'minWidth::',
23  'maxWidth::',
24  'minHeight::',
25  'maxHeight::',
26  'shapesToDraw::',
27  'shape::',
28 
29  'number::',
30  'format::'
31  );
32  $options = getopt( null, $getOptSpec );
33 
34  $format = isset( $options['format'] ) ? $options['format'] : 'jpg';
35  unset( $options['format'] );
36 
37  $number = isset( $options['number'] ) ? intval( $options['number'] ) : 10;
38  unset( $options['number'] );
39 
40  $randomImageGenerator = new RandomImageGenerator( $options );
41  $randomImageGenerator->writeImages( $number, $format );
42  }
43 }
44 
45 $maintClass = 'GenerateRandomImages';
php
skin txt MediaWiki includes four core it has been set as the default in MediaWiki since the replacing Monobook it had been been the default skin since before being replaced by Vector largely rewritten in while keeping its appearance Several legacy skins were removed in the as the burden of supporting them became too heavy to bear Those in etc for skin dependent CSS etc for skin dependent JavaScript These can also be customised on a per user by etc This feature has led to a wide variety of user styles becoming that gallery is a good place to ending in php
Definition: skin.txt:62
GenerateRandomImages\getDbType
getDbType()
Does the script need different DB access? By default, we give Maintenance scripts normal rights to th...
Definition: generateRandomImages.php:14
RUN_MAINTENANCE_IF_MAIN
require_once RUN_MAINTENANCE_IF_MAIN
Definition: maintenance.txt:50
Maintenance
Abstract maintenance class for quickly writing and churning out maintenance scripts with minimal effo...
Definition: maintenance.txt:39
RandomImageGenerator
RandomImageGenerator: does what it says on the tin.
Definition: RandomImageGenerator.php:27
GenerateRandomImages
Definition: generateRandomImages.php:12
array
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
$maintClass
$maintClass
Definition: generateRandomImages.php:45
$options
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped & $options
Definition: hooks.txt:1530
Maintenance\DB_NONE
const DB_NONE
Constants for DB access type.
Definition: Maintenance.php:57
GenerateRandomImages\execute
execute()
Do the actual work.
Definition: generateRandomImages.php:18