Skip to content

Commit cf7d442

Browse files
committed
[TASK] Replace ipapi.com with ipapi.co service
1 parent ee5cc6b commit cf7d442

File tree

3 files changed

+21
-24
lines changed

3 files changed

+21
-24
lines changed

Classes/Domain/Factory/Ipinformation/IpApi.php

Lines changed: 0 additions & 18 deletions
This file was deleted.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
namespace In2code\Lux\Domain\Factory\Ipinformation;
5+
6+
class IpApiCo extends AbstractIpinformation implements IpinformationInterface
7+
{
8+
protected array $mapping = [
9+
'org' => 'org',
10+
'country_name' => 'country',
11+
'country_code' => 'countryCode',
12+
'city' => 'city',
13+
'latitude' => 'lat',
14+
'longitude' => 'lon',
15+
'region' => 'region',
16+
];
17+
}

Configuration/TypoScript/Lux/05_IpinformationConfiguration.typoscript

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,12 @@ lib.lux.settings {
55
# Main switch for using external IP services
66
_enable = 1
77

8-
# Ip-API.com
9-
# detailed information (company information mostly better then other services)
10-
# with company details, geo coordinates, zip and region
11-
# but connection is limited to 45 requests/minute + to http only for free usage (see ip-api.com for premium access)
8+
# ipapi.co
9+
# Check website for gdpr information
1210
1 {
13-
class = In2code\Lux\Domain\Factory\Ipinformation\IpApi
11+
class = In2code\Lux\Domain\Factory\Ipinformation\IpApiCo
1412
configuration {
15-
url = http://ip-api.com/json/{ip}
13+
url = https://ipapi.co/{ip}/json/
1614
}
1715
}
1816

0 commit comments

Comments
 (0)