Skip to content
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
44 changes: 0 additions & 44 deletions SemanticExternalQueryLookup.php

This file was deleted.

6 changes: 1 addition & 5 deletions extension.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,8 @@
"AutoloadNamespaces": {
"SEQL\\": "src/"
},
"AutoloadClasses": {
"SemanticExternalQueryLookup": "SemanticExternalQueryLookup.php"
},
"ExtensionFunctions": [
"SemanticExternalQueryLookup::onExtensionFunction"
"SEQL\\Setup::onExtensionFunction"
],
"config_prefix": "seqlg",
"config": {
Expand All @@ -51,6 +48,5 @@
"description": "An array defines list of namespaces allowed to execute queries against remote sources. Keep empty to allow every namespace."
}
},
"load_composer_autoloader": true,
"manifest_version": 2
}
31 changes: 31 additions & 0 deletions src/Setup.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php

namespace SEQL;

/**
* @license GPL-2.0-or-later
* @since 2.0
*
* @author mwjames
*/
class Setup {

/**
* @since 2.0
*/
public static function onExtensionFunction() {
class_alias( ByHttpRequestQueryLookup::class, 'SMWExternalQueryLookup' ); // deprecated
class_alias( ByHttpRequestQueryLookup::class, 'SMWExternalAskQueryLookup' );

$options = [
'externalRepositoryEndpoints' => $GLOBALS['seqlgExternalRepositoryEndpoints']
];

$hookRegistry = new HookRegistry(
$options
);

$hookRegistry->register();
}

}
8 changes: 5 additions & 3 deletions tests/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@
die( 'The SemanticMediaWiki test autoloader is not available' );
}

if ( !class_exists( 'SemanticExternalQueryLookup' ) || ( $version = SemanticExternalQueryLookup::getVersion() ) === null ) {
die( "\nSemantic External Query Lookup is not available, please check your Composer or LocalSettings.\n" );
if ( !is_readable( $extensionJson = __DIR__ . '/../extension.json' ) ) {
die( 'The SemanticExternalQueryLookup extension.json is not readable' );
}

print sprintf( "\n%-20s%s\n", "Semantic External Query Lookup: ", SEQL_VERSION );
$extensionInfo = json_decode( file_get_contents( $extensionJson ), true );

print sprintf( "\n%-20s%s\n", "Semantic External Query Lookup: ", $extensionInfo['version'] ?? 'UNKNOWN' );

$autoLoader = require $autoloaderClassPath;
$autoLoader->addPsr4( 'SEQL\\Tests\\', __DIR__ . '/phpunit/Unit' );
Expand Down