From 256f83b65a4a2f1d5164bf995fa6f452c9abc426 Mon Sep 17 00:00:00 2001 From: Gregory Oschwald Date: Wed, 18 Dec 2019 14:31:19 -0800 Subject: [PATCH] Require extension and package versions to match Closes #97 --- CHANGELOG.md | 5 ++++- composer.json | 3 +++ dev-bin/release.sh | 14 +++++++++++--- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b355548..e6a803b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,12 +1,15 @@ CHANGELOG ========= -1.5.2 +1.6.0 ------------------ * 1.5.0 and 1.5.1 contained a possible memory corruptions when using `getWithPrefixLen`. This has been fixed. Reported by proton-ab. GitHub #96. +* The `composer.json` file now conflicts with all versions of the + `maxminddb` C extension that do not match the Composer version. + Based on a pull request by BenoƮt Burnichon. GitHub #97. 1.5.1 (2019-12-12) ------------------ diff --git a/composer.json b/composer.json index 4ddcc36..41ca030 100644 --- a/composer.json +++ b/composer.json @@ -20,6 +20,9 @@ "ext-gmp": "bcmath or gmp is required for decoding larger integers with the pure PHP decoder", "ext-maxminddb": "A C-based database decoder that provides significantly faster lookups" }, + "conflict": { + "ext-maxminddb": "<1.5.1,>1.5.1" + }, "require-dev": { "friendsofphp/php-cs-fixer": "2.*", "phpunit/phpunit": "5.*", diff --git a/dev-bin/release.sh b/dev-bin/release.sh index 1aba8ec..5d5bb0a 100755 --- a/dev-bin/release.sh +++ b/dev-bin/release.sh @@ -31,11 +31,19 @@ tag="v$version" rm -fr vendor perl -pi -e "s/(?<=#define PHP_MAXMINDDB_VERSION \")\d+\.\d+\.\d+(?=\")/$version/" ext/php_maxminddb.h +perl -pi -e "s/(?<=\"ext-maxminddb\": \")<\d+.\d+.\d+,>\d+.\d+.\d+(?=\")/<$version,>$version/" composer.json -php composer.phar self-update -php composer.phar update +pushd ext +phpize +./configure +make +popd -./vendor/bin/phpunit +php -n -dextension=ext/modules/maxminddb.so composer.phar self-update +php -n -dextension=ext/modules/maxminddb.so composer.phar update + +php -n -dextension=ext/modules/maxminddb.so ./vendor/bin/phpunit +php -n ./vendor/bin/phpunit echo $'\nDiff:' git diff