Requests for comment/Extension management with Composer/Farms and Composer

This page is a summary of the various issues and solutions about managing MediaWiki extensions with Composer in a farm.

Definitions

 * Extension activation:
 * Preliminary, Composer’s initial goal is to manage libraries, which one can be defined as passive code (e.g. classes or functions: no main function = if you don’t explicitely call it, it would not execute itself and have absolutely no effect – other than reserve of symbol names). This corresponds to class autoloading (Composer PSR4/PSR0/classmap/files when the files only contains classes or functions definitions, MediaWiki class autoloader)
 * MediaWiki extensions are generally active code (they register hooks, providing features, and possibly change the database). The extension’s code becomes active when registered in MediaWiki, this can be through:
 * Legacy activation:

Constraints

 * Dependencies: Composer-managed MediaWiki extensions have dependencies in their composer.json, these MUST be handled.
 * Single code: in a farm, you typically want to have only one (or a few) MediaWiki codebase (say, 1.27 LTS), and activate only some extensions depending on the wiki (by the way, it’s what Wikimedia does, the biggest MediaWiki farm)
 * Extension activation: Composer is