Help:Installation/Using Composer with MediaWiki 1.19 - 1.21
From Linux Web Expert
Installation | |
---|---|
This pages describes the installation using non-native Composer support for MediaWiki 1.19.x to 1.21.x. | |
Further Information | |
Installation type: | new |
Installation method: | Composer |
MediaWiki version: | |
Table of Contents | |
File:OOjs UI icon lightbulb-yellow.svg <translate> Note:</translate> MediaWiki 1.19.x, 1.20.x and 1.21.x are no longer supported branches. Users are advised to upgrade to a supported branch of MediaWiki.
Install
Use these instructions for a new SMW installation (MediaWiki 1.19.x to 1.21.x, non-native Composer support).
- Install the "Extension Installer" extension - see installing "Extension Installer" for how to do this.
- Check your MediaWiki version on special page "Special:Version" to ensure compatibility. See also Update to the appropriate version of MediaWiki.
- Add the following line to the "require" section of the "composer.json" file in the
…/extensions/ExtensionInstaller/
directory.[1]"mediawiki/semantic-media-wiki": "~2.1"
- Run the installation script from the
…/extensions/ExtensionInstaller/
directory:[2]php composer.phar install
- Run the setup script from the base directory[3] of your MediaWiki installation:
php maintenance/update.php
- Add a call to
enableSemantics()
to the end of the "LocalSettings.php" file.enableSemantics()
takes in the domain name of the wiki; a wiki located at "example.org", for instance, should have the following call:enableSemantics( 'example.org' );
- The calls
require_once …
must neither be added for Semantic MediaWiki nor for Validator since Composer loads the extensions automatically.
- Add optional settings[4] apart from one exception[5] to the "LocalSettings.php" file as desired below the
enableSemantics()
call. - In case you want to use additional semantic extensions which are not installed via Composer like e.g. Semantic Drilldown you still have to invoke them by adding the respective line
require_once …
to you "LocalSettings.php" file below theenableSemantics()
call. - See the page "Special:Version" on your wiki to verify that the extension is successfully installed.
- Test your installation as described on the help page about testing SMW.
- Done!
Update
Use these instructions to update an existing SMW installation (MediaWiki 1.19.x to 1.21.x, non-native Composer support).
- Backup your database and installation.
- Run the update script from the
…/extensions/ExtensionInstaller/
directory:[2]php composer.phar update
- See the page "Special:Version" on your wiki to verify that the extension was successfully updated.
- Run the setup script from the base directory[3] of your MediaWiki installation:
php maintenance/update.php
- Run the refresh database script from the base directory[3]:[6]
php extensions/SemanticMediaWiki/maintenance/SMW_refreshData.php -d 50 -v
- Done!
References
- ↑ See also the example "composer.json" file, which already contains the line to be added here.
- ↑ 2.0 2.1 In case you installed Composer "globally" on your server, you will have to drop the
php
and.phar
particles from the command. - ↑ 3.0 3.1 3.2 This is the directory which contains the "LocalSettings.php" file.
- ↑ See the help page on configuring SMW. Usually only a few configuration parameters have to be changed if there is a need to do so at all.
- ↑ If you manually set
$smwgNamespaceIndex
to something other than the default value of100
, you must do this above the enableSemantics() line instead. Make sure that the value set is ≥100
as well as an even number. - ↑ This is an optional step to take to assure that the semantic store is valid and up to date.