Author: nickpj
Description:
It could be handy for users and for testers if extensions could optionally include an example of the minimal additions required to LocalSettings.php for installing them, and an example of how to use the extension (for Tag extensions or Parser Function extensions that alter wiki syntax). This is partly a problem of agreeing on a good convention, and partly a technical problem.
One possible way might be (using the ImageMap extension as an example) if two elements were added to the $wgExtensionCredits array:
$wgExtensionCredits['parserhook']['ImageMap'] = array(
'svn-date' => '$LastChangedDate: 2008-05-06 21:59:58 +1000 (Tue, 06 May 2008) $', 'svn-revision' => '$LastChangedRevision: 34306 $', 'author' => 'Tim Starling', 'url' => 'http://www.mediawiki.org/wiki/Extension:ImageMap', 'description' => 'Allows client-side clickable image maps using <nowiki><imagemap></nowiki> tag.', 'descriptionmsg' => 'imagemap_desc',
+ 'usage-example' => "<imagemap>\nImage:Framing_hammer_956.jpg|\nrect 1 1 299 218 [[Use a Hammer Safely]]\ndesc none\n</imagemap>",
+ 'basic-install' => 'require_once( "$IP/extensions/ImageMap/ImageMap.php" );',
);
... or alternatively, put all of this configuration information into a standard INI file name - e.g. "config.ini" - as having a standard file name containing this type of data could be useful to testers, and for testing software, which could now know how to install and smoketest an extension. An example config.ini could be:
name = ImageMap
svn-date = "$LastChangedDate: 2008-05-06 21:59:58 +1000 (Tue, 06 May 2008) $"
svn-revision = "$LastChangedRevision: 34306 $"
author = "Tim Starling"
url = "http://www.mediawiki.org/wiki/Extension:ImageMap"
description = "Allows client-side clickable image maps using <nowiki><imagemap></nowiki> tag."
descriptionmsg = "imagemap_desc"
usage-example = "<imagemap>
Image:Framing_hammer_956.jpg|
rect 1 1 299 218 [[Use a Hammer Safely]]
desc none
</imagemap>"
basic-install = "require_once( \"$IP/extensions/ImageMap/ImageMap.php\" );"
... and then use a line like to give current behaviour:
$wgExtensionCredits['parserhook']['ImageMap'] = parse_ini_file( 'config.ini' );
Note - the main problem with trying to give current behaviour in the above line is a bug in older versions of PHP with parse_ini_file: I have observed that the parse_ini_file in PHP 5.1.2 does not properly handle escaped quotes (as in the "basic-install" line above), and neither do builds snaps.php.net builds from March 2007, but it works correctly with snaps.php.net builds now, so at some point between March 2007 and now this PHP bug was fixed.
Version: 1.13.x
Severity: enhancement