Status: | effective |
Progress: | 100% |
Version: | 3.1.0+ |
Composer[edit]
Composer needs to be installed and available first. See Using Composer with MediaWiki and Installing Composer if unsure.
Compatibility[edit]
Please check the compatibility requirements.
Prepare and obtain[edit]
If you do not have a "composer.local.json" file yet, create one in the base directory1 of your MediaWiki installation.
Since you should already have composer installed, you can do this by running composer in the top-level MediaWiki directory. Assuming you have composer.phar in that directory, the following command will work:
COMPOSER=composer.local.json php composer.phar require --no-update mediawiki/semantic-media-wiki
Alternatively, if the above fails, you can add the following content to your composer.local.json file:
{
"require": {
"mediawiki/semantic-media-wiki": "~4.2"
}
}
See also an example "composer.local.json" file if unsure how to proceed.
"~3.2"
with "~4.2"
to get the latest stable release. Please always omit the bugfix release number, i.e. the third number with additional information about the ~
usage can be found here. (Of course, if you used the command line to create composer.local.json instead of editing it by hand, composer has already selected the latest stable version.)
Now run the following command from the base directory1 of your MediaWiki installation:
composer update --no-dev
Enable[edit]
wfLoadExtension( 'SemanticMediaWiki' );
to LocalSettings.php !Until SMW 3.2.x only enableSemantics( 'example.org' );
was used to invoke SMW.
Add a call to wfLoadExtension()
as well as 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:
wfLoadExtension( 'SemanticMediaWiki' );
enableSemantics( 'example.org' );
Setup and update[edit]
Run MediaWiki'S "update.php" script from the base directory1 of your MediaWiki installation:
php maintenance/update.php
--skip-external-dependencies
to the call of the setup script if you get an error message similar to the following one:
mediawiki/semantic-media-wiki: 2.5.0 installed, ~2.5 required.
Verify[edit]
Check the "Special:Version" page on your wiki and verify that the extension has been successfully installed and enabled.
Test your installation as described on the help page about testing Semantic MediaWiki.