Extension:MediaWikiFarm/Scripts

Here are detailled the scripts provided with MediaWikiFarm:
 * to execute a MediaWiki maintenance script in the context of a farm
 * to install Composer dependencies and give the opportunity to activate per-wiki a Composer-managed MediaWiki extension
 * to validate the main config file

mwscript
must be prepended to traditional maintenance scripts. For instance, to run, you can run one of the two equivalent commands: If the command doesn’t begin with "maintenance/" and doesn’t end with ".php", these are added.

For your convenience, you can add it as an alias in your ~/.bashrc. The exact command is given when you run. With this alias, the command becomes. An alternative way is to add a script  containing.

You will probably experience permissions issues given your webserver user is different than the CLI user: you can add  (www-data is supposed to be your webserver user, replace with your specific configuration) and add a custom rule in   to be able to execute without typing your password.

mwcomposer
is very similar to  (and this one must be installed and is called) but creates a modified   directory (with multiple Composer autoloaders, a modified file , and a added file  ) to activate per-wiki Composer-managed MediaWiki extensions. If you directly run  instead of   it will also "work", but all Composer-managed MediaWiki extensions will be activated on all wikis using this MediaWiki version (possibly some extensions have custom mechanisms to prevent themselves from being activated without specific parameters).

To run this script, you must add in your  or   your Composer-managed MediaWiki extensions (and skins), then run this script in the MediaWiki directory just like you would have run Composer.

Internally this script: Note that each Composer run is done in a temporary directory to avoid issues with the real MediaWiki directory. At runtime, the  file requests MediaWikiFarm to known what Composer-managed MediaWiki extensions are enabled and loads their autoloaders. The file  is used by MediaWikiFarm during configuration compilation (to create the   files) to know the dependency graph between Composer-managed MediaWiki extensions (given Composer computes and respects the dependencies, MediaWikiFarm should be aware of these dependencies).
 * run Composer with the original composer.json, so that if there are incompatibilities between some Composer-managed MediaWiki extensions, you are warned;
 * run Composer one time per extension (so N Composer runs) by crafting the composer.json as if only the extension was the only one activated extension;
 * run Composer without any extension;
 * install MediaWiki extensions and skins in their standard directories;
 * create a  directory with all Composer libraries, N Composer autoloader per MediaWiki extension, 1 Composer autoloader without any MediaWiki extension, a specific autoloader in place of , and one.