Skip to content

Commit

Permalink
DP-261 getExternalIP method removed
Browse files Browse the repository at this point in the history
  • Loading branch information
tomonorman authored and yaroslavmo committed Apr 9, 2021
1 parent eff2641 commit cfcc4a1
Showing 1 changed file with 0 additions and 23 deletions.
23 changes: 0 additions & 23 deletions src/Utility/Environment.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,29 +22,6 @@ public static function isZipInstalled()
return ($ret === 0) ? true : false;
}

/**
* Returns instance's external IP address.
*
* @return mixed
*/
public static function getExternalIP()
{
$ip = \Cache::rememberForever('external-ip-address', function () {
$response = env('EXTERNAL_IP', Curl::get('http://ipinfo.io/ip'));
$ip = trim($response, "\t\r\n");
try {
$validator = Validator::make(['ip' => $ip], ['ip' => 'ip']);
$validator->validate();
} catch (ValidationException $e) {
$ip = null;
}

return $ip;
});

return $ip;
}

/**
* Returns the instance ID
*
Expand Down

0 comments on commit cfcc4a1

Please sign in to comment.