mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/ImageMap
synced 2024-11-27 15:40:03 +00:00
Add extension.json, empty PHP entry point
Depends upon I9a736a4c0ff73 in MediaWiki core Bug: T87929 Change-Id: I0ec2d98321b319b4e9e6222b867cc9958dbfe0cf
This commit is contained in:
parent
56470cd3c5
commit
df4b7a8fac
43
ImageMap.php
43
ImageMap.php
|
@ -1,35 +1,14 @@
|
|||
<?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' ) ) {
|
||||
die( 'This file is a MediaWiki extension, it is not a valid entry point' );
|
||||
if ( function_exists( 'wfLoadExtension' ) ) {
|
||||
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
23
extension.json
Normal 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"
|
||||
]
|
||||
}
|
Loading…
Reference in a new issue