MediaWiki Composer extensions
Status: Resolved
Publication date: 2018-08-04
Last edited by: Garyf
Last updated: 2023 - 11 - 2
The problem
With certain extensions using MediaWiki you may need to use composer. Two examples are Semantic Compound Queries and Maps. This example is using Windows Server 2012 R2 running WAMPserver. Obviously you will need to have composer installed in the PHP version you are using.
The resolution
Please note: cheekyfactor.com or the owners of this site cannot be held responsible if things go wrong. You perform these tasks at your own risk.
Device: Server
Operating system: Windows
Software: MediaWiki, Composer
Guidance for Server, Windows, MediaWiki, Composer
To install this using composer open the compose.json in the root of the Wiki.
You will see a lot of code like this:
Find the line:
“mediawiki/semantic-media-wiki”: “~2.5”
In the example for Semantic Compound Queries the extension page tells you to add the code:
{ "require": { "mediawiki/semantic-compound-queries": "~1.1" } }
But in reality, we are only interested adding
“mediawiki/semantic-compound-queries”: “~1.1”
Add this line above the Semantic MediaWiki line:
“mediawiki/semantic-compound-queries”: “~1.1”,
Note, we now have a comma on the end of the line, this is key:
Save and close the composer.json file.
If you have already been running commands in the command prompt, and crucially if you have set the path anywhere, close the command prompt and reopen it.
Change the directory to the root of your Wiki and run:
php composer.phar update
Then run:
php composer.phar require mediawiki/semantic-compound-queries:~1.1
Obviously replace the semantic compound queries as detailed on the extensions page on MediaWiki.