Add extension.json, empty PHP entry point

Depends upon I9a736a4c0ff73 in MediaWiki core

Bug: T87929
Change-Id: I0ec2d98321b319b4e9e6222b867cc9958dbfe0cf
This commit is contained in:
Kunal Mehta 2015-05-02 23:35:33 -07:00
parent 56470cd3c5
commit df4b7a8fac
2 changed files with 34 additions and 32 deletions

View file

@ -1,35 +1,14 @@
<?php <?php
/**
* ImageMap extension - Allows clickable HTML image maps.
*
* @link https://www.mediawiki.org/wiki/Extension:ImageMap Documentation
*
* @file
* @ingroup Extensions
* @package MediaWiki
* @author Tim Starling
* @copyright (C) 2007 Tim Starling
* @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
*/
if ( !defined( 'MEDIAWIKI' ) ) { if ( function_exists( 'wfLoadExtension' ) ) {
die( 'This file is a MediaWiki extension, it is not a valid entry point' ); wfLoadExtension( 'ImageMap' );
// Keep i18n globals so mergeMessageFileList.php doesn't break
$wgMessagesDirs['ImageMap'] = __DIR__ . '/i18n';
/* wfWarn(
'Deprecated PHP entry point used for ImageMap extension. Please use wfLoadExtension instead, ' .
'see https://www.mediawiki.org/wiki/Extension_registration for more details.'
); */
return true;
} else {
die( 'This version of the ImageMap extension requires MediaWiki 1.25+' );
} }
//self executing anonymous function to prevent global scope assumptions
call_user_func( function() {
$dir = __DIR__ . '/';
$GLOBALS['wgMessagesDirs']['ImageMap'] = __DIR__ . '/i18n';
$GLOBALS['wgAutoloadClasses']['ImageMap'] = $dir . 'ImageMap_body.php';
$GLOBALS['wgHooks']['ParserFirstCallInit'][] = 'ImageMap::onParserFirstCallInit';
$GLOBALS['wgExtensionCredits']['parserhook'][] = array(
'path' => __FILE__,
'name' => 'ImageMap',
'author' => 'Tim Starling',
'url' => 'https://www.mediawiki.org/wiki/Extension:ImageMap',
'descriptionmsg' => 'imagemap_desc',
);
$GLOBALS['wgParserTestFiles'][] = $dir . 'imageMapParserTests.txt';
} );

23
extension.json Normal file
View file

@ -0,0 +1,23 @@
{
"name": "ImageMap",
"author": "Tim Starling",
"url": "https://www.mediawiki.org/wiki/Extension:ImageMap",
"descriptionmsg": "imagemap_desc",
"type": "parserhook",
"MessagesDirs": {
"ImageMap": [
"i18n"
]
},
"Hooks": {
"ParserFirstCallInit": [
"ImageMap::onParserFirstCallInit"
]
},
"AutoloadClasses": {
"ImageMap": "ImageMap_body.php"
},
"ParserTestFiles": [
"imageMapParserTests.txt"
]
}