Version
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
Whether this release is a stable one.
Compares a semantic version (x.y.z) against Bolt's version, given a specified comparison operator.
Returns a version formatted for composer.
No description
No description
No description
Determine the "install type": Whether we're currently running a direct git clone, a composer install project, or a packaged distribution.
No description
Details
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.
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.
static string
forComposer()
Returns a version formatted for composer.
static string
fullName()
static string
codeName()
static string|null
name()
static string
installType()
Determine the "install type": Whether we're currently running a direct git clone, a composer install project, or a packaged distribution.