dont update newer versions

This commit is contained in:
Denis Duliçi
2022-03-02 12:02:34 +03:00
parent 2c86535d44
commit ea4a968f0f
3 changed files with 20 additions and 8 deletions

View File

@@ -157,4 +157,19 @@ class Versions
return $updates;
}
public static function shouldUpdate($listener_version, $old_version, $new_version): bool
{
// Don't update if "listener" is same or lower than "old" version
if (version_compare($listener_version, $old_version, '<=')) {
return false;
}
// Don't update if "listener" is higher than "new" version
if (version_compare($listener_version, $new_version, '>')) {
return false;
}
return true;
}
}