-
Notifications
You must be signed in to change notification settings - Fork 0
/
Linkrel.php
executable file
·36 lines (28 loc) · 1.04 KB
/
Linkrel.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
<?php
if ( !defined( 'MEDIAWIKI' ) ) {
die( 'This file is a MediaWiki extension, it is not a valid entry point' );
}
//self executing anonymous function to prevent global scope assumptions
call_user_func( function() {
$GLOBALS['wgExtensionCredits']['parserhook'][] = array(
'path' => __FILE__,
'name' => 'Linkrel',
'version' => '0.1',
'url' => 'https://github.com/SimilisTools/mediawiki-linkrel',
'author' => array( 'Toniher' ),
'descriptionmsg' => 'linkrel-desc',
);
$GLOBALS['wgAutoloadClasses']['Linkrel'] = __DIR__.'/Linkrel_body.php';
$GLOBALS['wgMessagesDirs']['Linkrel'] = __DIR__ . '/i18n';
$GLOBALS['wgExtensionMessagesFiles']['Linkrel'] = __DIR__ . '/Linkrel.i18n.php';
$GLOBALS['wgExtensionMessagesFiles']['LinkrelMagic'] = __DIR__ . '/Linkrel.i18n.magic.php';
$GLOBALS['wgHooks']['ParserFirstCallInit'][] = 'wfRegisterLinkrel';
});
/**
* @param $parser Parser
* @return bool
*/
function wfRegisterLinkrel( $parser ) {
$parser->setFunctionHook( 'linkrel', 'Linkrel::process_linkrel', SFH_OBJECT_ARGS );
return true;
}