Skip to content

Commit

Permalink
Improve release script and update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
oschwald committed Jun 16, 2015
1 parent 43a6ec0 commit 18a5a22
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 15 deletions.
7 changes: 2 additions & 5 deletions README.md
Expand Up @@ -301,12 +301,9 @@ to the client API, please see
## Requirements ##

This code requires PHP 5.3 or greater. Older versions of PHP are not
supported.
supported. This library works and is tested with HHVM.

This library works and is tested with HHVM.

This library also relies on the [Guzzle3 HTTP client](https://github.com/guzzle/guzzle3)
and the [MaxMind DB Reader](https://github.com/maxmind/MaxMind-DB-Reader-php).
This library also relies on the [MaxMind DB Reader](https://github.com/maxmind/MaxMind-DB-Reader-php).

If you are using PHP 5.3 with an autoloader besides Composer, you must load
`JsonSerializable.php` in the `compat` directory.
Expand Down
16 changes: 11 additions & 5 deletions dev-bin/release.sh
Expand Up @@ -2,12 +2,16 @@

set -e

TAG=$1
VERSION=$(perl -MFile::Slurp::Tiny=read_file -MDateTime <<EOF
use v5.16;
my \$log = read_file(q{CHANGELOG.md});
\$log =~ /\n(\d+\.\d+\.\d+) \((\d{4}-\d{2}-\d{2})\)\n/;
die 'Release time is not today!' unless DateTime->now->ymd eq \$2;
say \$1;
EOF
)

if [ -z $TAG ]; then
echo "Please specify a tag"
exit 1
fi
TAG="v$VERSION"

if [ -f geoip2.phar ]; then
rm geoip2.phar
Expand All @@ -25,6 +29,8 @@ fi
php composer.phar self-update
php composer.phar update --no-dev

perl -pi -e "s/(?<=const VERSION = ').+?(?=';)/$TAG/g" src/WebService/Client.php

if [ ! -f box.phar ]; then
wget -O box.phar "https://github.com/box-project/box2/releases/download/2.5.0/box-2.5.0.phar"
fi
Expand Down
5 changes: 0 additions & 5 deletions src/WebService/Client.php
Expand Up @@ -48,7 +48,6 @@ class Client implements ProviderInterface
private $client;
private static $basePath = '/geoip/v2.1';

// XXX - don't merge until release script automatically updates this
const VERSION = 'v2.2.0-alpha';

/**
Expand All @@ -62,10 +61,6 @@ class Client implements ProviderInterface
* * `host` - The host to use when querying the web service.
* * `timeout` - Timeout in seconds.
* * `connectTimeout` - Initial connection timeout in seconds.
* @param object $guzzleClient Optional Guzzle client to use (to facilitate
* unit testing).
* @param string $timeout Total transaction timeout in seconds
* @param string $connectTimeout Initial connection timeout in seconds
*/
public function __construct(
$userId,
Expand Down

0 comments on commit 18a5a22

Please sign in to comment.