-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWoWItem.setup.php
54 lines (50 loc) · 1.73 KB
/
WoWItem.setup.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?php
/**
* WoWItem - this extension handles World of Warcraft items
*
* To activate this extension, add the following into your LocalSettings.php file:
* <code>require_once("$IP/extensions/WoWItem/WoWItem.setup.php");</code>
*
* @package MediaWiki
* @subpackage ParserHook
* @author James Twyford <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
* @version v0.10
* @link http://www.wowwiki.com WoWWiki
*/
/**
* Protect against register_globals vulnerabilities.
* This line must be present before any global variable is referenced.
*/
if (!defined('MEDIAWIKI')) {
echo("This is a MediaWiki extension, not a standalone PHP script.\n");
die(-1);
}
// Extension credits that will show up on Special:Version
$wgExtensionCredits['parserhook'][] = array(
'name' => "WoWItem",
'version' => "0.10",
'author' => "James Twyford",
'url' => "http://www.wowwiki.com",
'description' => "This extension handles World of Warcraft items",
);
//Avoid unstubbing $wgParser on setHook() too early on modern MW (1.12+) per r35980
if (defined('MW_SUPPORTS_PARSERFIRSTCALLINIT')) {
$wgHooks['ParserFirstCallInit'][] = 'efWoWItemInit';
} else { // Otherwise do things the old fashioned way
$wgExtensionFunctions[] = 'efWoWItemInit';
}
/**
* global init--set up our hooks and callbacks
*
* @return true
*/
function efWoWItemInit()
{
global $wgParser;
$wgParser->setHook('item', 'WoWItem::parse');
return true;
}
$wgAutoloadClasses['WoWItem'] = dirname(__FILE__) . '/WoWItem.body.php';
$wgAutoloadClasses['WoWItemParser'] = dirname(__FILE__) . '/WoWItem.parser.php';
$wgAutoloadClasses['WoWItemRender'] = dirname(__FILE__) . '/WoWItem.render.php';