You are here

public function GeoIpHandlerV1::getReader in GeoIP API 7.2

Creates a single reader instance for this file.

Return value

resource File pointer to use.

4 calls to GeoIpHandlerV1::getReader()
GeoIpHandlerV1::countryCode in src/GeoIpHandlerV1.php
Returns the ISO 3166-2 country code for a given IP.
GeoIpHandlerV1::countryName in src/GeoIpHandlerV1.php
Returns the country name for a given IP.
GeoIpHandlerV1::record in src/GeoIpHandlerV1.php
Returns the record matching the ip.
GeoIpHandlerV1::regionCode in src/GeoIpHandlerV1.php
The region code for a given IP.

File

src/GeoIpHandlerV1.php, line 55
The GeoIP API handler for version 1 - legacy.

Class

GeoIpHandlerV1

Namespace

Drupal\geoip

Code

public function getReader() {
  if (!isset($this->reader)) {
    $this->reader = geoip_open($this->dbFile, GEOIP_STANDARD);
  }
  return $this->reader;
}