h4cc / hhvm-progress

Source of the hhvm.h4cc.de website.
http://hhvm.h4cc.de/
MIT License
8 stars 4 forks source link

Sorting of pre-release versions is wrong #55

Closed stof closed 9 years ago

stof commented 9 years ago

The package page is sorting versions in descending order, but pre-release versions are before the corresponding stable release while they should be after (they are lower versions)

hhvm_progress_prerelease_version

h4cc commented 9 years ago

I honestly dont know how to sort such versions always correctly. As far as i can see, even packagist simply orders by releasedAt instead of using versions for such:

https://github.com/composer/packagist/blob/cc2f686775c2e309cdc285632ee0cce596f87071/src/Packagist/WebBundle/Entity/VersionRepository.php#L86

My bad is now, that this timestamp releasedAt is currently not stored in the database. For such a change a need to update the database entries from packagist. This is what i will try then.

h4cc commented 9 years ago

Found another way, simply using PHP's version_compare():

http://php.net/manual/en/function.version-compare.php :four_leaf_clover:

h4cc commented 9 years ago

Fixed ist, looks far better now: http://hhvm.h4cc.de/package/behat/behat

Thanks! :+1: