MediaWiki-Docker/Extension/Wikibase

From mediawiki.org
Jump to navigation Jump to search

This page instructs you to install Wikibase/Installation inside MediaWiki-Docker.

Follow the Quickstart instructions at MediaWiki-Docker page. Once MediaWiki is running and available at http://localhost:8080, then continue with instructions on this page.

All commands should be run in the directory where you installed MediaWiki. All mentioned files are also located there.

Clone the repository and its dependencies[edit]

git clone "https://gerrit.wikimedia.org/r/mediawiki/skins/MinervaNeue" skins/MinervaNeue
git clone "https://gerrit.wikimedia.org/r/mediawiki/extensions/Cite" extensions/Cite
git clone "https://gerrit.wikimedia.org/r/mediawiki/extensions/MobileFrontend" extensions/MobileFrontend
git clone "https://gerrit.wikimedia.org/r/mediawiki/extensions/UniversalLanguageSelector" extensions/UniversalLanguageSelector
git clone "https://gerrit.wikimedia.org/r/mediawiki/extensions/Wikibase" extensions/Wikibase

cd extensions/Wikibase
git submodule update --init --recursive

Install Composer dependencies[edit]

Add this to composer.local.json:

{
  "extra": {
    "merge-plugin": {
      "include": [
        "extensions/Wikibase/composer.json"
      ]
    }
  }
}

Run:

docker-compose exec mediawiki composer update

Modify LocalSettings.php[edit]

If not already there, add this to the end of LocalSettings.php.

wfLoadSkin( 'MinervaNeue' );

wfLoadExtension( 'Cite' );
wfLoadExtension( 'MobileFrontend' );
wfLoadExtension( 'UniversalLanguageSelector' );

wfLoadExtension( 'WikibaseRepository', "$IP/extensions/Wikibase/extension-repo.json" );
require_once "$IP/extensions/Wikibase/repo/ExampleSettings.php";
wfLoadExtension( 'WikibaseClient', "$IP/extensions/Wikibase/extension-client.json" );
require_once "$IP/extensions/Wikibase/client/ExampleSettings.php";

$wgEnableWikibaseRepo = true;
$wgEnableWikibaseClient = true;

$wgWBClientSettings['dataBridgeEnabled'] = true;
$wgWBClientSettings['dataBridgeHrefRegExp'] = '[/=]((?:Item:)?(Q[1-9][0-9]*)).*#(P[1-9][0-9]*)$';
$wgWBClientSettings['dataBridgeEditTags'] = [ 'Data Bridge' ];

$wgWBRepoSettings['dataBridgeEnabled'] = true;
$wgWBRepoSettings['taintedReferencesEnabled'] = true;
$wgWBRepoSettings['termboxEnabled'] = true;

Run maintenance scripts[edit]

docker-compose exec mediawiki php maintenance/update.php
docker-compose exec mediawiki php extensions/Wikibase/lib/maintenance/populateSitesTable.php
docker-compose exec mediawiki php extensions/Wikibase/repo/maintenance/rebuildItemsPerSite.php
docker-compose exec mediawiki php extensions/Wikibase/client/maintenance/populateInterwiki.php