mirror of
https://github.com/Mibew/mibew.git
synced 2025-03-03 18:38:31 +03:00
Recognize alpha and rc versions in updates names
This commit is contained in:
parent
80f5873d9a
commit
e2d4ab3715
@ -100,7 +100,7 @@ class Updater
|
||||
{
|
||||
$current_version = $this->getDatabaseVersion();
|
||||
|
||||
if (!preg_match("/^([0-9]{1,2}\.){2}[0-9]{1,2}(-beta\.[0-9]+)?$/", $current_version)) {
|
||||
if (!preg_match("/^([0-9]{1,2}\.){2}[0-9]{1,2}(-(alpha|beta|rc)\.[0-9]+)?$/", $current_version)) {
|
||||
$this->errors[] = getlocal(
|
||||
'The current version ({0}) is unknown or wrong formated',
|
||||
array($current_version)
|
||||
|
@ -64,11 +64,11 @@ class Utils
|
||||
foreach ($container_reflection->getMethods() as $method_reflection) {
|
||||
// Filter update methods
|
||||
$name = $method_reflection->getName();
|
||||
if (preg_match("/^update([0-9]+)(?:Beta([0-9]+))?$/", $name, $matches)) {
|
||||
if (preg_match("/^update([0-9]+)(?:(Alpha|Beta|Rc)([0-9]+))?$/", $name, $matches)) {
|
||||
$version = self::formatVersionId($matches[1]);
|
||||
// Check if a beta version is defined.
|
||||
if (!empty($matches[2])) {
|
||||
$version .= '-beta.' . $matches[2];
|
||||
$version .= sprintf('-%s.%u', strtolower($matches[2]), $matches[3]);
|
||||
}
|
||||
|
||||
$updates[$version] = $name;
|
||||
|
Loading…
Reference in New Issue
Block a user