private function getGeoIpInstance($key)
{
if (empty($this->geoIpCache[$key])) {
// make sure region names are loaded & saved first
parent::getRegionNames();
require_once PIWIK_INCLUDE_PATH . '/libs/MaxMindGeoIP/geoipcity.inc';
$pathToDb = self::getPathToGeoIpDatabase($this->customDbNames[$key]);
if ($pathToDb !== false) {
$this->geoIpCache[$key] = geoip_open($pathToDb, GEOIP_STANDARD);
// TODO support shared memory
}
}
return empty($this->geoIpCache[$key]) ? false : $this->geoIpCache[$key];
}