-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Adds support for continent specific GeoIP2-City databases #13338
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Guess the database is available for other continents as well? Maybe we should add them then too. |
Good idea and yes, it is. Feel free to extend my proposal. |
@fs1 Guess you don't have purchased or have access to any of the other continent dbs? Would be good to know how their naming is. Otherwise it's hard to add their names |
@fs1 found a page where it's mentioned. Would you mind adjusting your PR, so the other continents are listed as well? https://dev.maxmind.com/geoip/geoip2/geoip2-city-country-csv-databases/
|
@fs1 thanks for updating. Are you sure there are continent separated dbs for GeoLite2? Did only find some for the paid version... |
well. guess you're right.
This explanation from https://dev.maxmind.com/geoip/geoip2/geoip2-city-country-csv-databases/ ist some kind of contradictory
Im going to update the PR again. |
…n is only for GeoIp2 databases available
@@ -273,7 +283,7 @@ public function getInfo() | |||
. '</a>'; | |||
|
|||
$availableDatabaseTypes = array(); | |||
if (self::getPathToGeoIpDatabase(['GeoIP2-Enterprise.mmdb', 'GeoIP2-City.mmdb', 'GeoLite2-City.mmdb']) !== false) { | |||
if (self::getPathToGeoIpDatabase(['GeoIP2-City.mmdb', 'GeoIP2-City-Africa.mmdb', 'GeoIP2-City-Asia-Pacific.mmdb', 'GeoIP2-City-Europe.mmdb', 'GeoIP2-City-North-America.mmdb', 'GeoIP2-City-South-America.mmdb', 'GeoIP2-Enterprise.mmdb', 'GeoIP2-Country.mmdb', 'GeoLite2-City.mmdb', 'GeoLite2-Country.mmdb']) !== false) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Country
versions shouldn't be added here, as its the detection if the city level is available.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thx for the hint, i missed that.
@fs1 Thanks again for your contribution. Will merge it now, so it will be included in the next release. |
…#13338) * add GeoIP2-City-Europe * added all kinds of maxmind city databases * removed GeoLite2-City-Continent database support since this separation is only for GeoIp2 databases available * removed country files from city detection
Since I use the GeoIP2-City-Europe Database from maxmind I needed to modify the files LocationProvider/GeoIp2/Php.php and LocationProvider/GeoIp2.php in the GeoIp2 Plug-in. After modification the GeoIP file was recognized an worked like expected.
Please consider implementing this patch.