Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ CHANGELOG
`subdivisions` array. This provides compatibility with some third-party
databases that publish empty subdivisions arrays. Pull request by Jarek
Jakubowski. GitHub #290.
* The `GeoIP2` prefix in web service error messages has been changed to
`GeoIP`.

3.3.0 (2025-11-20)
------------------
Expand Down
6 changes: 3 additions & 3 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
## Project Overview

**GeoIP2-php** is MaxMind's official PHP client library for:
- **GeoIP2/GeoLite2 Web Services**: Country, City, and Insights endpoints
- **GeoIP2/GeoLite2 Databases**: Local MMDB file reading for various database types (City, Country, ASN, Anonymous IP, Anonymous Plus, ISP, etc.)
- **GeoIP/GeoLite Web Services**: Country, City Plus, and Insights endpoints
- **GeoIP/GeoLite Databases**: Local MMDB file reading for various database types (City, Country, ASN, Anonymous IP, Anonymous Plus, ISP, etc.)

The library provides both web service clients and database readers that return strongly-typed model objects containing geographic, ISP, anonymizer, and other IP-related data.

Expand Down Expand Up @@ -323,6 +323,6 @@ vendor/bin/phpunit
## Additional Resources

- [API Documentation](https://maxmind.github.io/GeoIP2-php/)
- [GeoIP2 Web Services Docs](https://dev.maxmind.com/geoip/docs/web-services)
- [GeoIP Web Services Docs](https://dev.maxmind.com/geoip/docs/web-services)
- [MaxMind DB Format](https://maxmind.github.io/MaxMind-DB/)
- GitHub Issues: https://github.com/maxmind/GeoIP2-php/issues
26 changes: 13 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# GeoIP2 PHP API
# GeoIP PHP API

## Description

This package provides an API for the GeoIP2 and GeoLite2
This package provides an API for the GeoIP and GeoLite
[web services](https://dev.maxmind.com/geoip/docs/web-services?lang=en) and
[databases](https://dev.maxmind.com/geoip/docs/databases?lang=en).

Expand Down Expand Up @@ -46,7 +46,7 @@ require 'vendor/autoload.php';

Although we strongly recommend using Composer, we also provide a
[phar archive](https://php.net/manual/en/book.phar.php) containing most of the
dependencies for GeoIP2. Our latest phar archive is available on
dependencies for GeoIP. Our latest phar archive is available on
[our releases page](https://github.com/maxmind/GeoIP2-php/releases).

### Install Dependencies
Expand Down Expand Up @@ -80,15 +80,15 @@ require 'geoip2.phar';

The [MaxMind DB API](https://github.com/maxmind/MaxMind-DB-Reader-php)
includes an optional C extension that you may install to dramatically increase
the performance of lookups in GeoIP2 or GeoLite2 databases. To install, please
the performance of lookups in GeoIP or GeoLite databases. To install, please
follow the instructions included with that API.

The extension has no effect on web-service lookups.

## IP Geolocation Usage

IP geolocation is inherently imprecise. Locations are often near the center of
the population. Any location provided by a GeoIP2 database or web service
the population. Any location provided by a GeoIP database or web service
should not be used to identify a particular address or household.

## Database Reader
Expand Down Expand Up @@ -304,14 +304,14 @@ argument specifies the language preferences when using the `->name` method on
the model classes that this client creates. The fourth argument is additional
options such as `host` and `timeout`.

For instance, to call the GeoLite2 web service instead of the GeoIP2 web
For instance, to call the GeoLite web service instead of the GeoIP web
service:

```php
$client = new Client(42, 'abcdef123456', ['en'], ['host' => 'geolite.info']);
```

To call the Sandbox GeoIP2 web service instead of the production GeoIP2 web
To call the Sandbox GeoIP web service instead of the production GeoIP web
service:

```php
Expand Down Expand Up @@ -344,10 +344,10 @@ use GeoIp2\WebService\Client;
// This creates a Client object that can be reused across requests.
// Replace "42" with your account ID and "license_key" with your license
// key. Set the "host" to "geolite.info" in the fourth argument options
// array to use the GeoLite2 web service instead of the GeoIP2 web
// array to use the GeoLite web service instead of the GeoIP web
// service. Set the "host" to "sandbox.maxmind.com" in the fourth argument
// options array to use the Sandbox GeoIP2 web service instead of the
// production GeoIP2 web service.
// options array to use the Sandbox GeoIP web service instead of the
// production GeoIP web service.
$client = new Client(42, 'abcdef123456');

// Replace "city" with the method corresponding to the web service that
Expand Down Expand Up @@ -398,7 +398,7 @@ Because of these factors, it is possible for any endpoint to return a record
where some or all of the attributes are unpopulated.

See the
[GeoIP2 web service docs](https://dev.maxmind.com/geoip/docs/web-services?lang=en)
[GeoIP web service docs](https://dev.maxmind.com/geoip/docs/web-services?lang=en)
for details on what data each endpoint may return.

The only piece of data which is always returned is the `ipAddress` attribute
Expand All @@ -411,7 +411,7 @@ databases with data on geographical features around the world, including
populated places. They offer both free and paid premium data. Each feature is
uniquely identified by a `geonameId`, which is an integer.

Many of the records returned by the GeoIP2 web services and databases include
Many of the records returned by the GeoIP web services and databases include
a `geonameId` property. This is the ID of a geographical feature (city,
region, country, etc.) in the GeoNames database.

Expand Down Expand Up @@ -460,7 +460,7 @@ initial clone, or from https://github.com/maxmind/MaxMind-DB

## Versioning

The GeoIP2 PHP API uses [Semantic Versioning](https://semver.org/).
The GeoIP PHP API uses [Semantic Versioning](https://semver.org/).

## Copyright and License

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "geoip2/geoip2",
"description": "MaxMind GeoIP2 PHP API",
"description": "MaxMind GeoIP PHP API",
"keywords": ["geoip", "geoip2", "geolocation", "ip", "maxmind"],
"homepage": "https://github.com/maxmind/GeoIP2-php",
"type": "library",
Expand Down
2 changes: 1 addition & 1 deletion dev-bin/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ rm -rf "$cachedir"
php phpDocumentor.phar \
--visibility=public \
--cache-folder="$cachedir" \
--title="GeoIP2 PHP API $tag" \
--title="GeoIP PHP API $tag" \
run \
-d "$PWD/../src" \
-t "doc/$tag"
Expand Down
2 changes: 1 addition & 1 deletion docs/hugo.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
title = "MaxMind GeoIP2 PHP API"
title = "MaxMind GeoIP PHP API"
disableKinds = ["taxonomy", "term", "RSS"]

[[cascade]]
Expand Down
22 changes: 11 additions & 11 deletions src/Database/Reader.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
use MaxMind\Db\Reader\Metadata;

/**
* Instances of this class provide a reader for the GeoIP2 database format.
* Instances of this class provide a reader for the GeoIP database format.
* IP addresses can be looked up using the database specific methods.
*
* ## Usage ##
Expand Down Expand Up @@ -51,7 +51,7 @@ class Reader implements ProviderInterface
/**
* Constructor.
*
* @param string $filename the path to the GeoIP2 database file
* @param string $filename the path to the GeoIP database file
* @param array<string> $locales list of locale codes to use in name property
* from most preferred to least preferred
*
Expand All @@ -67,7 +67,7 @@ public function __construct(
}

/**
* This method returns a GeoIP2 City model.
* This method returns a GeoIP City model.
*
* @param string $ipAddress an IPv4 or IPv6 address as a string
*
Expand All @@ -81,7 +81,7 @@ public function city(string $ipAddress): City
}

/**
* This method returns a GeoIP2 Country model.
* This method returns a GeoIP Country model.
*
* @param string $ipAddress an IPv4 or IPv6 address as a string
*
Expand All @@ -95,7 +95,7 @@ public function country(string $ipAddress): Country
}

/**
* This method returns a GeoIP2 Anonymous IP model.
* This method returns a GeoIP Anonymous IP model.
*
* @param string $ipAddress an IPv4 or IPv6 address as a string
*
Expand Down Expand Up @@ -131,7 +131,7 @@ public function anonymousPlus(string $ipAddress): AnonymousPlus
}

/**
* This method returns a GeoLite2 ASN model.
* This method returns a GeoLite ASN model.
*
* @param string $ipAddress an IPv4 or IPv6 address as a string
*
Expand All @@ -149,7 +149,7 @@ public function asn(string $ipAddress): Asn
}

/**
* This method returns a GeoIP2 Connection Type model.
* This method returns a GeoIP Connection Type model.
*
* @param string $ipAddress an IPv4 or IPv6 address as a string
*
Expand All @@ -167,7 +167,7 @@ public function connectionType(string $ipAddress): ConnectionType
}

/**
* This method returns a GeoIP2 Domain model.
* This method returns a GeoIP Domain model.
*
* @param string $ipAddress an IPv4 or IPv6 address as a string
*
Expand All @@ -185,7 +185,7 @@ public function domain(string $ipAddress): Domain
}

/**
* This method returns a GeoIP2 Enterprise model.
* This method returns a GeoIP Enterprise model.
*
* @param string $ipAddress an IPv4 or IPv6 address as a string
*
Expand All @@ -199,7 +199,7 @@ public function enterprise(string $ipAddress): Enterprise
}

/**
* This method returns a GeoIP2 ISP model.
* This method returns a GeoIP ISP model.
*
* @param string $ipAddress an IPv4 or IPv6 address as a string
*
Expand Down Expand Up @@ -283,7 +283,7 @@ public function metadata(): Metadata
}

/**
* Closes the GeoIP2 database and returns the resources to the system.
* Closes the GeoIP database and returns the resources to the system.
*/
public function close(): void
{
Expand Down
2 changes: 1 addition & 1 deletion src/Exception/InvalidRequestException.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
namespace GeoIp2\Exception;

/**
* This class represents an error returned by MaxMind's GeoIP2
* This class represents an error returned by MaxMind's GeoIP
* web service.
*/
class InvalidRequestException extends HttpException
Expand Down
2 changes: 1 addition & 1 deletion src/Model/AnonymousIp.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use GeoIp2\Util;

/**
* This class provides the GeoIP2 Anonymous IP model.
* This class provides the GeoIP Anonymous IP model.
*/
class AnonymousIp implements \JsonSerializable
{
Expand Down
2 changes: 1 addition & 1 deletion src/Model/Asn.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use GeoIp2\Util;

/**
* This class provides the GeoLite2 ASN model.
* This class provides the GeoLite ASN model.
*/
class Asn implements \JsonSerializable
{
Expand Down
2 changes: 1 addition & 1 deletion src/Model/ConnectionType.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use GeoIp2\Util;

/**
* This class provides the GeoIP2 Connection-Type model.
* This class provides the GeoIP Connection-Type model.
*/
class ConnectionType implements \JsonSerializable
{
Expand Down
2 changes: 1 addition & 1 deletion src/Model/Country.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
use GeoIp2\Record\Traits;

/**
* Model class for the data returned by GeoIP2 Country web service and database.
* Model class for the data returned by GeoIP Country web service and database.
*
* See https://dev.maxmind.com/geoip/docs/web-services?lang=en for more details.
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Model/Domain.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use GeoIp2\Util;

/**
* This class provides the GeoIP2 Domain model.
* This class provides the GeoIP Domain model.
*/
class Domain implements \JsonSerializable
{
Expand Down
2 changes: 1 addition & 1 deletion src/Model/Enterprise.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
namespace GeoIp2\Model;

/**
* Model class for the data returned by GeoIP2 Enterprise database lookups.
* Model class for the data returned by GeoIP Enterprise database lookups.
*
* See https://dev.maxmind.com/geoip/docs/web-services?lang=en for more
* details.
Expand Down
2 changes: 1 addition & 1 deletion src/Model/Insights.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use GeoIp2\Record\Anonymizer;

/**
* Model class for the data returned by GeoIP2 Insights web service.
* Model class for the data returned by GeoIP Insights web service.
*
* See https://dev.maxmind.com/geoip/docs/web-services?lang=en for
* more details.
Expand Down
2 changes: 1 addition & 1 deletion src/Model/Isp.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use GeoIp2\Util;

/**
* This class provides the GeoIP2 ISP model.
* This class provides the GeoIP ISP model.
*/
class Isp implements \JsonSerializable
{
Expand Down
2 changes: 1 addition & 1 deletion src/Record/AbstractPlaceRecord.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ abstract class AbstractPlaceRecord extends AbstractNamedRecord
/**
* @var int|null A value from 0-100 indicating MaxMind's
* confidence that the location level is correct. This attribute is only available
* from the Insights service and the GeoIP2 Enterprise database.
* from the Insights service and the GeoIP Enterprise database.
*/
public readonly ?int $confidence;

Expand Down
Loading
Loading