Skip to content

Commit 5ec47be

Browse files
committed
moved maxmind update url
1 parent 53203a1 commit 5ec47be

File tree

3 files changed

+6
-9
lines changed

3 files changed

+6
-9
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,4 +179,4 @@ You can use the free database from maxmind or their web api service. You can dow
179179

180180
### IP-API
181181

182-
IP-API is a free service that can also be used instead of the database file or the paid maxmind service. They do have some limitations please have a look at the [docs](http://ip-api.com/docs/) first.
182+
IP-API is a free service that can also be used instead of the database file or the paid maxmind service. They do have some limitations so please have a look at the [docs](http://ip-api.com/docs/) first.

src/GeoIPUpdater.php

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,6 @@
77

88
class GeoIPUpdater
99
{
10-
/**
11-
* @var string
12-
*/
13-
protected $maxmindUrl = 'http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.mmdb.gz';
14-
1510
/**
1611
* @var array
1712
*/
@@ -53,11 +48,13 @@ public function update()
5348
*/
5449
protected function updateMaxmindDatabase()
5550
{
51+
$maxmindDatabaseUrl = 'http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.mmdb.gz';
52+
5653
$database = array_get($this->config, 'maxmind.database', '/tmp/GeoLite2-City.mmdb');
5754

58-
$file = $this->requester->url($this->maxmindUrl)->get()->getBody();
55+
$file = $this->requester->url($maxmindDatabaseUrl)->get()->getBody();
5956

60-
file_put_contents($database, gzdecode($file));
57+
@file_put_contents($database, gzdecode($file));
6158

6259
return $database;
6360
}

src/Laravel/Console/UpdateCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
namespace PulkitJalan\GeoIP\Laravel\Console;
44

5-
use Illuminate\Console\Command;
65
use PulkitJalan\GeoIP\GeoIPUpdater;
6+
use Illuminate\Console\Command;
77

88
class UpdateCommand extends Command
99
{

0 commit comments

Comments
 (0)