Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request to deprecate ExtensionRegistry->load #47

Merged
merged 5 commits into from
Sep 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
root = true

[*]
indent_style = tab
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false

[*.yml]
indent_style = space
indent_size = 2
11 changes: 7 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,19 @@ services:

matrix:
include:
- env: DB=mysql; MW=master; PHPUNIT=6.5
- env: DB=mysql; MW=master; PHPUNIT=8.5
php: 7.4
- env: DB=mysql; MW=REL1_35
php: 7.3
- env: DB=mysql; MW=REL1_34
php: 7.2
- env: DB=mysql; MW=REL1_31; TYPE=coverage
php: 7.0
- env: DB=mysql; MW=REL1_33
php: 7.2
- env: DB=mysql; MW=REL1_32
php: 7.1
allow_failures:
- env: DB=mysql; MW=master; PHPUNIT=6.5
- env: DB=mysql; MW=master; PHPUNIT=8.5
- env: DB=mysql; MW=REL1_35

install:
- bash ./tests/travis/install-mediawiki.sh
Expand Down
11 changes: 0 additions & 11 deletions SemanticGlossary.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,6 @@ public static function initExtension() {
require_once __DIR__ . '/vendor/autoload.php';
}

// Load Extension:Lingo - but only if not already loaded
if ( ! class_exists( 'Lingo\Lingo' ) ) {
// must NOT use ExtensionRegistry::getInstance() to avoid recursion!
$registry = new ExtensionRegistry();
if ( file_exists( __DIR__ . '/extensions/Lingo/extension.json' ) ) {
$registry->load( __DIR__ . '/extensions/Lingo/extension.json' );
} else {
$registry->load( $GLOBALS[ 'wgExtensionDirectory' ] . '/Lingo/extension.json' );
}
}

$GLOBALS[ 'wgexLingoBackend' ] = 'SG\LingoBackendAdapter';

$GLOBALS[ 'wgExtensionFunctions' ][] = function () {
Expand Down
3 changes: 3 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@
"mediawiki/semantic-media-wiki": "^2.4|^3.0",
"mediawiki/lingo": "^2.0.3|^3.0"
},
"require-dev": {
"phpunit/phpunit": "^6.5"
},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what this is good for

"extra": {
"branch-alias": {
"dev-master": "3.x-dev"
Expand Down
5 changes: 4 additions & 1 deletion extension.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@
"license-name": "GPL-2.0-or-later",
"type": "semantic",
"requires": {
"MediaWiki": "~1.27"
"MediaWiki": "~1.27",
"extensions": {
"Lingo": "*"
}
},
"MessagesDirs": {
"SemanticGlossary": [
Expand Down
2 changes: 1 addition & 1 deletion tests/phpunit/Integration/MwDBSQLStoreIntegrationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class MwDBSQLStoreIntegrationTest extends MwDBaseUnitTestCase {
private $pageDeleter;
private $runnerFactory;

protected function setUp() {
protected function setUp() :void {
parent::setUp();

$this->pageCreator = UtilityFactory::getInstance()->newPageCreator();
Expand Down
6 changes: 3 additions & 3 deletions tests/travis/install-semantic-glossary.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function installToMediaWikiRoot {
then
composer require 'phpunit/phpunit='$PHPUNIT --prefer-source --update-with-dependencies
else
composer require 'phpunit/phpunit=4.8.*' --prefer-source --update-with-dependencies
composer require 'phpunit/phpunit=6.5.*' --prefer-source --update-with-dependencies
fi

if [ "$SG" != "" ]
Expand Down Expand Up @@ -65,10 +65,10 @@ function updateConfiguration {
echo '$wgDebugDumpSql = false;' >> LocalSettings.php
echo '$wgShowDBErrorBacktrace = true;' >> LocalSettings.php
echo "putenv( 'MW_INSTALL_PATH=$(pwd)' );" >> LocalSettings.php

# SMW#1732
echo "wfLoadExtension( 'SemanticMediaWiki' );" >> LocalSettings.php

echo "wfLoadExtension( 'Lingo' );" >> LocalSettings.php
echo "wfLoadExtension( 'SemanticGlossary' );" >> LocalSettings.php

php maintenance/update.php --quick
Expand Down