Upgrading an extension that now uses Composer

This blog post is aimed at users of the MediaWiki software that have extensions installed, and want to upgrade one or more to a version that makes use of Composer. At present this is of particular relevance for those upgrading to SMW 1.9 beta or Maps 3.0 alpha.

If you are not yet familiar with the installation procedure of extensions using Composer, please read the documentation first.

In short, what needs to be done is (partially) removing the extensions that will be upgraded, and then following the standard installation instructions linked above. This comes down to following these steps:

  • Identify the extensions that will be upgraded. This includes any dependencies they might have. For instance, if you have SMW 1.8 installed, you will also have the Validator extension installed.
  • For all these extensions, remove the include statements you have in your LocalSettings.php file.
  • For all these extensions, remove their code located in the extensions directory.
  • Install the removed extensions again, though this time using Composer.
  • Do any of the standard upgrading work that might need to be done. For instance running maintenance/update.php or specifying configuration in LocalSettings.php.

It is perfectly possible to have extensions installed via Composer while having others installed in the old, manual, way. Do however keep in mind that there can be no overlap between the two systems. For instance, if you are installing SMW, and it’s Validator dependency, then you should not replace the automatically installed version of Validator with an older version you manually obtained.

2 thoughts on “Upgrading an extension that now uses Composer”

  1. Gidday Jeroen. My host does not provide access to shell so I cannot install Composer. Have you got instructions on the manual install. I have loaded the latest release of maps and the latest release of Validator. I am getting the following error though:

    Fatal error: Uncaught exception ‘Exception’ with message ‘You need to have Validator installed in order to use Maps’ in …/extensions/Maps/Maps.php:31 Stack trace: #0 …/bdtwiki/LocalSettings.php(157): require_once() #1 …/bdtwiki/includes/WebStart.php(136): require_once(‘…’) #2 …/bdtwiki/index.php(46): require(‘…’) #3 {main} thrown in …/bdtwiki/extensions/Maps/Maps.php on line 31

    I have put a fair bit of time into this and seem to be banging my head against the wall.

    1. Create a composer.json file on a box where you have shell access, run “composer install” on it, and copy the resulting files to your actual wiki server.

      Managing all the components manually yourself is no longer supported.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.