Requests for comment/Extension management with Composer

Rationale
Upgrading MediaWiki is fairly easy, finding matching extension versions is not. To make things worse, there are extensions that depend on other extensions. There is currently no standard way to deal with this. So we need to:


 * Indicate an extension's version and dependencies
 * Manage various dependencies among extensions
 * Manage an extension's dependency on the MediaWiki version. This also helps to a faster deployment of extension updates

Current state of implementation

 * Composer support in MediaWiki core
 * Semantic MediaWiki can be installed via Composer

Proposal
This RfC aims at formalizing Composer support and discussing the neccessary steps to get there.

Standardize Composer support
With Semantic Mediawiki as a proof of concept, we need to identify and propagate widely used scenarios of extension installation.

≥=== Extension configuration === Some extensions need to be configured or they need to execute an installation routine. The most prominent example is to run update.php in order to add some extra tables. There's Composer support for scripts during the installation process:. We need to establish best practices on how to handle these. ±7⃣1⃣2⃣3⃣3⃣4⃣8⃣8⃣7⃣7⃣7⃣7⃣7⃣7⃣7⃣7⃣🔟7⃣7⃣7⃣8⃣7⃣7⃣🔟0⃣9⃣➡⬆🔣#⃣⬇

Extension manager
A user interface is needed. There is already a first draft of an extension manager:. These are the main tasks that an interface should help the user with:
 * Install extensions and their dependencies
 * Check upgrade compatibility ("I want to upgrade to MW1.22, what's the status of my extensions for that?")
 * Update extensions with a click if there is a newer version

Packagist
All extensions using composer need to come from a central repository. We have to decide whether we want to maintain our own repo or use Packagist, the solution proposed by composer. We also need to establish how an extension gets from our git to the repo. One idea is to use git tags as a basis. In this case we can enforce extension versioning. If extension developers want to publish their work via the Extension Manager, they need to add tag following a certain convention.

Development stack

 * Vagrant based installations can ship with Composer installed and use this as a basis for loading additional extensions.

Drawbacks / Issues

 * No support for external tools like vipsscaler or lilypond. These need to be installed manually.
 * No global scope: all global variables need to be declared first. Jeroen proposed to use $GLOBALS['wgNAME'].
 * Composer is still in alpha.