Skip to content

Commit 06c1faa

Browse files
Load composer autoloader from extension.json
This ensures that loading the extension via wfLoadExtension( 'WikibaseImport' ); instead of the PHP entry point also works. Fixes filbertkm#32.
1 parent c69c83b commit 06c1faa

2 files changed

Lines changed: 1 addition & 4 deletions

File tree

WikibaseImport.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
<?php
22

33
if ( function_exists( 'wfLoadExtension' ) ) {
4-
if ( file_exists( __DIR__ . '/vendor/autoload.php' ) ) {
5-
require_once __DIR__ . '/vendor/autoload.php';
6-
}
7-
84
wfLoadExtension( 'WikibaseImport', __DIR__ . '/extension.json' );
95
} else {
106
die( 'WikibaseImport requires MediaWiki 1.25+' );

extension.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"load_composer_autoloader": true,
23
"name": "Wikibase Import",
34
"version": "0.1",
45
"author": [

0 commit comments

Comments
 (0)