MediaWiki  REL1_31
RandomImageGenerator.php File Reference

RandomImageGenerator – does what it says on the tin. More...

Go to the source code of this file.


class  RandomImageGenerator
 RandomImageGenerator: does what it says on the tin. More...

Detailed Description

RandomImageGenerator – does what it says on the tin.

Requires Imagick, the ImageMagick library for PHP, or the command line equivalent (usually 'convert').

Because MediaWiki tests the uniqueness of media upload content, and filenames, it is sometimes useful to generate files that are guaranteed (or at least very likely) to be unique in both those ways. This generates a number of filenames with random names and random content (colored triangles).

It is also useful to have fresh content because our tests currently run in a "destructive" mode, and don't create a fresh new wiki for each test run. Consequently, if we just had a few static files we kept re-uploading, we'd get lots of warnings about matching content or filenames, and even if we deleted those files, we'd get warnings about archived files.

This can also be used with a cronjob to generate random files all the time. I use it to have a constant, never ending supply when I'm testing interactively.

Neil Kandalgaonkar neilk.nosp@m.@wik.nosp@m.imedi.nosp@m.a.or.nosp@m.g

Definition in file RandomImageGenerator.php.