Since using file_get_contents with urls requires a config change. It would be good if geonames would use curl first (if it is available). Here is a snippit that will do the trick. This should go in geonames.module (line 175)

if(function_exists('curl_init')) {
$ch = curl_init(geonames_service_url($service) . $querystring . '&app=drupal');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 4);
$data = curl_exec($ch);
} else {
$data = file_get_contents(geonames_service_url($service) . $querystring . '&app=drupal');
}

Comments

lyricnz’s picture

Should probably be changed to drupal_http_request, not curl directly. In any case, I don't think either of the maintainers are doing any 5.x updates anymore.

lyricnz’s picture

Status: Active » Closed (won't fix)

No comment from submitter to 2008 issue. As commented above, we're not making non-critical changes to 5.x anymore.