Pop\Geo\Geo::__construct PHP Method

__construct() public method

Instantiate the Geo object.
public __construct ( array $options = [] ) : Geo
$options array
return Geo
    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'];
        }
    }