VersionNumberUtility

Class with helper functions for version number handling

Table of Contents

Methods

convertVersionNumberToInteger()  : int
Returns an integer from a three part version number, eg '4.12.3' -> 4012003
convertVersionsStringToVersionNumbers()  : array<string|int, mixed>
This function converts version range strings (like '4.2.0-4.4.99') to an array (like array('4.2.0', '4.4.99'). It also forces each version part to be between 0 and 999
convertVersionStringToArray()  : array<string|int, mixed>
Parses the version number x.x.x and returns an array with the various parts.
getCurrentTypo3Version()  : string
Wrapper function for TYPO3_version constant to make functions using the constant unit testable
getNumericTypo3Version()  : string
Removes -dev -alpha -beta -RC states (also without '-' prefix) from a version number and replaces them by .0 and normalizes to a three part version number

Methods

convertVersionNumberToInteger()

Returns an integer from a three part version number, eg '4.12.3' -> 4012003

public static convertVersionNumberToInteger(string $versionNumber) : int
Parameters
$versionNumber : string

Version number on format x.x.x

Return values
int

Integer version of version number (where each part can count to 999)

convertVersionsStringToVersionNumbers()

This function converts version range strings (like '4.2.0-4.4.99') to an array (like array('4.2.0', '4.4.99'). It also forces each version part to be between 0 and 999

public static convertVersionsStringToVersionNumbers(string $versionsString) : array<string|int, mixed>
Parameters
$versionsString : string
Return values
array<string|int, mixed>

convertVersionStringToArray()

Parses the version number x.x.x and returns an array with the various parts.

public static convertVersionStringToArray(string $version) : array<string|int, mixed>

It also forces each … 0 to 999

Parameters
$version : string

Version code, x.x.x

Return values
array<string|int, mixed>

getCurrentTypo3Version()

Wrapper function for TYPO3_version constant to make functions using the constant unit testable

public static getCurrentTypo3Version() : string
Return values
string

getNumericTypo3Version()

Removes -dev -alpha -beta -RC states (also without '-' prefix) from a version number and replaces them by .0 and normalizes to a three part version number

public static getNumericTypo3Version() : string
Return values
string

        
On this page

Search results