Fix: Not exists function with geoip PEAR

This commit is contained in:
Laurent Destailleur 2012-01-15 02:19:00 +01:00
parent 73e5b05bb8
commit 301c66210a

View File

@ -38,8 +38,8 @@ class DolGeoIP
/**
* Constructor
*
* @param $type 'country' or 'city'
* @param $datfile Data file
* @param string $type 'country' or 'city'
* @param string $datfile Data file
* @return GeoIP
*/
function DolGeoIP($type,$datfile)
@ -108,6 +108,8 @@ class DolGeoIP
/**
* Return verion of data file
*
* @return string Version of datafile
*/
function getVersion()
{
@ -116,10 +118,15 @@ class DolGeoIP
/**
* Close geoip object
*
* @return void
*/
function close()
{
geoip_close($this->gi);
if (function_exists('geoip_close')) // With some geoip with PEAR, geoip_close function may not exists
{
geoip_close($this->gi);
}
}
}
?>