1 | <?php |
||
17 | class GeoIp2CityAdapter implements GeoAdapterInterface |
||
18 | { |
||
19 | /** |
||
20 | * @var array |
||
21 | */ |
||
22 | public $databaseConfig = [ |
||
23 | 'class' => GeoIp2Database::class, |
||
24 | ]; |
||
25 | |||
26 | /** |
||
27 | * GeoIp2 Reader |
||
28 | * |
||
29 | * @var Reader |
||
30 | */ |
||
31 | private $geoIpReader; |
||
32 | |||
33 | /** |
||
34 | * Loads location data from source for $ip |
||
35 | * |
||
36 | * @param $ip |
||
37 | * |
||
38 | * @return \GeoIp2\Model\City |
||
39 | */ |
||
40 | public function loadLocationData($ip) |
||
48 | |||
49 | /** |
||
50 | * Gets location data from loaded data |
||
51 | * |
||
52 | * @param $ip |
||
53 | * |
||
54 | * @return GeoDataInterface |
||
55 | * |
||
56 | * @throws EmptyLocationDataException |
||
57 | */ |
||
58 | public function getLocationData($ip): GeoDataInterface |
||
80 | |||
81 | /** |
||
82 | * Gets adapter's name |
||
83 | * |
||
84 | * @return string |
||
85 | */ |
||
86 | public function getName(): string |
||
90 | |||
91 | /** |
||
92 | * Gets GeoIP Reader |
||
93 | * |
||
94 | * @return Reader |
||
95 | */ |
||
96 | private function getGeoIpReader(): ?Reader |
||
108 | } |
||
109 |