class Version (View source)

Bolt's current version.

Constants

VERSION

Bolt's version constant.

This should take the form of: x.y.z [[alpha|beta|RC|patch] n]

e.g. versions for: Stable — 3.0.0 Development — 3.1.0 alpha 1

CODENAME

Methods

static bool
isStable()

Whether this release is a stable one.

static bool
compare(string $version, string $operator)

Compares a semantic version (x.y.z) against Bolt's version, given a specified comparison operator.

static string
forComposer()

Returns a version formatted for composer.

static string
fullName()

No description

static string
codeName()

No description

static string|null
name()

No description

static string
installType()

Determine the "install type": Whether we're currently running a direct git clone, a composer install project, or a packaged distribution.

static string
getSymfonyVersion()

No description

Details

static bool isStable()

Whether this release is a stable one.

Return Value

bool

static bool compare(string $version, string $operator)

Compares a semantic version (x.y.z) against Bolt's version, given a specified comparison operator.

Note 1: Be sure to include the .z number in the version given, as omitting it can give inconsistent results.

e.g. If the version of Bolt was '3.2.0' (or greater), then: Version::compare('3.2', '>='); is NOT equal to, or greater than, Bolt's version.

Note 2: Pre-release versions, such as 3.2.0-beta1, are considered lower than their final release counterparts (like 2.3.0). As you may notice, the difference being that Bolt '3.2.0-beta1' is considered LOWER than the compare($version) value of '3.2.0'.

e.g. If the version of Bolt was '3.2.0 beta 1', then: Version::compare('3.2.0', '>='); is equal to, or greater than, Bolt's version.

Parameters

string $version the version to compare
string $operator the comparison operator: <, <=, >, >=, ==, !=

Return Value

bool whether the comparison succeeded

See also

http://semver.org/ For an explanation on semantic versioning.
http://php.net/manual/en/function.version-compare.php#refsect1-function.version-compare-notes Notes on version_compare

static string forComposer()

Returns a version formatted for composer.

Return Value

string

static string fullName()

Return Value

string

static string codeName()

Return Value

string

static string|null name()

Return Value

string|null

static string installType()

Determine the "install type": Whether we're currently running a direct git clone, a composer install project, or a packaged distribution.

Return Value

string

static string getSymfonyVersion()

Return Value

string