Skip to content

Commit

Permalink
Require extension and package versions to match
Browse files Browse the repository at this point in the history
Closes #97
  • Loading branch information
oschwald committed Dec 18, 2019
1 parent 0653682 commit 256f83b
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)
------------------
Expand Down
3 changes: 3 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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.*",
Expand Down
14 changes: 11 additions & 3 deletions dev-bin/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 256f83b

Please sign in to comment.