Skip to content

Commit 5dff78d

Browse files
committed
Removed old MaxMind GeoLite2 mmdb files
1 parent 92b3377 commit 5dff78d

File tree

4 files changed

+2
-4
lines changed

4 files changed

+2
-4
lines changed

Model/IpToCountryRepository.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,7 @@ public function getCountryCode($ip)
139139
if (file_exists($filename)) {
140140
$datFile = $filename;
141141
} else {
142-
$datFile = $this->moduleDir->getDir('Magefan_GeoIp') . '/data/GeoLite2-Country.mmdb';
143-
//throw new \Exception('No .mmdb file');
142+
return $this->ipToCountry[$ip];
144143
}
145144
$reader = new \GeoIp2\Database\Reader($datFile);
146145
$record = $reader->country($ip);

Model/IpToRegionRepository.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,7 @@ public function getRegionCode($ip)
9494
if (file_exists($filename)) {
9595
$datFile = $filename;
9696
} else {
97-
$datFile = $this->moduleDir->getDir('Magefan_GeoIp') . '/data/GeoLite2-City.mmdb';
98-
//throw new \Exception('No .mmdb file');
97+
return $this->ipToRegion[$ip];
9998
}
10099

101100
$reader = new \GeoIp2\Database\Reader($datFile);

data/GeoLite2-City.mmdb

-49.1 MB
Binary file not shown.

data/GeoLite2-Country.mmdb

-6.15 MB
Binary file not shown.

0 commit comments

Comments
 (0)