Reader
class Reader (View source)
Instances of this class provide a reader for the MaxMind DB format. IP addresses can be looked up using the get method.
Methods
Constructs a Reader for the MaxMind DB format. The file passed to it must be a valid MaxMind DB file such as a GeoIp2 database file.
Retrieves the record for the IP address.
Retrieves the record for the IP address and its associated network prefix length.
Closes the MaxMind DB and returns resources to the system.
Details
__construct(string $database)
Constructs a Reader for the MaxMind DB format. The file passed to it must be a valid MaxMind DB file such as a GeoIp2 database file.
mixed
get(string $ipAddress)
Retrieves the record for the IP address.
array
getWithPrefixLen(string $ipAddress)
Retrieves the record for the IP address and its associated network prefix length.
Metadata
metadata()
No description
void
close()
Closes the MaxMind DB and returns resources to the system.