From 9548f60e7a404ca5ef6aa03387b269dbbdd26f46 Mon Sep 17 00:00:00 2001 From: "Ori.livneh" Date: Sun, 11 May 2014 10:00:35 +0000 Subject: [PATCH] Revert "Make it possible to install extensions using Composer" This reverts commit d6e69d774. MediaWiki extensions are by definition part of the MediaWiki software ecosystem, and could therefore be managed using a specialized solution; The same is not true of PHP packages at large: we're not in a position to change how the PHP community at large manages dependencies. To the extent that we have a choice, we should use interfaces like composer.json to solve for the problem of integration with the outside world. Change Ib125bea00 made the opposite choice, compromising our ability to express how MediaWiki relates to external software components in exchange for superficial gains in convenience of managing MediaWiki extensions. (I consider the gains superficial because they do not leverage the fact that extensions share MediaWiki's code -- a property that should be exploited to provide an extension management solution that is MediaWiki-aware, providing, for example, a uniform configuration management interface.) The cost of that change are manifest in bug 64597: we lost the ability to express a dependency on PHPUnit in the way that the PHPUnit upstream recommends. The problem that change Ib125bea00 set out to solve is that modifying composer.json to express dependencies on extensions means having a local diff that conflicts with the code in version control. This issue is actually discussed by the Composer documentation. In short, Composer's developers recommend that if your production environment uses a cvs to version code, you should maintain your own clone of the upstream repository and version your composer.json that way. More detailed discussion of these issues can be found at and . I also note that the Composer documentation makes many references to monolog as an exemplary Composer project, and it too maintains a composer.json in the repository root. Change-Id: I3e7c668ee32401e731120cfa9f96986fd8fde8f4 --- composer-example.json | 20 -------------------- composer.json | 30 ++++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 20 deletions(-) delete mode 100644 composer-example.json create mode 100644 composer.json diff --git a/composer-example.json b/composer-example.json deleted file mode 100644 index 85304c1fa5..0000000000 --- a/composer-example.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "require": { - "php": ">=5.3.2" - }, - "suggest": { - "ext-fileinfo": "More accurate file type detection for uploaded files", - "ext-mbstring": "Faster unicode handling", - "ext-wikidiff2": "Faster diff generation", - "ext-apc": "Speed up MediaWiki with opcode caching (before PHP 5.5)" - }, - "autoload": { - "psr-0": { - "ComposerHookHandler": "includes/composer" - } - }, - "scripts": { - "pre-update-cmd": "ComposerHookHandler::onPreUpdate", - "pre-install-cmd": "ComposerHookHandler::onPreInstall" - } -} diff --git a/composer.json b/composer.json new file mode 100644 index 0000000000..ded3365261 --- /dev/null +++ b/composer.json @@ -0,0 +1,30 @@ +{ + "name": "mediawiki/core", + "description": "Free software wiki application developed by the Wikimedia Foundation and others", + "keywords": ["mediawiki", "wiki"], + "homepage": "https://www.mediawiki.org/", + "authors": [ + { + "name": "MediaWiki Community", + "homepage": "https://www.mediawiki.org/wiki/Special:Version/Credits" + } + ], + "license": "GPL-2.0", + "support": { + "issues": "https://bugzilla.wikimedia.org/", + "irc": "irc://irc.freenode.net/mediawiki", + "wiki": "https://www.mediawiki.org/" + }, + "require": { + "php": ">=5.3.2" + }, + "require-dev": { + "phpunit/phpunit": "*" + }, + "suggest": { + "ext-fileinfo": "*", + "ext-mbstring": "*", + "ext-wikidiff2": "*", + "ext-apc": "*" + } +} -- 2.20.1