Finish version/v.0.0.20#3
This commit is contained in:
commit
90b943cfc3
@ -176,9 +176,22 @@ class Helper {
|
|||||||
|
|
||||||
return $ip;
|
return $ip;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function url_get_contents ($Url) {
|
||||||
|
if (!function_exists('curl_init')){
|
||||||
|
die('CURL is not installed!');
|
||||||
|
}
|
||||||
|
$ch = curl_init();
|
||||||
|
curl_setopt($ch, CURLOPT_URL, $Url);
|
||||||
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||||
|
$output = curl_exec($ch);
|
||||||
|
curl_close($ch);
|
||||||
|
return $output;
|
||||||
|
}
|
||||||
|
|
||||||
public static function getGeoIp() {
|
public static function getGeoIp() {
|
||||||
$ip = Helper::getRealUserIp ();
|
$ip = Helper::getRealUserIp ();
|
||||||
$details = json_decode ( file_get_contents ( "http://ipinfo.io/{$ip}/json" ) );
|
$details = json_decode ( Helper::url_get_contents( "http://ipinfo.io/{$ip}/json" ) );
|
||||||
return $details;
|
return $details;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue
Block a user