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, string>
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|string>
Parses the version number x.x.x and returns an array with the various parts.
getCurrentTypo3Version()  : string
Wrapper function for the static TYPO3 version 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, string>
Parameters
$versionsString : string

A string in the form 'x.x.x-y.y.y'

Return values
array<string|int, string>

convertVersionStringToArray()

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

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

It also forces each … 0 to 999

Parameters
$version : string

Version string, in the format x.x.x

Return values
array<string, int|string>

getCurrentTypo3Version()

Wrapper function for the static TYPO3 version 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