Another interesting point I found, not sure if it should be considered a bug or a feature:
$version = 2.0;
print version_compare($version, '2.0');
# outputs -1 (version is less than version 2
$version = (string) $version;
# casts to "2"
print version_compare($version, '2.0');
# outputs -1
$version = '2.0';
print version_compare($version, '2.0');
# outputs 0 (versions are equal)
So should we expect strings like "2.4.1" in the future, we need a string like '2.0' to parse this early version now. Or we can treat these as floats, and just do "$version >= 2". I really need an answer before finishing off the 2.x support via the countries module
With these minor changes, the integration with the Countries module is complete as per the latest development version. I'm using a function_exists check for version comparison until the version string type is sorted.
I would recommend the string version, version_compare() usage is the defacto standard.
I just noticed that the project page states that version 2.x is recommended but the project settings are suggesting that 1.x (green download) should be used over 2.x (yellow download).
This is set in the admin release bit as the "Recommended major version"
Comments
Comment #1
Scyther commentedWorking on geting out a alpha/beta/rc/stable release for 6.x-2.x with in the next week. Then I will start to port the 2.x version to Drupal 7.
Comment #2
Scyther commentedDevelopment release is now avalible. Only testing left until a release will be out.
Comment #3
alan d. commentedI just noticed a typo, probably creating a bug:
Comment #4
Scyther commentedThat is correct Alan, thanks.
It has been commited to dev branch.
Comment #5
alan d. commentedAnother interesting point I found, not sure if it should be considered a bug or a feature:
So should we expect strings like "2.4.1" in the future, we need a string like '2.0' to parse this early version now. Or we can treat these as floats, and just do "$version >= 2". I really need an answer before finishing off the 2.x support via the countries module
Cheers
Comment #6
alan d. commentedAnother typo that produces minor warnings:
With these minor changes, the integration with the Countries module is complete as per the latest development version. I'm using a function_exists check for version comparison until the version string type is sorted.
I would recommend the string version, version_compare() usage is the defacto standard.
Comment #7
Scyther commented@ comment #6
Notice that before and it was fixed in the commit with the other typo.
Comment #8
Scyther commented' ' has now been added around the version number in countryicons_api_version().
Commited to dev branch: http://drupalcode.org/project/countryicons.git/commit/c99249c
Comment #9
Scyther commentedComment #10
Scyther commented7.x-2.0-beta1 is now out.
Comment #11
johnvComment #12
Scyther commentedPlease let me change status when I think this is fixed!
Comment #13
johnvsorry.
Comment #14
alan d. commentedI just noticed that the project page states that version 2.x is recommended but the project settings are suggesting that 1.x (green download) should be used over 2.x (yellow download).
This is set in the admin release bit as the "Recommended major version"
Comment #15
Scyther commentedFixed Alan D.
Comment #16
johnvNow that you're on it:
if you don't plan to work on the 1.x versions anymore, it is possible to remove the -1.x-dev versions from the list, too.
Comment #17
Scyther commentedDone
Comment #18
Scyther commentedAs I can see, this is #2149699: Use file_create_url() in countryicons_get_icon_url(). the blocker for a stable 7.x-2.0 release. Anyone that could help test this, so we can get a new release out?