Verified Commit fb9ef98f authored by noplanman's avatar noplanman

Simplify getting the latest version number.

parent 5a310048
......@@ -14,18 +14,16 @@ function human_filesize($bytes, $decimals = 2)
return sprintf("%.{$decimals}f", $bytes / pow(1024, $factor)) . $suff;
}
$versions = [];
$files = [];
$files = [];
foreach ($_files as $file) {
$versions[] = $file->version;
$files[$file->name] = $file;
}
uasort($files, static function ($a, $b) {
return version_compare($b->version, $a->version);
});
usort($versions, 'version_compare');
$stable = array_pop($versions);
// Get the latest version number.
$stable = reset($files)->version;
$binaries = [];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment