I'm trying to automate Wikimedia installation using Ansible and the Wikimedia command-line install script.
I noticed the current version includes script parameters for installing extensions. From the script help command:
$ php maintenance/install.php --help
CLI-based MediaWiki installation and configuration.
Default options are indicated in parentheses.
Usage: php install.php [--conf|--confpath|--dbgroupdefault|--dbname|--dbpass|--dbpassfile|--dbpath|--dbport|--dbprefix|-
-dbschema|--dbserver|--dbtype|--dbuser|--env-checks|--extensions|--globals|--help|--installdbpass|--installdbuser|--lang
|--memory-limit|--mwdebug|--pass|--passfile|--profiler|--quiet|--scriptpath|--server|--skins|--wiki|--with-extensions] [
name] <admin>
...
Script specific parameters:
--extensions: Comma-separated list of extensions to install
--with-extensions: Detect and include extensions
However, I am unable to find any other information on how best to use these parameters. Neither the Wikimedia manual pages on the install.php script or Extensions documents them:
Can someone point me to more details documentation on these parameters or provide an example of how to use them?
I am planning to do some trial and error and will answer this question myself if I figure out how they work before anyone else answers. But I know extension installation can get complicated and usually involves making config file updates so I hope I could find some existing documentation to guide me.
These extension parameters simply add a line to the LocalSettings.php
file, if the named extension is found in the extensions
directory, to load the extension at runtime.
I played with this a little. I tested the --with-extensions
which, per the help docs, will detect and include extensions
. What this appears to mean is that it will scan the extensions directory and install any extensions it find there.
I ran the following command:
php maintenance/install.php --with-extensions --dbserver="localhost" --dbname=foo --dbuser=foo --dbpass=foo --server="https://wiki.foo.localhost" --script path=/mediawiki -en --pass=foo "My Wiki Name" "Admin"
It produced the following block in my LocalSettings.php
config file listing the default packages included with the current version of the Mediawiki core:
# Enabled extensions. Most of the extensions are enabled by adding
# wfLoadExtensions('ExtensionName');
# to LocalSettings.php. Check specific extension documentation for more details.
# The following extensions were automatically enabled:
wfLoadExtension( 'CategoryTree' );
wfLoadExtension( 'Cite' );
wfLoadExtension( 'CiteThisPage' );
wfLoadExtension( 'CodeEditor' );
wfLoadExtension( 'ConfirmEdit' );
wfLoadExtension( 'Gadgets' );
wfLoadExtension( 'ImageMap' );
wfLoadExtension( 'InputBox' );
wfLoadExtension( 'Interwiki' );
wfLoadExtension( 'LocalisationUpdate' );
wfLoadExtension( 'MultimediaViewer' );
wfLoadExtension( 'Nuke' );
wfLoadExtension( 'OATHAuth' );
wfLoadExtension( 'ParserFunctions' );
wfLoadExtension( 'PdfHandler' );
wfLoadExtension( 'Poem' );
wfLoadExtension( 'Renameuser' );
wfLoadExtension( 'ReplaceText' );
wfLoadExtension( 'SpamBlacklist' );
wfLoadExtension( 'SyntaxHighlight_GeSHi' );
wfLoadExtension( 'TitleBlacklist' );
wfLoadExtension( 'WikiEditor' );
The complexity of this parameter, probably wisely, goes no further than that.
I tried running this command to see if the --extensions=GoogleLogin
parameter would auto-magically install the GoogleLogin extension. It did not. Rather it reported this error:
Could not find the registration file for the extension "GoogleLogin"
So if you're looking for a more full-featured Composer-like extension package-manager, this is not it.
When I downloaded the GoogleLogin extension and placed it in the extensions
directory and ran the --with-extensions
parameter and it did include it in the config file extensions block.
Without explicitly testing it, I concluded the --extensions
parameters operates the same way as --with-extensions
except that it will rewrite to the LocalSettings.php
config file only those extensions explicitly specified and found in the extensions
directory.