VersionStatic
in package
Encapsulates a version number string and allows for comparison to other version numbers.
Only numeric semantic version numbers are supported.
- If any part of the version number has a suffix then the suffix is ignored.
- If any part of the version number does not start with a digit then it is treated as zero value.
Tags
Table of Contents
- MAX_PARTS = "mP"
- VERSION = "v"
- VERSION_PARTS = "vP"
- $DELIM : mixed
- compare() : mixed
- update() : mixed
- versionFromComponent() : mixed
- versionFromString() : mixed
- createVersionParts() : mixed
- Convert a version string to an array of integer parts for easier comparison.
Constants
MAX_PARTS
public
mixed
MAX_PARTS
= "mP"
VERSION
public
mixed
VERSION
= "v"
VERSION_PARTS
public
mixed
VERSION_PARTS
= "vP"
Properties
$DELIM
private
static mixed
$DELIM
= '.'
Methods
compare()
public
static compare(mixed $versionArray1, mixed $versionArray2) : mixed
Parameters
- $versionArray1 : mixed
- $versionArray2 : mixed
Return values
mixed —update()
public
static update(mixed &$versionArray, mixed $maxParts) : mixed
Parameters
- $versionArray : mixed
- $maxParts : mixed
Return values
mixed —versionFromComponent()
public
static versionFromComponent(mixed $version[, mixed $maxParts = null ]) : mixed
Parameters
- $version : mixed
- $maxParts : mixed = null
Return values
mixed —versionFromString()
public
static versionFromString(mixed $versionString) : mixed
Parameters
- $versionString : mixed
Return values
mixed —createVersionParts()
Convert a version string to an array of integer parts for easier comparison.
private
static createVersionParts(mixed $versionArray) : mixed
Parameters
- $versionArray : mixed