public function __construct(array $options = array())
{
if (isset($options['host'])) {
$this->host = $options['host'];
} else {
if (isset($_SERVER['REMOTE_ADDR'])) {
$this->host = $_SERVER['REMOTE_ADDR'];
}
}
if (isset($options['latitude'])) {
$this->latitude = $options['latitude'];
}
if (isset($options['longitude'])) {
$this->longitude = $options['longitude'];
}
$this->getAvailableDatabases();
$this->getGeoIpHostInfo();
// If lat and long weren't passed, try and get it from the host location
if (null === $this->latitude && null === $this->longitude) {
$this->latitude = $this->hostInfo['latitude'];
$this->longitude = $this->hostInfo['longitude'];
}
}