function getLocationFromWebService($location_map) { $license_key = owa_coreAPI::getSetting('maxmind_geoip', 'ws_license_key'); $user_name = owa_coreAPI::getSetting('maxmind_geoip', 'ws_user_name'); if (!array_key_exists('ip_address', $location_map)) { return $location_map; } //use GeoIp2\WebService\Client; $client = new Client($user_name, $license_key); $record = $client->city(trim($location_map['ip_address'])); if ($record) { $location_map = $this->mapCityRecord($record, $location_map); } return $location_map; }