Skip to content

Commit

Permalink
refactor to use wikibase host and port
Browse files Browse the repository at this point in the history
  • Loading branch information
eloiferrer committed Sep 5, 2023
1 parent 144603f commit e253b84
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions mediawiki/LocalSettings.d/Wikibase.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,25 @@
wfLoadExtension( 'WikibaseClient', "$IP/extensions/Wikibase/extension-client.json" );
require_once "$IP/extensions/Wikibase/client/ExampleSettings.php";

$wikibaseHost = getenv('WIKIBASE_HOST');

if ($wikibaseHost === 'localhost') {
$portalHost = getenv('WIKIBASE_SCHEME') . '://localhost:' . getenv('WIKIBASE_PORT');
} else {
$portalHost = getenv('WIKIBASE_SCHEME') . $wikibaseHost;
}

# enable linking between wikibase and content pages
$wgWBRepoSettings['siteLinkGroups'] = [ 'mathematics' ];
$wgWBClientSettings['siteLinkGroups'] = [ 'mathematics' ];
$wgWBClientSettings['siteGlobalID'] = 'mardi';
$wgWBClientSettings['repoUrl'] = getenv('WIKIBASE_SCHEME') . '://' . getenv('PORTAL_HOST');
$wgWBClientSettings['repoUrl'] = $portalHost;
$wgWBClientSettings['repoScriptPath'] = '/w';
$wgWBClientSettings['repoArticlePath'] = '/wiki/$1';
$wgWBClientSettings['entitySources'] = [
'mardi_source' => [
'repoDatabase' => 'my_wiki',
'baseUri' => getenv('WIKIBASE_SCHEME') . '://' . getenv('PORTAL_HOST') . '/entity',
'baseUri' => $portalHost . '/entity',
'entityNamespaces' => [
'item' => 120,
'property' => 122,
Expand Down

0 comments on commit e253b84

Please sign in to comment.