- This library no longer uses implicitly nullable parameter types. This will fix deprecation warning in PHP 8.4. Reported by Steven Lewis. GitHub #230.
- The PHPDoc type hints have been improved for use with PHPStan.
- IMPORTANT: PHP 8.1 or greater is now required.
- BREAKING: Read-only properties are now used for the model and record classes rather than magic methods. This significantly improves performance.
- BREAKING: The
raw
property on model classess and therecord
property on record classes have been removed. - BREAKING: On
GeoIp2\Record\Traits
, the deprecatedisAnonymousProxy
andisSatelliteProvider
properties have been removed. - BREAKING: The
jsonSerialize
output has changed. GeoIp2\WebService\Client
methods now throw anInvalidArgumentException
if an invalid IP address is passed to them. Previously, they would make a request to the web service and throw aGeoIp2\Exception\InvalidRequestException
.- The
isAnycast
property was added toGeoIp2\Record\Traits
. This returnstrue
if the IP address belongs to an anycast network. This is available for the GeoIP2 Country, City Plus, and Insights web services and the GeoIP2 Country, City, and Enterprise databases.
- The model class names are no longer constructed by concatenating strings. This change was made to improve support for tools like PHP-Scoper. Reported by Andrew Mead. GitHub #194.
- Box 4.0.1 is now used to generate the
geoip2.phar
file.
- The
geoip2.phar
now works when included from another directory. Reported by Eduardo Ruiz. GitHub #179.
- The
geoip2.phar
included in 2.12.0 would only work in CLI applications. This was due to a change in Box 3.x. The Phar should now work in all applications. This release only affects users of the Phar file.
- Support for mobile country code (MCC) and mobile network codes (MNC) was
added for the GeoIP2 ISP and Enterprise databases as well as the GeoIP2
City and Insights web services.
$mobileCountryCode
and$mobileNetworkCode
properties were added toGeoIp2\Model\Isp
for the GeoIP2 ISP database andGeoIp2\Record\Traits
for the Enterprise database and the GeoIP2 City and Insights web services. We expect this data to be available by late January, 2022. geoip2.phar
is now generated with Box 3.x.
- IMPORTANT: PHP 7.2 or greater is now required.
- Added the
isResidentialProxy
property toGeoIp2\Model\AnonymousIP
andGeoIp2\Record\Traits
. - Additional type hints have been added.
- PHP 5.6 or greater is now required.
- The
network
property was added toGeoIp2\Record\Traits
,GeoIp2\Model\AnonymousIp
,GeoIp2\Model\Asn
,GeoIp2\Model\ConnectionType
,Geoip2\Model\Domain
, andGeoIp2\Model\Isp
. This is a string in CIDR format representing the largest network where all of the properties besidesipAddress
have the same value. - Updated documentation of anonymizer properties -
isAnonymousVpn
andisHostingProvider
- to be more descriptive. - The
userCount
property was added toGeoIp2\Record\Traits
. This is an integer which indicates the estimated number of users sharing the IP/network during the past 24 hours. This output is available from GeoIP2 Precision Insights. - The
staticIpScore
property was added toGeoIp2\Record\Traits
. This is a float which indicates how static or dynamic an IP address is. This output is available from GeoIP2 Precision Insights.
- Refer to account IDs using the terminology "account" rather than "user".
- The
isInEuropeanUnion
property was added toGeoIp2\Record\Country
andGeoIp2\Record\RepresentedCountry
. This property istrue
if the country is a member state of the European Union.
- The following new anonymizer properties were added to
GeoIp2\Record\Traits
for use with GeoIP2 Precision Insights:isAnonymous
,isAnonymousVpn
,isHostingProvider
,isPublicProxy
, andisTorExitNode
.
- Code clean-up and tidying.
- Set minimum required PHP version to 5.4 in
composer.json
. Previously, 5.3 would work but was not tested. Now 5.4 is hard minimum version.
- Support for PHP 5.3 was dropped.
- Added support for GeoLite2 ASN database.
- Additional error checking on the data returned from
MaxMind\Db\Reader
was added to help detect corrupt databases. GitHub #83.
isset()
onmostSpecificSubdivision
attribute now returns the correct value. Reported by Juan Francisco Giordana. GitHub #81.
isset()
onname
attribute now returns the correct value. Reported by Juan Francisco Giordana. GitHub #79.
- Updated documentation to clarify what the accuracy radius refers to.
- Upgraded
maxmind/web-service-common
to 0.3.0. This version usescomposer/ca-bundle
rather than our own CA bundle. GitHub #75. - Improved PHP documentation generation.
- Corrected type annotations in documentation. GitHub #66.
- Updated documentation to reflect that the accuracy radius is now included in City.
- Upgraded web service client, which supports setting a proxy. GitHub #59.
- Added support for the GeoIP2 Enterprise database.
- Corrected case on
JsonSerializable
interface. Reported by Axel Etcheverry. GitHub #56.
JsonSerializable
compatibility interface was moved toGeoIp2\Compat
rather than the global namespace to prevent autoloading issues. Reported by Tomas Buteler. GitHub #54.- Missing documentation for the
$postal
property was added to theGeoIp2\Model\City
class. Fix by Roy Sindre Norangshol. GitHub #51. - In the Phar distribution, source files for this module no longer have their documentation stripped, allowing IDE introspection to work properly. Reported by Dominic Black. GitHub #52.
- Updated
maxmind/web-service-common
to version with fixes for PHP 5.3 and 5.4.
- Support for demographics fields
averageIncome
andpopulationDensity
in theLocation
record, returned by the Insights endpoint. - The
isAnonymousProxy
andisSatelliteProvider
properties onGeoIP2\Record\Traits
have been deprecated. Please use our GeoIP2 Anonymous IP database to determine whether an IP address is used by an anonymizing service.
- Typo fix in documentation.
maxmind-ws/web-service-common
was renamed tomaxmind/web-service-common
.
- The library no longer uses Guzzle and instead uses curl directly.
- Support for
timeout
andconnectTimout
were added to the$options
array passed to theGeoIp2\WebService\Client
constructor. Pull request by Will Bradley. GitHub #36.
- The 2.1.0 Phar builds included a shebang line, causing issues when loading it as a library. This has been corrected. GitHub #33.
- Update ApiGen dependency to version that isn't broken on case sensitive file systems.
- Added support for the GeoIP2 Anonymous IP database. The
GeoIP2\Database\Reader
class now has ananonymousIp
method which returns aGeoIP2\Model\AnonymousIp
object. - Boolean attributes like those in the
GeoIP2\Record\Traits
class now returnfalse
instead ofnull
when they were not true.
- First production release.
- IMPORTANT: The deprecated
omni()
andcityIspOrg()
methods have been removed fromGeoIp2\WebService\Client
.
- 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 Countries. This has been fixed. Fixes GitHub issue #23.
- The
GeoIp2\Database\Reader
lookup methods (e.g.,city()
,isp()
) now throw aBadMethodCallException
if they are used with a database that does not match the method. In particular, doing acity()
lookup on a GeoIP2 Country database will result in an exception, and vice versa. - A
metadata()
method has been added to theGeoIP2\Database\Reader
class. This returns aMaxMind\Db\Reader\Metadata
class with information about the database. - The name attribute was missing from the RepresentedCountry class.
- The web service client API has been updated for the v2.1 release of the web
service. In particular, the
cityIspOrg
andomni
methods onGeoIp2\WebService\Client
should be considered deprecated. Thecity
method now provides all of the data formerly provided bycityIspOrg
, and theomni
method has been replaced by theinsights
method. - Support was added for GeoIP2 Connection Type, Domain and ISP databases.
- 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.
- The Phar build was broken with Guzzle 3.9.0+. This has been fixed.
- 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.
- This API is now licensed under the Apache License, Version 2.0.
- Model and record classes now implement
JsonSerializable
. isset
now works with model and record classes.
- Renamed $languages constructor parameters to $locales for both the Client and Reader classes.
- Documentation and code clean-up (Ben Morel).
- Added the interface
GeoIp2\ProviderInterface
, which is implemented by both\GeoIp2\Database\Reader
and\GeoIp2\WebService\Client
.
- This is the first release with the GeoIP2 database reader. Please see the
README.md
file and the\GeoIp2\Database\Reader
class. - The general exception classes were replaced with specific exception classes representing particular types of errors, such as an authentication error.
- In namespaces and class names, "GeoIP2" was renamed to "GeoIp2" to improve consistency.
- First official beta release.
- Documentation updates and corrections.
GenericException
was renamed toGeoIP2Exception
.- We now support more languages. The new languages are de, es, fr, and pt-BR.
- The REST API now returns a record with data about your account. There is
a new
GeoIP\Records\MaxMind
class for this data. - The
continentCode
attribute onContinent
was renamed tocode
. - Documentation updates.
- Updated Guzzle version requirement.
- Fixed Composer example in README.md.
- Initial release.