Extension:SemanticVersion
Appearance
![]() Release status: stable |
|
---|---|
Author(s) | Samantha Nguyen |
Latest version | 1.0.0 |
MediaWiki | >= 1.35.0 |
License | MIT License |
Download | |
Translate the SemanticVersion extension if it is available at translatewiki.net | |
SemanticVersion provides a parser function via {{#semver}}
that allows comparing 2 different semantic versions.
Installation
[edit]- Download and move the extracted
SemanticVersion
folder to yourextensions/
directory.
Developers and code contributors should install the extension from Git instead, using:cd extensions/ git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/SemanticVersion
- Only when installing from Git, run Composer to install PHP dependencies, by issuing
composer install --no-dev
in the extension directory. (See T173141 for potential complications.) - Add the following code at the bottom of your LocalSettings.php file:
wfLoadExtension( 'SemanticVersion' );
Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.
Usage
[edit]The magic word syntax is as follows:
- {{#semver:<operator>|<version1>|<version2>}}
Operators
[edit]Operator | Acceptable values |
---|---|
Less than | < , lt
|
Less than or equal | <= , le
|
Greater than | > , gt
|
Greater than or equal | >= , ge
|
Equal | = , == , eq
|
Not equal | != , ne
|