Conditions | 3 |
Paths | 4 |
Total Lines | 23 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
16 | public static function initExtension() { |
||
17 | |||
18 | if ( file_exists( __DIR__ . '/vendor/autoload.php' ) ) { |
||
19 | require_once __DIR__ . '/vendor/autoload.php'; |
||
20 | } |
||
21 | |||
22 | // must NOT use ExtensionRegistry::getInstance() to avoid recursion! |
||
23 | $registry = new ExtensionRegistry(); |
||
24 | if ( file_exists( __DIR__ . '/extensions/Lingo/extension.json' ) ) { |
||
25 | $registry->load( __DIR__ . '/extensions/Lingo/extension.json' ); |
||
26 | } else { |
||
27 | $registry->load( $GLOBALS[ 'wgExtensionDirectory' ] . '/Lingo/extension.json' ); |
||
28 | } |
||
29 | |||
30 | $GLOBALS[ 'wgexLingoBackend' ] = 'SG\LingoBackendAdapter'; |
||
31 | |||
32 | $GLOBALS[ 'wgExtensionFunctions' ][] = function () { |
||
33 | |||
34 | $hookRegistry = new HookRegistry(); |
||
35 | |||
36 | $hookRegistry->register(); |
||
37 | }; |
||
38 | } |
||
39 | |||
55 |