MediaWiki-Docker/Extension/Wikibase

Follow Quickstart intructions at MediaWiki-Docker page. Once MediaWiki is running and available at http://localhost:8080 and installed Composer, then:

cd extensions
git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/Wikibase.git
cd Wikibase
git submodule update --init --recursive # get the dependencies using submodules

Fetch all dependencies using the composer-merge-plugin

Include the following into composer.local.json at the root of your mediawiki installation:

{
  "extra": {
    "merge-plugin": {
      "include": [
        "extensions/Wikibase/composer.json"
      ]
    }
  },
  "require": {
    "monolog/monolog": "~1.24.0"
  }
}

and run from the root of your mediawiki installation using this method:

# Or use dockerized version (does not require PHP or composer installed)
docker run -it --rm --user $(id -u):$(id -g) -v ~/.composer:/tmp -v $(pwd):/app docker.io/composer install --no-dev

Add the following lines to LocalSettings.php of your MediaWiki installation.

Enable Wikibase Repository and Wikibase ClientEdit

$wgEnableWikibaseRepo = true;
$wgEnableWikibaseClient = true;
require_once "$IP/extensions/Wikibase/repo/Wikibase.php";
require_once "$IP/extensions/Wikibase/repo/ExampleSettings.php";
require_once "$IP/extensions/Wikibase/client/WikibaseClient.php";
require_once "$IP/extensions/Wikibase/client/ExampleSettings.php";