Skip to content

Commit 2ed00c8

Browse files
committed
Merge pull request #9 from SmallURL/master
Addition of the locations continent to the returned data
2 parents 73bf0a0 + 70cb5a5 commit 2ed00c8

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

README.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -70,16 +70,17 @@ array (
7070
"city" => "New Haven",
7171
"state" => "CT",
7272
"postal_code" => "06510",
73-
"lat" => 41.28,
73+
"lat" => 41.28,
7474
"lon" => -72.88,
75-
"timezone" => "America/New_York"
76-
"default" => false
75+
"timezone" => "America/New_York",
76+
"continent" => "NA",
77+
"default" => false
7778
);
78-
```
79-
80-
#### Note
81-
82-
In the case that a location is not found the fallback location will be returned with the `default` parameter set to `true`. In a future release I'll make the default location customizable. For not it is New Haven, CT.
79+
```
80+
81+
#### Note
82+
83+
In the case that a location is not found the fallback location will be returned with the `default` parameter set to `true`. In a future release I'll make the default location customizable. For not it is New Haven, CT.
8384

8485
## Services
8586

src/Torann/GeoIP/GeoIP.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ class GeoIP {
6767
"lat" => 41.31,
6868
"lon" => -72.92,
6969
"timezone" => "America/New_York",
70+
"continent" => "NA",
7071
"default" => true
7172
);
7273

@@ -177,6 +178,7 @@ private function locate_maxmind( $ip )
177178
"lat" => $record->location->latitude,
178179
"lon" => $record->location->longitude,
179180
"timezone" => $record->location->timeZone,
181+
"continent" => $record->continent->code,
180182
"default" => false
181183
);
182184

0 commit comments

Comments
 (0)