16 Commits

Author SHA1 Message Date
Gregory Oschwald
9f0c743afd Prepare for 0.6.3 2014-05-12 10:53:20 -07:00
Gregory Oschwald
4e92cd0254 Fix for Phar path issue 2014-05-09 15:07:21 -07:00
Gregory Oschwald
d61ddda4ef Ignore phar 2014-05-08 15:30:59 -07:00
Gregory Oschwald
10ecb36d16 Prepare for 0.6.2 2014-05-08 15:30:23 -07:00
Gregory Oschwald
205483e14c Fix phar with new versions of Guzzle 2014-05-08 15:30:23 -07:00
Gregory Oschwald
6584b545ea Only run phpcs on 5.5. It is broken on 5.6 and hhvm. 2014-05-02 06:57:11 -07:00
Gregory Oschwald
ac6592b7a5 Wording tweak 2014-05-01 16:47:38 -07:00
Gregory Oschwald
cb9c024699 Prepare for 0.6.1 2014-05-01 07:20:30 -07:00
Gregory Oschwald
e014aadf8d Merge pull request #13 from Seldaek/patch-1
Target compat autoload rules more narrowly
2014-04-25 05:50:18 -07:00
Jordi Boggiano
a043336cae Target compat autoload rules more narrowly 2014-04-25 14:13:31 +02:00
Gregory Oschwald
0c9b774015 Updated submodule 2014-04-14 07:15:31 -07:00
Gregory Oschwald
38bacff692 Clean up box.json 2014-04-11 17:21:33 -07:00
Gregory Oschwald
5cfe1353bb Added doc about using phar 2014-04-11 16:18:14 -07:00
Gregory Oschwald
6715f848bb Add box.json for creating phar 2014-04-11 16:13:20 -07:00
Gregory Oschwald
56407eff17 Test HHVM and 5.6 2014-04-03 10:59:16 -07:00
Gregory Oschwald
9b2fa1bcd1 Added note about creating composer.json 2014-03-06 13:23:20 -08:00
8 changed files with 103 additions and 12 deletions

1
.gitignore vendored
View File

@@ -4,6 +4,7 @@ _site
composer.lock
composer.phar
phpunit.xml
geoip2.phar
geoip2-php.sublime-*
vendor/
*.sw?

View File

@@ -4,16 +4,18 @@ php:
- 5.3
- 5.4
- 5.5
- 5.6
- hhvm
before_install:
- composer self-update
- composer install --dev -n --prefer-source
- pyrus install pear/PHP_CodeSniffer
- if [ "5.5" == $TRAVIS_PHP_VERSION ]; then pyrus install pear/PHP_CodeSniffer; fi
- phpenv rehash
script:
- mkdir -p build/logs
- phpcs --standard=PSR2 src/
- if [ "5.5" == $TRAVIS_PHP_VERSION ]; then phpcs --standard=PSR2 src/; fi
- phpunit -c phpunit.xml.dist
after_script:

View File

@@ -1,6 +1,27 @@
CHANGELOG
=========
0.6.3 (2014-05-12)
------------------
* With the previous Phar builds, some users received `phar error: invalid url
or non-existent phar` errors. The correct alias is now used for the Phar,
and this should no longer be an issue.
0.6.2 (2014-05-08)
------------------
* The Phar build was broken with Guzzle 3.9.0+. This has been fixed.
0.6.1 (2014-05-01)
------------------
* This API now officially supports HHVM.
* The `maxmind-db/reader` dependency was updated to a version that does not
require BC Math.
* The Composer compatibility autoload rules are now targeted more narrowly.
* A `box.json` file is included to build a Phar package.
0.6.0 (2014-02-19)
------------------

View File

@@ -7,12 +7,13 @@ This package provides an API for the GeoIP2 [web services]
(http://dev.maxmind.com/geoip/geoip2/downloadable). The API also works with
the free [GeoLite2 databases](http://dev.maxmind.com/geoip/geoip2/geolite2/).
## Installation ##
## Install via Composer ##
### Define Your Dependencies ###
We recommend installing this package with [Composer](http://getcomposer.org/).
To do this, add `geoip2/geoip2` to your `composer.json` file.
To do this, add `geoip2/geoip2` to your `composer.json` file. If you don't
have a `composer.json` file, create one in the root directory of your project.
```json
{
@@ -45,7 +46,20 @@ You can autoload all dependencies by adding this to your code:
require 'vendor/autoload.php';
```
### Optional C Extension ###
## Installing via Phar ##
Although we strongly recommend using Composer, we also provide a
[phar archive](http://php.net/manual/en/book.phar.php) containing all of the
dependencies for GeoIP2. Our latest phar archive is available on
[our releases page](https://github.com/maxmind/GeoIP2-php/releases).
To use the archive, just require it from your script:
```php
require 'geoip2.phar';
```
## Optional C Extension ##
The [MaxMind DB API](https://github.com/maxmind/MaxMind-DB-Reader-php)
includes an optional C extension that you may install to dramatically increase
@@ -68,7 +82,7 @@ classes for the different parts of the data such as the city in which the
IP address is located.
If the record is not found, a `\GeoIp2\Exception\AddressNotFoundException`
is returned. If the database is invalid or corrupt, a
is thrown. If the database is invalid or corrupt, a
`\MaxMind\Db\InvalidDatabaseException` will be thrown.
See the API documentation for more details.
@@ -220,6 +234,8 @@ to the client API, please see
This code requires PHP 5.3 or greater. Older versions of PHP are not
supported.
This library works and is tested with HHVM.
This library also relies on the [Guzzle HTTP client](http://guzzlephp.org/)
and the [MaxMind DB Reader](https://github.com/maxmind/MaxMind-DB-Reader-php).
@@ -234,7 +250,7 @@ The GeoIP2 PHP API uses [Semantic Versioning](http://semver.org/).
## Copyright and License ##
This software is Copyright (c) 2013 by MaxMind, Inc.
This software is Copyright (c) 2014 by MaxMind, Inc.
This is free software, licensed under the Apache License, Version 2.0.

34
box.json Normal file
View File

@@ -0,0 +1,34 @@
{
"alias": "geoip2.phar",
"main": "phar-stub.php",
"output": "geoip2.phar",
"compactors": [
"Herrera\\Box\\Compactor\\Composer",
"Herrera\\Box\\Compactor\\Json",
"Herrera\\Box\\Compactor\\Php"
],
"files": [
"LICENSE"
],
"finder": [
{
"name": [
"*.php",
"*.pem",
"*.pem.md5"
],
"exclude": [
"phpunit",
"satooshi",
"Tests",
"tests",
"yaml"
],
"in": "vendor"
}
],
"directories": ["compat", "src/"],
"git-version": "git-version",
"stub": true
}

View File

@@ -1,7 +1,7 @@
{
"name": "geoip2/geoip2",
"description": "MaxMind GeoIP2 PHP API",
"keywords": [ "geoip", "geolocation", "maxmind" ],
"keywords": ["geoip", "geoip2", "geolocation", "ip", "maxmind"],
"homepage": "https://github.com/maxmind/GeoIP2-php",
"type": "library",
"license": "Apache-2.0",
@@ -14,7 +14,7 @@
],
"require": {
"guzzle/guzzle": "3.*",
"maxmind-db/reader": "0.3.*",
"maxmind-db/reader": "~0.3.1",
"php": ">=5.3.1"
},
"require-dev": {
@@ -24,7 +24,7 @@
"autoload": {
"psr-0": {
"GeoIp2": "src/",
"" : "compat/"
"JsonSerializable": "compat/"
}
}
}

17
phar-stub.php Normal file
View File

@@ -0,0 +1,17 @@
<?php
require_once 'phar://geoip2.phar/vendor/autoload.php';
// The following was taken from Guzzle (MIT license)
// Copy the cacert.pem file from the phar if it is not in the temp folder.
$from = 'phar://geoip2.phar/vendor/guzzle/guzzle/src/Guzzle/Http/Resources/cacert.pem';
$certFile = sys_get_temp_dir() . '/guzzle-cacert.pem';
// Only copy when the file size is different
if (!file_exists($certFile) || filesize($certFile) != filesize($from)) {
if (!copy($from, $certFile)) {
throw new RuntimeException("Could not copy {$from} to {$certFile}: "
. var_export(error_get_last(), true));
}
}