Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
543a8c07d0 | ||
|
|
0ce625f29a | ||
|
|
cb9c024699 | ||
|
|
e014aadf8d | ||
|
|
a043336cae | ||
|
|
0c9b774015 | ||
|
|
38bacff692 | ||
|
|
5cfe1353bb | ||
|
|
6715f848bb | ||
|
|
56407eff17 | ||
|
|
9b2fa1bcd1 |
@@ -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 [ "hhvm" != "$(phpenv version-name)" ]; then pyrus install pear/PHP_CodeSniffer; fi
|
||||
- phpenv rehash
|
||||
|
||||
script:
|
||||
- mkdir -p build/logs
|
||||
- phpcs --standard=PSR2 src/
|
||||
- if [ "hhvm" != "$(phpenv version-name)" ]; then phpcs --standard=PSR2 src/; fi
|
||||
- phpunit -c phpunit.xml.dist
|
||||
|
||||
after_script:
|
||||
|
||||
14
CHANGELOG.md
14
CHANGELOG.md
@@ -1,6 +1,20 @@
|
||||
CHANGELOG
|
||||
=========
|
||||
|
||||
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)
|
||||
------------------
|
||||
|
||||
|
||||
24
README.md
24
README.md
@@ -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
|
||||
@@ -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.
|
||||
|
||||
|
||||
33
box.json
Normal file
33
box.json
Normal file
@@ -0,0 +1,33 @@
|
||||
{
|
||||
"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
|
||||
}
|
||||
@@ -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/"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Submodule maxmind-db updated: f7b9342b84...f887fec99e
17
phar-stub.php
Normal file
17
phar-stub.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
require_once '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));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user