Closed (won't fix)
Project:
GeoNames
Version:
5.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
31 Jul 2008 at 17:04 UTC
Updated:
14 Jan 2010 at 09:37 UTC
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
Comment #1
lyricnz commentedShould 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.
Comment #2
lyricnz commentedNo comment from submitter to 2008 issue. As commented above, we're not making non-critical changes to 5.x anymore.