Geocoder\Provider\MaxMindBinary::__construct PHP Method

__construct() public method

public __construct ( string $datFile, integer | null $openFlag = null )
$datFile string
$openFlag integer | null
    public function __construct($datFile, $openFlag = null)
    {
        if (false === function_exists('geoip_open')) {
            throw new FunctionNotFound('geoip_open', 'The MaxMindBinary requires maxmind\'s lib to be installed and loaded. Have you included geoip.inc file?');
        }
        if (false === function_exists('GeoIP_record_by_addr')) {
            throw new FunctionNotFound('GeoIP_record_by_addr', 'The MaxMindBinary requires maxmind\'s lib to be installed and loaded. Have you included geoipcity.inc file?');
        }
        if (false === is_file($datFile)) {
            throw new InvalidArgument(sprintf('Given MaxMind dat file "%s" does not exist.', $datFile));
        }
        if (false === is_readable($datFile)) {
            throw new InvalidArgument(sprintf('Given MaxMind dat file "%s" does not readable.', $datFile));
        }
        $this->datFile = $datFile;
        $this->openFlag = null === $openFlag ? GEOIP_STANDARD : $openFlag;
        parent::__construct();
    }