-
Notifications
You must be signed in to change notification settings - Fork 3
/
ip-cached.php
31 lines (27 loc) · 939 Bytes
/
ip-cached.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<?php
require __DIR__.'/../vendor/autoload.php';
$converter = new Locurro\Converter\IpAddress(
new Locurro\Converter\Country(
new Locurro\Converter\Locale(
new Locurro\Converter\Currency(
new Swap\Swap(
new Swap\Provider\YahooFinanceProvider(
new Ivory\HttpAdapter\FileGetContentsHttpAdapter()
),
new Swap\Cache\DoctrineCache(new Doctrine\Common\Cache\FilesystemCache(__DIR__.'/../cache'), 60)
)
)
)
),
new Geocoder\Provider\GeoIP2(
new Geocoder\Adapter\GeoIP2Adapter(
new GeoIp2\Database\Reader(__DIR__.'/../data/GeoLite2-Country.mmdb'),
Geocoder\Adapter\GeoIP2Adapter::GEOIP2_MODEL_COUNTRY
)
)
);
$money = $converter->convert(
new Money\Money(100, new Money\Currency('EUR')),
'109.92.115.78'
);
var_dump($money);