/** * Extract the IP from the local database. */ protected function lookup() { try { $reader = new Database($this->getLocalDataStoreFilepath() . '/IP-COUNTRY-REGION-CITY-LATITUDE-LONGITUDE-ZIPCODE.BIN', Database::FILE_IO); $record = $reader->lookup($this->ip, Database::ALL); if (isset($record['countryName'])) { $this->country = $record['countryName']; $this->region = $record['regionName']; $this->city = $record['cityName']; $this->latitude = $record['latitude']; $this->longitude = $record['longitude']; $this->zipcode = $record['zipCode']; $this->isp = $record['isp']; $this->timezone = $record['timeZone']; } } catch (\Exception $exception) { if ($this->logger) { $this->logger->warn('IP LOOKUP: ' . $exception->getMessage()); } } }