forked from ProfessionalWiki/SubPageList
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSubPageList.php
57 lines (45 loc) · 1.59 KB
/
SubPageList.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
55
56
57
<?php
/**
* Initialization file for the SubPageList extension.
*
* @codeCoverageIgnore
* @licence GNU GPL v2+
* @author Jeroen De Dauw < [email protected] >
*/
if ( !defined( 'MEDIAWIKI' ) ) {
die( 'Not an entry point.' );
}
if ( defined( 'SPL_VERSION' ) ) {
// Do not initialize more then once.
return 1;
}
define( 'SPL_VERSION', '1.1' );
// Include the composer autoloader if it is present.
if ( is_readable( __DIR__ . '/vendor/autoload.php' ) ) {
include_once( __DIR__ . '/vendor/autoload.php' );
}
// Only initialize the extension when all dependencies are present.
if ( !defined( 'ParserHooks_VERSION' ) ) {
throw new Exception( 'You need to have ParserHooks installed in order to use SubPageList' );
}
call_user_func( function() {
$GLOBALS['wgExtensionCredits']['parserhook'][] = array(
'path' => __FILE__,
'name' => 'SubPageList',
'version' => SPL_VERSION,
'author' => array(
'[https://www.mediawiki.org/wiki/User:Jeroen_De_Dauw Jeroen De Dauw]',
),
'url' => 'https://github.com/JeroenDeDauw/SubPageList/blob/master/README.md',
'descriptionmsg' => 'spl-desc'
);
$GLOBALS['wgExtensionMessagesFiles']['SubPageList'] = __DIR__ . '/SubPageList.i18n.php';
$GLOBALS['wgExtensionMessagesFiles']['SubPageListMagic'] = __DIR__ . '/SubPageList.i18n.magic.php';
$GLOBALS['wgExtensionFunctions'][] = function() {
global $wgHooks;
$extension = new \SubPageList\Extension( \SubPageList\Settings::newFromGlobals( $GLOBALS ) );
$extensionSetup = new \SubPageList\Setup( $extension, $wgHooks, __DIR__ );
$extensionSetup->run();
};
} );
require_once 'SubPageList.settings.php';