Country-level database support

Created on 19 March 2025, 3 months ago

Any chance of country-level database support?

I'm already pulling MaxMind's country-level database weekly for other purposes, and don't really care about city-level GeoIP resolution, which with the free database isn't that accurate anyway. My other concern is that the city-level database is quite a bit larger.

✨ Feature request
Status

Active

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States Maeglin

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @Maeglin
  • πŸ‡ΊπŸ‡ΈUnited States bluegeek9

    I think it will need to be separate modules; city and country and maybe a third for shared code.

    Can you tell me more about how you are using the country database? Are you using the file or do you load the data into a database?

  • πŸ‡ΊπŸ‡ΈUnited States Maeglin

    I download the country database in 2 formats, CSV and MMDB. The latter is mainly for software that uses it, but the former I convert to MaxMind's old binary format, for older software that might still need it, as well as convert it to a different format altogether for firewall purposes. There's an iptables extension for GeoIP-based filtering, but it requires the data in its own special format.

  • πŸ‡ΊπŸ‡ΈUnited States bluegeek9

    I will add a parameter to define the scope: country or city. If no scope is provided, the default will be used.

    So, in MaxMind if the default is set to Country, the Visitiors will get Country data.

    public function getLocation(string $ip, ?string $scope = null)
    
Production build 0.71.5 2024