Closed (fixed)
Project:
Hostip
Version:
5.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Reporter:
Created:
15 Sep 2008 at 16:13 UTC
Updated:
29 Jun 2012 at 11:25 UTC
Currently location information is stored in a global variable, $HostipLookupResultSet. This means data must be fetched from hostip for every page load. Instead, the data should be stored in the session and refreshed only if missing.
This data should also be in a hook implementation rather than directly called in the .module code. Proposed approach:
function hostip_init() {
if (empty($_SESSION['hostip_data'])) {
$_SESSION['hostip_data'] = _hostip_get_iptocountry_info();
}
}
Comments
Comment #1
amitgoyal commentedThanks for the suggestion, Nedjo. We have incorporated the changes in D6 and D7 versions. D5 version is no longer supported.