Help:Installation/Using Composer with MediaWiki 1.19 - 1.21

From semantic-mediawiki.org
< Installation(Redirected from Help:Installation/Using Composer with MediaWiki 1.19 - 1.21)
Administrator manualInstallationHelp:Installation/Using Composer with MediaWiki 1.19 - 1.21
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

NoteNote:  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[edit]

Use these instructions for a new SMW installation (MediaWiki 1.19.x to 1.21.x, non-native Composer support).

  1. Install the "Extension Installer" extension - see installing "Extension Installer" for how to do this.
  2. Check your MediaWiki version on special page "Special:Version" to ensure compatibility. See also Update to the appropriate version of MediaWiki.
  3. 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"
    
  4. Run the installation script from the …/extensions/ExtensionInstaller/ directory:[2]
    php composer.phar install
    
  5. Run the setup script from the base directory[3] of your MediaWiki installation:
    php maintenance/update.php
    
  6. 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.
  7. Add optional settings[4] apart from one exception[5] to the "LocalSettings.php" file as desired below the enableSemantics() call.
  8. In case you want to use additional semantic extensions which are not installed via Composer like e.g. Extension "Semantic Drilldown" you still have to invoke them by adding the respective line require_once … to you "LocalSettings.php" file below the enableSemantics() call.
  9. See the page "Special:Version" on your wiki to verify that the extension is successfully installed.
  10. Test your installation as described on the help page about testing SMW.
  11. Done!

Update[edit]

Use these instructions to update an existing SMW installation (MediaWiki 1.19.x to 1.21.x, non-native Composer support).

  1. Backup your database and installation.
  2. Run the update script from the …/extensions/ExtensionInstaller/ directory:[2]
    php composer.phar update
    
  3. See the page "Special:Version" on your wiki to verify that the extension was successfully updated.
  4. Run the setup script from the base directory[3] of your MediaWiki installation:
    php maintenance/update.php
    
  5. Run the refresh database script from the base directory[3]:[6]
    php extensions/SemanticMediaWiki/maintenance/SMW_refreshData.php -d 50 -v
    
  6. Done!

References[edit]

  1. See also the example "composer.json" file, which already contains the line to be added here.
  2. 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. 3.0 3.1 3.2 This is the directory which contains the "LocalSettings.php" file.
  4. 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.
  5. If you manually set $smwgNamespaceIndex to something other than the default value of 100, you must do this above the enableSemantics() line instead. Make sure that the value set is ≥ 100 as well as an even number.
  6. This is an optional step to take to assure that the semantic store is valid and up to date.

en