MediaWiki composer extensions

MediaWiki composer extensions

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.

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:

composer update

Then run:

composer require mediawiki/semantic-compound-queries:~1.1

Obviously replace the semantic compound queries as detailed on the extensions page on MediaWiki.

Please Login to Comment.