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.