The difference between doing it in PHP and XML, is that using the XML setup, we can read in that data without requiring that any of that data be included or anything (ie: For extensions that are not installed), and use it on something like a list of extensions which are enabled, and ones which are available to be enabled.
Also, I've done a bit with this before (^_^ Actually for the most part, your idea of using an xml file is similar to what I had thought of ages ago the last time I tried it) Though I think some of that should be expanded: <mediawiki> <min>1.7.0</min> <max>1.12.0</max> </mediawiki> There are some extensions which start to break after certain versions, and shouldn't be used on them. Some of them may even end up creating fatal PHP errors which would cripple any wiki which tried to enable them, but we still want to make them available for older wiki.
We should probably also have a notion of dependencies: <dependencies> <dependency>Semantic MediaWiki</dependency> </dependencies> This will be important for extensions like the extensions which use SMW, ones which use DPL, or things like the BizzWiki extensions or other ones which require things like the SimpleRegex classes, or other extensions meant to simplify functionality for other extensions. Trying to install those without their dependencies would lead to fatal php errors.
Oh wait crap... That was something I was working on when the old Wiki-Tools was online... T_T I had a few entire schema files and Web Specs (Like the W3 ones) dedicated entirely to the specification of Extension XML Definition files.
Also, some notion of installation would be nice. Basically it would be good to offer the ability to easily do the installation of the needed SQL tables, and additionally upgrading of those tables.
~Daniel Friesen(Dantman) of: -The Gaiapedia (http://gaia.wikia.com) -Wikia ACG on Wikia.com (http://wikia.com/wiki/Wikia_ACG) -and Wiki-Tools.com (http://wiki-tools.com)
Ashar Voultoiz wrote:
MinuteElectron wrote:
<snip>
My idea is to use an XML file for each extension, this would be fairly easy to parse (XML support is a requirement for installing MediaWiki) and is easy to write. My suggestion as an example format is (using CategoryStepper as the example) is:
<extension> <name>CategoryStepper</name> <version>1.5</version> <description>categorystepper-desc</description> <mediawiki>1.11.0</mediawiki> </extension>
Hello Minute e-,
You might want to use XML Schema Description (XSD) to describe the content of an XML file. You can even get some kind of versioning in case we have to add or deprecate elements.
A simple .xsd could looks like :
<?xml version="1.0" encoding="UTF-8" ?>
<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:mwext="http://www.mediawiki.org/xml/extension-0.1/" targetNamespace="http://www.mediawiki.org/xml/extension-0.1/" elementFormDefault="qualified">
<element name="mwextension" /> <!-- See includes/SpecialVersion.php for valid extension credits --> <element type="string" name="name" use="required"/> <element type="string" name="version" /> <element type="string" name="author" /> <element type="anyURI" name="url" /> <element type="string" name="descriptionmsg" /> <element type="string" name="description" />
</schema>
This should be enough to support the current $wgExtensionCredits. The XSD above is based on Brion's XSD for the exporter : http://www.mediawiki.org/xml/export-0.3/
You might want to add the extension base path, php entry point and how i18n is handled. That could be done later in a 0.2 schema :)
While this original version is quite concise it would be easy to expand upon if any further features were needed (for example, there is a possibility of compatibility verification by checking class names etc.). The extensions i18n file will also be loaded within the special page's scope so the <description> tag correlates to a message name allowing for internationalization. The <mediawiki> tag correlates to the minimum MediaWiki version required, the rest are probably self explanatory.
As the i18n descriptions are in PHP, I am not sure you want to put them in statics XML files. That will just duplicate the information.