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.
Short Answer
These extension parameters simply add a line to the
LocalSettings.php
file, if the named extension is found in theextensions
directory, to load the extension at runtime.Long Answer
I played with this a little. I tested the
--with-extensions
which, per the help docs, willdetect 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:
It produced the following block in my
LocalSettings.php
config file listing the default packages included with the current version of the Mediawiki core: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: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 theLocalSettings.php
config file only those extensions explicitly specified and found in theextensions
directory.