Le 28/09/12 03:47, Mark A. Hershberger a écrit : <snip>
The problem, though, is that there is no way to install, use, or update extensions apart from doing it by hand. Requiring the installation of multiple modules by hand isn't going to lead to a thriving, modular ecosystem. We need a dependency manager.
Thankfully, I think there is already a dependency manager that we can build on.
I'm talking about Composer (http://getcomposer.org/).
I am going to need such a dependency manager for continuous integration of our extensions. I am not going to maintain a list of each extension dependency nor am I going to write some piece of code to handle that. Composer is IMHO a great way to handle our dependencies.
My past experiment is on the wiki at: https://www.mediawiki.org/wiki/Composer
The change is not that much invading (it is just about adding a composer.json file at the root of the extension) and thus is definitely not going to harm anything. Even if we end up choosing a different system (PEAR??) or writing our own, that is just a simple json file.
Of course, MediaWiki isn't aware of this dependency manager and so MediaWiki's extensions aren't either. I've only looked at it briefly, but it appears that adding support wouldn't be difficult at all -- it would just mean adding a file to the git repository.
Composer has the ability to generate an autoload file for all the dependencies and craft a general autoloader that your application can use to load everything.
I have submitted to upstream a patch that add some very basic support for MediaWiki installation:
https://github.com/composer/installers/pull/37 https://github.com/composer/installers/commit/43dd8edf22b3e9468b18db04c0b10a...
Which basically make it such that mediawiki/my-extension is installed under extensions/MyExtension (aka using CamelCase). It is not in Composer yet, you will have to run the latest head to take advantage of it.
I am assuming the autoloading stuff would need to be added to that mediawiki-extension Composer plugin. Someone would need to have a look at that :-]
If anyone has any interest in adding MediaWiki extension support in Composer, please reach them in their #composer IRC channel or via their mailing list. I am sure they will be glad to help us on that front.
And again, adding support for Composer would just need: - write basic code to include the generated autoload file - add some composer.json files in extension roots
We could start with a subset of extensions.