-
Notifications
You must be signed in to change notification settings - Fork 0
/
Alink.php
executable file
·37 lines (29 loc) · 1.09 KB
/
Alink.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
<?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' => 'Alink',
'version' => '0.2.0',
'url' => 'https://github.com/SimilisTools/mediawiki-alink',
'author' => array( 'Toniher' ),
'descriptionmsg' => 'alink-desc',
);
$GLOBALS['wgAutoloadClasses']['Alink'] = __DIR__.'/Alink_body.php';
$GLOBALS['wgMessagesDirs']['Alink'] = __DIR__ . '/i18n';
$GLOBALS['wgExtensionMessagesFiles']['Alink'] = __DIR__ . '/Alink.i18n.php';
$GLOBALS['wgExtensionMessagesFiles']['AlinkMagic'] = __DIR__ . '/Alink.i18n.magic.php';
$GLOBALS['wgHooks']['ParserFirstCallInit'][] = 'wfRegisterAlink';
} );
/**
* @param $parser Parser
* @return bool
*/
function wfRegisterAlink( $parser ) {
$parser->setFunctionHook( 'alink', 'Alink::process_alink', SFH_OBJECT_ARGS );
$parser->setFunctionHook( 'aimg', 'Alink::process_aimg', SFH_OBJECT_ARGS );
return true;
}