MediaWiki-Docker/Extension/BCmath

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

cd mediawiki/core

or wherever you put your local repo.

First you need the Scribunto extension:

git clone "https://gerrit.wikimedia.org/r/mediawiki/extensions/Scribunto" extensions/Scribunto
echo "wfLoadExtension( 'Scribunto' );" >> LocalSettings.php
echo "\$wgScribuntoDefaultEngine = 'luastandalone';" >> LocalSettings.php

You probably want these:

git clone "https://gerrit.wikimedia.org/r/mediawiki/skins/Vector" skins/Vector
echo "wfLoadSkin( 'Vector' );" >> LocalSettings.php
git clone "https://gerrit.wikimedia.org/r/mediawiki/extensions/WikiEditor" extensions/WikiEditor
echo "wfLoadExtension( 'WikiEditor' );" >> LocalSettings.php
git clone "https://gerrit.wikimedia.org/r/mediawiki/extensions/CodeEditor" extensions/CodeEditor
echo "wfLoadExtension( 'CodeEditor' );" >> LocalSettings.php
echo "\$wgScribuntoUseCodeEditor = true;" >> LocalSettings.php

The BCmath extension itself:

# prerequisite, should return yes, otherwise you must override the base Dockerfile and create a new image
docker compose exec mediawiki php -r 'echo "bcmath: " . ( extension_loaded( "bcmath" ) ? "yes" : "no" ) . "\n";'

git clone "https://github.com/jeblad/BCmath.git" extensions/BCmath
echo "wfLoadExtension( 'BCmath' );" >> LocalSettings.php

Note that the extension has an additional Vagrant development environment, see BCmath: Manual/Vagrant.