rex_version
in package
Tags
Table of Contents
Methods
- compare() : bool
- Compares two version number strings.
- gitHash() : string|null
- Returns the current git version hash for the given path.
- isUnstable() : bool
- matchesConstraints() : bool
- Checks the version of the requirement.
- split() : array<int, string>
- Splits a version string into its parts.
Methods
compare()
Compares two version number strings.
public
static compare(string $version1, string $version2[, "="|"=="|"!="|"<>"|"<"|"<="|">"|">="|null $comparator = '<' ]) : bool
In contrast to version_compare() it treats "1.0" and "1.0.0" as equal and it supports a space as separator for the version parts, e.g. "1.0 beta1"
Parameters
- $version1 : string
-
First version number
- $version2 : string
-
Second version number
- $comparator : "="|"=="|"!="|"<>"|"<"|"<="|">"|">="|null = '<'
-
Optional comparator
Tags
Return values
boolgitHash()
Returns the current git version hash for the given path.
public
static gitHash(string $path[, string|null $repo = null ]) : string|null
Parameters
- $path : string
-
A local filesystem path
- $repo : string|null = null
-
If given, the version hash is returned only if the remote repository matches the given github repo (e.g.
redaxo/redaxo
)
Return values
string|nullisUnstable()
public
static isUnstable(string $version) : bool
Parameters
- $version : string
Return values
boolmatchesConstraints()
Checks the version of the requirement.
public
static matchesConstraints(string $version, string $constraints) : bool
Parameters
- $version : string
-
Version
- $constraints : string
-
Constraint list, separated by comma
Tags
Return values
boolsplit()
Splits a version string into its parts.
public
static split(string $version) : array<int, string>
Parameters
- $version : string