| Conditions | 3 |
| Paths | 4 |
| Total Lines | 25 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 1 |
| 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 | ApplicationFactory::getInstance()->getStore() |
||
| 36 | ); |
||
| 37 | |||
| 38 | $hookRegistry->register(); |
||
| 39 | }; |
||
| 40 | } |
||
| 41 | |||
| 57 |