pakled / vernum
Library that helps creating, editing, sorting and comparing semantic version numbers
v0.1.1
2014-02-04 07:54 UTC
Requires
- php: >=5.4.0
Requires (Dev)
- phpunit/phpunit: 3.7.29
This package is not auto-updated.
Last update: 2026-03-14 23:14:20 UTC
README
Library that helps creating, editing, sorting and comparing semantic version numbers
Getting Started
System Requirements
You need PHP >= 5.4.0.
Installation
You may install the Vernum Component with Composer (recommended) or manually.
-
Download the
composer.pharexecutable or use the installer.$ curl -s https://getcomposer.org/installer | php -
Create a composer.json defining your dependencies.
{ "require": { "pakled/vernum": "dev-master" } } -
Run Composer:
php composer.phar install
Usage
use Vernum\Parser; use Vernum\Version; $parsedVersion = Parser::parse("1.0.2-dev"); $version = new Version( $parsedVersion['major'], $parsedVersion['minor'], $parsedVersion['patch'], $parsedVersion['labels'] ); echo $version->getMajor(); echo $version->getMinor(); echo $version->getPatch();
License
Vernum is licensed under the MIT license.