Extension:SemanticVersion
![]() Release status: stableCategory:Stable extensions |
|
---|---|
Author(s) | Samantha Nguyen |
Latest version | 1.0.0 |
MediaWiki | Category:Extensions without MediaWiki version |
License | MIT License |
Download | Category:Extensions in Wikimedia version control |
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
- 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.)Category:Extensions requiring Composer with git - 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
The magic word syntax is as follows:
- {{#semver:<operator>|<version1>|<version2>}}
Operators
Operator | Acceptable values |
---|---|
Less than | < , lt |
Less than or equal | <= , le |
Greater than | > , gt |
Greater than or equal | >= , ge |
Equal | = , == , eq |
Not equal | != , ne |
Category:All extensions
Category:Extensions in Wikimedia version control
Category:Extensions requiring Composer with git
Category:Extensions with invalid or missing type
Category:Extensions without MediaWiki version
Category:Extensions without a compatibility policy
Category:Extensions without an image
Category:MIT licensed extensions
Category:ParserFirstCallInit extensions
Category:Stable extensions