Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve the release script for versionning
Signed-off-by: William Desportes <williamdes@wdes.fr> Improve the version handling Signed-off-by: William Desportes <williamdes@wdes.fr> Simplify the version handling Signed-off-by: William Desportes <williamdes@wdes.fr>
- Loading branch information
1 parent
f3cf7d7
commit f28fbe0
Showing
5 changed files
with
112 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace PhpMyAdmin; | ||
|
||
use function defined; | ||
|
||
/** | ||
* Class to handle the phpMyAdmin version | ||
*/ | ||
final class Version | ||
{ | ||
/* | ||
* Packaging people can add a version suffix using the VERSION_SUFFIX constant at vendor_config.php | ||
*/ | ||
|
||
public const VERSION_MAJOR = 5; | ||
public const VERSION_MINOR = 1; | ||
public const VERSION_PATCH = 0; | ||
|
||
// The version will be {major}.{minor}.{patch}-dev | ||
public const IS_DEV = true; | ||
|
||
// The version will be {major}.{minor}.{patch}-{PRE_RELEASE_NAME} if not empty | ||
public const PRE_RELEASE_NAME = ''; | ||
|
||
/** | ||
* Get the current phpMyAdmin series version | ||
* | ||
* @example 5.1 | ||
*/ | ||
public static function phpMyAdminSeriesVersion(): string | ||
{ | ||
return self::VERSION_MAJOR . '.' . self::VERSION_MINOR; | ||
} | ||
|
||
/** | ||
* Get the current phpMyAdmin version | ||
*/ | ||
public static function phpMyAdminVersion(): string | ||
{ | ||
$versionRaw = self::VERSION_MAJOR . '.' . self::VERSION_MINOR . '.' . self::VERSION_PATCH; | ||
|
||
if (self::IS_DEV) { | ||
return $versionRaw . '-dev'; | ||
} | ||
|
||
if (self::PRE_RELEASE_NAME !== '') { | ||
return $versionRaw . '-' . self::PRE_RELEASE_NAME; | ||
} | ||
|
||
if (defined('VERSION_SUFFIX')) { | ||
return $versionRaw . VERSION_SUFFIX; | ||
} | ||
|
||
return $versionRaw; | ||
} | ||
|
||
/** | ||
* If the current version is a dev version | ||
*/ | ||
public static function isDev(): bool | ||
{ | ||
return self::IS_DEV; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,3 +20,5 @@ parameters: | |
- tmp/* | ||
- twig-templates/* | ||
- vendor/* | ||
dynamicConstantNames: | ||
- VERSION_SUFFIX |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters