Hey everyone,
There was a brief discussion on this list on the subject of Composer use in MediaWiki last October [1]. I also answered various questions regarding Composer in a tech chat via Google Hangout in November. I never responded to the mailing list thread and thought I'd bring up a few points regarding the statements made then.
Composer is for the most part a library handling package metadata, package repository metadata, version matching, dependency resolution, downloading and unpacking packages as well as the processes that put all of these parts together in an extensible way.
Composer originated from the ideas of a new plugin system for phpBB as well as an installer for Symfony2 bundles, which we realized was really a generic problem, so Composer has no direct ties to either of these. However it was designed with these use cases in mind. More specifically that means that while Composer comes with a nice default command line interface, it is also very well suited for creating project-specific package management tools on top of it, including web based ones if that is of any interest.
There are multiple mechanisms in Composer which allow customization while keeping the standard command line interface. Most notably custom installers [2] which allow packages of a particular type to be installed using custom installation code which allows one to modify pretty much everything, and scripts [3] which provide ways of triggering either PHP code or external programs based on various installation/update/removal events.
If this alone is not enough for MediaWiki, you can simply use Composer as a library saving you a lot of work when building a custom extension management tool.
I'm happy to answer further questions, and you'll reach plenty of people with composer experience on #composer and #composer-dev on FreeNode, too.
Cheers, Nils
[1] http://lists.wikimedia.org/pipermail/wikitech-l/2012-October/thread.html#640... [2] http://getcomposer.org/doc/articles/custom-installers.md [3] http://getcomposer.org/doc/articles/scripts.md
Le 05/02/13 12:29, Nils Adermann wrote: <snip>
Composer is for the most part a library handling package metadata, package repository metadata, version matching, dependency resolution, downloading and unpacking packages as well as the processes that put all of these parts together in an extensible way.
<snip>
If this alone is not enough for MediaWiki, you can simply use Composer as a library saving you a lot of work when building a custom extension management tool.
Hello Nils,
I am in charge of continuous integration for the Wikimedia Foundation and I am convinced Composer would nicely solve some dependencies issues we have. MediaWiki can be extended via extensions which in turn can depends on another extension. Our Jenkins install does run Unit tests for extensions when available and Jenkins does need a way to properly fetch any extensions dependencies. So I have an interest in it :-)
I have played a bit with it back in September and wrote my musing at: https://www.mediawiki.org/wiki/Composer
Thanks to Jeroen De Dauw (maintainer of a gazillion of extensions) we have made a bit more progress yesterday when he proposed a composer.json for MediaWiki core. The change in our code review system is:
https://gerrit.wikimedia.org/r/#/c/47449/
We also have added composer.json to some extensions (Translate, TranslationNotifications, and EducationProgram)
The plan so far is to setup a Satis install on the continuous integration box to let our Jenkins job fetch extensions locally via Composer. It is not a huge priority though :-)
Note that composer/install has a very basic support for MediaWiki extensions:
https://github.com/composer/installers/pull/37
Would basically install a mediawiki/foo-bar package under /extensions/FooBar.
I'm happy to answer further questions, and you'll reach plenty of people with composer experience on #composer and #composer-dev on FreeNode, too.
My nick is "hashar" there. Will add #composer-dev to my autojoin list :)
Le 05/02/13 13:40, Antoine Musso wrote:
The plan so far is to setup a Satis install on the continuous integration box to let our Jenkins job fetch extensions locally via Composer. It is not a huge priority though :-)
I realized the term "Satis" could use a bit of an explanation. It is a PHP software part of the composer tools which let us create a static repository of packages which can then in turn be used by Composer to install the packages.
I got an installation on labs: http://integration-composer.instance-proxy.wmflabs.org/
Though nothing is committed anywhere yet :-D
On 02/05/2013 01:45 PM, Antoine Musso wrote:
Le 05/02/13 13:40, Antoine Musso wrote:
The plan so far is to setup a Satis install on the continuous integration box to let our Jenkins job fetch extensions locally via Composer. It is not a huge priority though :-)
I realized the term "Satis" could use a bit of an explanation. It is a PHP software part of the composer tools which let us create a static repository of packages which can then in turn be used by Composer to install the packages.
I got an installation on labs: http://integration-composer.instance-proxy.wmflabs.org/
Though nothing is committed anywhere yet :-D
It's great to see this is making some progress. Looking forward to seeing MediaWiki extensions on Packagist! And maybe some other MediaWiki libraries in the future :)
Nils
Le 05/02/13 12:29, Nils Adermann a écrit :
There was a brief discussion on this list on the subject of Composer use in MediaWiki last October [1].
Long story short, we have MediaWiki core published at packagist.org now:
https://packagist.org/packages/mediawiki/core
Thank you note goes to: - Nils for the composer.json review - Jeroen De Dauw for filling in the packages at packagist.org - Chad Horohoe for the Github hook setup that will make the package self update.
On 02/05/2013 09:06 AM, Antoine Musso wrote:
Long story short, we have MediaWiki core published at packagist.org now:
This is awesome!
How do we get extensions into packagist?
You all may be interested to know that https://github.com/composer/installers actually has a MediaWiki extension composer installer. I'm working on a more robust version, but for now it looks like it works.
*--* *Tyler Romeo* Stevens Institute of Technology, Class of 2015 Major in Computer Science www.whizkidztech.com | tylerromeo@gmail.com
On Tue, Feb 5, 2013 at 10:02 AM, Mark A. Hershberger mah@everybody.orgwrote:
On 02/05/2013 09:06 AM, Antoine Musso wrote:
Long story short, we have MediaWiki core published at packagist.org now:
This is awesome!
How do we get extensions into packagist?
There is no path to peace. Peace is the path. -- Mahatma Gandhi, "Non-Violence in Peace and War"
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Le 05/02/13 17:00, Tyler Romeo wrote:
You all may be interested to know that https://github.com/composer/installers actually has a MediaWiki extension composer installer. I'm working on a more robust version, but for now it looks like it works.
Please please do! :-]
I wrote that very basic installer with:
https://github.com/composer/installers/pull/37
It basically installs a mediawiki/foo-bar package under /extensions/FooBar but does not do anything else. One still has to include and configure the extension under LocalSettings.php
Mhm, right now I have include files, mandatory configuration variables (it prompts the user if in interactive mode), and schema updates (update.php). Is there anything else anybody can think of that an extension installer could do conveniently?
*--* *Tyler Romeo* Stevens Institute of Technology, Class of 2015 Major in Computer Science www.whizkidztech.com | tylerromeo@gmail.com
On Tue, Feb 5, 2013 at 4:53 PM, Antoine Musso hashar+wmf@free.fr wrote:
Le 05/02/13 17:00, Tyler Romeo wrote:
You all may be interested to know that https://github.com/composer/installers actually has a MediaWiki
extension
composer installer. I'm working on a more robust version, but for now it looks like it works.
Please please do! :-]
I wrote that very basic installer with:
https://github.com/composer/installers/pull/37
It basically installs a mediawiki/foo-bar package under /extensions/FooBar but does not do anything else. One still has to include and configure the extension under LocalSettings.php
-- Antoine "hashar" Musso
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Le 05/02/13 16:02, Mark A. Hershberger a écrit :
On 02/05/2013 09:06 AM, Antoine Musso wrote:
Long story short, we have MediaWiki core published at packagist.org now:
This is awesome!
How do we get extensions into packagist?
There is no real documentation yet but one could reuse an existing composer.json from another extension. For example EducationProgram [1]
Note that, by convention, packagist require a namespace and project names to be all in lowercase and separated by dashes. Hence 'FooBar' extension should be named 'mediawiki/foo-bar'. The MediaWiki installer included in composer would take care of translating that back to CamelCase and install the extension under /extensions/
Once composer.json has been reviewed / merged, submit the git URL at https://packagist.org/packages/submit (login using your github account).
Done.
[1] https://github.com/wikimedia/mediawiki-extensions-EducationProgram/blob/mast...
wikitech-l@lists.wikimedia.org