5 Commits

Author SHA1 Message Date
Gregory Oschwald
c58034524e Prepare for 2.0.0 2014-09-22 10:49:45 -07:00
Gregory Oschwald
94f4f9d5e6 Prepare for 0.9.0 2014-09-15 10:16:20 -07:00
Gregory Oschwald
dac9e94304 Fix redundancy in text 2014-09-15 10:15:25 -07:00
Dave Rolsky
51e2f84d07 Merge pull request #25 from maxmind/greg/remove-deprecated-methods
Remove deprecated web service methods
2014-09-15 11:18:58 -05:00
Gregory Oschwald
42efc47796 Remove deprecated web service methods 2014-09-15 10:39:33 -05:00
5 changed files with 27 additions and 89 deletions

View File

@@ -1,18 +1,29 @@
CHANGELOG CHANGELOG
========= =========
2.0.0 (2014-09-22)
------------------
* First production release.
0.9.0 (2014-09-15)
------------------
* IMPORTANT: The deprecated `omni()` and `cityIspOrg()` methods have been
removed from `GeoIp2\WebService\Client`.
0.8.1 (2014-09-12) 0.8.1 (2014-09-12)
------------------ ------------------
* The check added to the `GeoIP2\Database\Reader` lookup methods in 0.8.0 did * The check added to the `GeoIP2\Database\Reader` lookup methods in 0.8.0 did
not work with the GeoIP2 City Database Subset by Continent with World not work with the GeoIP2 City Database Subset by Continent with World
Countries databases. This has been fixed. Fixes GitHub issue #23. Countries. This has been fixed. Fixes GitHub issue #23.
0.8.0 (2014-09-10) 0.8.0 (2014-09-10)
------------------ ------------------
* The `GeoIP2\Database\Reader` lookup methods (e.g., `city()`, `isp()`) now * The `GeoIp2\Database\Reader` lookup methods (e.g., `city()`, `isp()`) now
throw an `BadMethodCallException` if they are used with a database that throw a `BadMethodCallException` if they are used with a database that
does not match the method. In particular, doing a `city()` lookup on a does not match the method. In particular, doing a `city()` lookup on a
GeoIP2 Country database will result in an exception, and vice versa. GeoIP2 Country database will result in an exception, and vice versa.
* A `metadata()` method has been added to the `GeoIP2\Database\Reader` class. * A `metadata()` method has been added to the `GeoIP2\Database\Reader` class.
@@ -25,7 +36,7 @@ CHANGELOG
* The web service client API has been updated for the v2.1 release of the web * The web service client API has been updated for the v2.1 release of the web
service. In particular, the `cityIspOrg` and `omni` methods on service. In particular, the `cityIspOrg` and `omni` methods on
`GeoIP2\WebService\Client` should be considered deprecated. The `city` `GeoIp2\WebService\Client` should be considered deprecated. The `city`
method now provides all of the data formerly provided by `cityIspOrg`, and method now provides all of the data formerly provided by `cityIspOrg`, and
the `omni` method has been replaced by the `insights` method. the `omni` method has been replaced by the `insights` method.
* Support was added for GeoIP2 Connection Type, Domain and ISP databases. * Support was added for GeoIP2 Connection Type, Domain and ISP databases.

View File

@@ -26,7 +26,7 @@ You should now have the file `composer.phar` in your project directory.
Run in your project root: Run in your project root:
``` ```
php composer.phar require geoip2/geoip2:~0.8.1 php composer.phar require geoip2/geoip2:~2.0
``` ```
You should now have the files `composer.json` and `composer.lock` as well as You should now have the files `composer.json` and `composer.lock` as well as

View File

@@ -14,13 +14,13 @@
], ],
"require": { "require": {
"guzzle/guzzle": "3.*", "guzzle/guzzle": "3.*",
"maxmind-db/reader": "~0.3.2", "maxmind-db/reader": "~1.0",
"php": ">=5.3.1" "php": ">=5.3.1"
}, },
"require-dev": { "require-dev": {
"apigen/apigen": "~2.8.0", "apigen/apigen": "~2.8.0",
"nette/nette": "~2.1.3", "nette/nette": "~2.1.3",
"phpunit/phpunit": "4.1.*", "phpunit/phpunit": "4.2.*",
"satooshi/php-coveralls": "dev-master" "satooshi/php-coveralls": "dev-master"
}, },
"autoload": { "autoload": {

View File

@@ -111,40 +111,6 @@ class Client implements ProviderInterface
return $this->responseFor('city', 'City', $ipAddress); return $this->responseFor('city', 'City', $ipAddress);
} }
/**
* This method calls the GeoIP2 Precision: City endpoint.
*
* @param string $ipAddress IPv4 or IPv6 address as a string. If no
* address is provided, the address that the web service is called
* from will be used.
*
* @return \GeoIp2\Model\City
*
* @throws \GeoIp2\Exception\AddressNotFoundException if the address you
* provided is not in our database (e.g., a private address).
* @throws \GeoIp2\Exception\AuthenticationException if there is a problem
* with the user ID or license key that you provided.
* @throws \GeoIp2\Exception\OutOfQueriesException if your account is out
* of queries.
* @throws \GeoIp2\Exception\InvalidRequestException} if your request was
* received by the web service but is invalid for some other reason.
* This may indicate an issue with this API. Please report the error to
* MaxMind.
* @throws \GeoIp2\Exception\HttpException if an unexpected HTTP error
* code or message was returned. This could indicate a problem with the
* connection between your server and the web service or that the web
* service returned an invalid document or 500 error code.
* @throws \GeoIp2\Exception\GeoIp2Exception This serves as the parent
* class to the above exceptions. It will be thrown directly if a 200
* status code is returned but the body is invalid.
*
* @deprecated deprecated since version 0.7.0
*/
public function cityIspOrg($ipAddress = 'me')
{
return $this->city($ipAddress);
}
/** /**
* This method calls the GeoIP2 Precision: Country endpoint. * This method calls the GeoIP2 Precision: Country endpoint.
* *
@@ -203,48 +169,12 @@ class Client implements ProviderInterface
* @throws \GeoIp2\Exception\GeoIp2Exception This serves as the parent * @throws \GeoIp2\Exception\GeoIp2Exception This serves as the parent
* class to the above exceptions. It will be thrown directly if a 200 * class to the above exceptions. It will be thrown directly if a 200
* status code is returned but the body is invalid. * status code is returned but the body is invalid.
*
* @deprecated deprecated since version 0.7.0
*/ */
public function insights($ipAddress = 'me') public function insights($ipAddress = 'me')
{ {
return $this->responseFor('insights', 'Insights', $ipAddress); return $this->responseFor('insights', 'Insights', $ipAddress);
} }
/**
* This method calls the GeoIP2 Precision: Insights (prev. Omni) endpoint.
*
* @param string $ipAddress IPv4 or IPv6 address as a string. If no
* address is provided, the address that the web service is called
* from will be used.
*
* @return \GeoIp2\Model\Insights
*
* @throws \GeoIp2\Exception\AddressNotFoundException if the address you
* provided is not in our database (e.g., a private address).
* @throws \GeoIp2\Exception\AuthenticationException if there is a problem
* with the user ID or license key that you provided.
* @throws \GeoIp2\Exception\OutOfQueriesException if your account is out
* of queries.
* @throws \GeoIp2\Exception\InvalidRequestException} if your request was
* received by the web service but is invalid for some other reason.
* This may indicate an issue with this API. Please report the error to
* MaxMind.
* @throws \GeoIp2\Exception\HttpException if an unexpected HTTP error
* code or message was returned. This could indicate a problem with the
* connection between your server and the web service or that the web
* service returned an invalid document or 500 error code.
* @throws \GeoIp2\Exception\GeoIp2Exception This serves as the parent
* class to the above exceptions. It will be thrown directly if a 200
* status code is returned but the body is invalid.
*
* @deprecated deprecated since version 0.7.0
*/
public function omni($ipAddress = 'me')
{
return $this->insights($ipAddress);
}
private function responseFor($endpoint, $class, $ipAddress) private function responseFor($endpoint, $class, $ipAddress)
{ {
$uri = implode('/', array($this->baseUri(), $endpoint, $ipAddress)); $uri = implode('/', array($this->baseUri(), $endpoint, $ipAddress));

View File

@@ -201,19 +201,16 @@ class ClientTest extends \PHPUnit_Framework_TestCase
public function testInsights() public function testInsights()
{ {
$methods = array('omni', 'insights'); $record = $this->client($this->getResponse('1.2.3.4'))
foreach ($methods as $method) { ->insights('1.2.3.4');
$record = $this->client($this->getResponse('1.2.3.4'))
->$method('1.2.3.4');
$this->assertInstanceOf('GeoIp2\Model\Insights', $record); $this->assertInstanceOf('GeoIp2\Model\Insights', $record);
$this->assertEquals( $this->assertEquals(
42, 42,
$record->continent->geonameId, $record->continent->geonameId,
'continent geoname_id is 42' 'continent geoname_id is 42'
); );
}
} }
public function testCity() public function testCity()
@@ -230,7 +227,7 @@ class ClientTest extends \PHPUnit_Framework_TestCase
$this->assertInstanceOf( $this->assertInstanceOf(
'GeoIp2\Model\City', 'GeoIp2\Model\City',
$client->cityIspOrg('me'), $client->city('me'),
'can set ip parameter to me' 'can set ip parameter to me'
); );
} }