Extension:MediaUploader/Configuration
There are two ways to configure MediaUploader's behavior:
- Via the global config (set in LocalSettings.php) – which influences the entire wiki.
- Via campaign configs, which modify the uploader only for some uploads (for example, when you want to organize a contest which requires the uploaders to add some extra info or limits their licensing choices). You can learn more about campaigns here.
Some configuration settings can only be changed in the global config.
Each configuration setting in this documentation has a set of helpful symbols on the right. Here is what they mean:
- G – this setting can be used in the global config.
- C – this setting can be used in campaign configs.
- P – this setting's value is fully parsed before being displayed. It means that you can use whatever wAcKy wikitext you want in it, including templates.
Config settings
editSee the subpages:
Help! It's too complicated!
editDon't worry, you can always just copy one of our prepared, ready-to-use configuration sets. They cover a few popular cases for wikis of different shapes and sizes.
Default settings and overriding them
editMediaUploader comes with a set of default settings – you can find them here, in the source code, along with extra explanations.
You can override any part of the config both globally and in campaigns. In both cases, the configs are merged using the following algorithm:
- Maps (associative arrays) are merged. If config B has the same key as config A, the value is recursively merged using these rules. If not, config A's value is used.
- This means that to "unset" a value in a map you actually need to set to something – a null value, for example.
- All other types of values (scalars, integer-indexed arrays) are simply replaced. If config B has the same key as config A, B's value is used. If not, config A's value is used.
- The configs are merged in the following order: default MediaUploader config, global config set by the user, campaign config. That means that the campaign config is the most "important" one (it's applied last).
Technical notes
editIf you know what is a "hypergranular quantum cache eviction mesmerizer", read on. Just kidding. This stuff may be useful to sysadmins and wiki powerusers.
- MediaUploader parses parts of its config, so it relies on caching to maintain snappy performance. It automatically purges caches after an edit to a campaign page or any template that it relies upon. However, it cannot detect changes in the global config (LocalSettings.php). If you make changes to the global config, go to the
Campaign:-
page and perform a null edit (just open the editor and save). It will help. - What is the
Campaign:-
page? I'm glad you ask. It's a "magic" page that serves as an "anchor" for the global config. When templates are used somewhere, MediaWiki must know what transcludes them, so that it can update those dependent pages appropriately. This page is exactly that – you will see it appear in "what transcludes this page" reports, if you use a template in the global config somewhere.- This page cannot be deleted or moved. If it's missing for whatever mysterious reason, it will just resurrect itself. It's got superpowers, don't mess with it.
- You can do an identical null edit trick with campaign configs, if their cache is stuck for some reason.
- Parsing configs and cache-splitting is not an exact science. MediaUploader splits the cache by campaign (obviously), target language, and user's gender setting. This should be enough for localizing messages and not being mean to people by using an improper pronoun. Other things will break, so for example, don't use custom parser functions that rely on the knowledge of the user's name (Extension:UserFunctions).
- In campaigns the parser is told that it's parsing the corresponding campaign page (so,
{{FULLPAGENAME}}
will yield something like Campaign:WikiLovesPHP). Outside campaigns, it's told that it's parsing Special:MediaUploader.