Moodle PHP Documentation 4.1
Moodle 4.1.11 (Build: 20240610) (c8c84b4af18)
GeoIp2\Database\Reader Class Reference
Inheritance diagram for GeoIp2\Database\Reader:
GeoIp2\ProviderInterface

Public Member Functions

 __construct (string $filename, array $locales=['en'])
 Constructor.
 
 anonymousIp (string $ipAddress)
 This method returns a GeoIP2 Anonymous IP model.
 
 asn (string $ipAddress)
 This method returns a GeoLite2 ASN model.
 
 city (string $ipAddress)
 This method returns a GeoIP2 City model.
 
 close ()
 Closes the GeoIP2 database and returns the resources to the system.
 
 connectionType (string $ipAddress)
 This method returns a GeoIP2 Connection Type model.
 
 country (string $ipAddress)
 This method returns a GeoIP2 Country model.
 
 domain (string $ipAddress)
 This method returns a GeoIP2 Domain model.
 
 enterprise (string $ipAddress)
 This method returns a GeoIP2 Enterprise model.
 
 isp (string $ipAddress)
 This method returns a GeoIP2 ISP model.
 
 metadata ()
 

Constructor & Destructor Documentation

◆ __construct()

GeoIp2\Database\Reader::__construct ( string $filename,
array $locales = ['en'] )

Constructor.

Parameters
string$filenamethe path to the GeoIP2 database file
array$localeslist of locale codes to use in name property from most preferred to least preferred
Exceptions
MaxMind\Db\Reader\InvalidDatabaseExceptionif the database is corrupt or invalid

Member Function Documentation

◆ anonymousIp()

GeoIp2\Database\Reader::anonymousIp ( string $ipAddress)

This method returns a GeoIP2 Anonymous IP model.

Parameters
string$ipAddressan IPv4 or IPv6 address as a string
Exceptions
GeoIp2\Exception\AddressNotFoundExceptionif the address is not in the database
MaxMind\Db\Reader\InvalidDatabaseExceptionif the database is corrupt or invalid

◆ asn()

GeoIp2\Database\Reader::asn ( string $ipAddress)

This method returns a GeoLite2 ASN model.

Parameters
string$ipAddressan IPv4 or IPv6 address as a string
Exceptions
GeoIp2\Exception\AddressNotFoundExceptionif the address is not in the database
MaxMind\Db\Reader\InvalidDatabaseExceptionif the database is corrupt or invalid

◆ city()

GeoIp2\Database\Reader::city ( string $ipAddress)

This method returns a GeoIP2 City model.

Parameters
string$ipAddressan IPv4 or IPv6 address as a string
Exceptions
GeoIp2\Exception\AddressNotFoundExceptionif the address is not in the database
MaxMind\Db\Reader\InvalidDatabaseExceptionif the database is corrupt or invalid

Implements GeoIp2\ProviderInterface.

◆ connectionType()

GeoIp2\Database\Reader::connectionType ( string $ipAddress)

This method returns a GeoIP2 Connection Type model.

Parameters
string$ipAddressan IPv4 or IPv6 address as a string
Exceptions
GeoIp2\Exception\AddressNotFoundExceptionif the address is not in the database
MaxMind\Db\Reader\InvalidDatabaseExceptionif the database is corrupt or invalid

◆ country()

GeoIp2\Database\Reader::country ( string $ipAddress)

This method returns a GeoIP2 Country model.

Parameters
string$ipAddressan IPv4 or IPv6 address as a string
Exceptions
GeoIp2\Exception\AddressNotFoundExceptionif the address is not in the database
MaxMind\Db\Reader\InvalidDatabaseExceptionif the database is corrupt or invalid

Implements GeoIp2\ProviderInterface.

◆ domain()

GeoIp2\Database\Reader::domain ( string $ipAddress)

This method returns a GeoIP2 Domain model.

Parameters
string$ipAddressan IPv4 or IPv6 address as a string
Exceptions
GeoIp2\Exception\AddressNotFoundExceptionif the address is not in the database
MaxMind\Db\Reader\InvalidDatabaseExceptionif the database is corrupt or invalid

◆ enterprise()

GeoIp2\Database\Reader::enterprise ( string $ipAddress)

This method returns a GeoIP2 Enterprise model.

Parameters
string$ipAddressan IPv4 or IPv6 address as a string
Exceptions
GeoIp2\Exception\AddressNotFoundExceptionif the address is not in the database
MaxMind\Db\Reader\InvalidDatabaseExceptionif the database is corrupt or invalid

◆ isp()

GeoIp2\Database\Reader::isp ( string $ipAddress)

This method returns a GeoIP2 ISP model.

Parameters
string$ipAddressan IPv4 or IPv6 address as a string
Exceptions
GeoIp2\Exception\AddressNotFoundExceptionif the address is not in the database
MaxMind\Db\Reader\InvalidDatabaseExceptionif the database is corrupt or invalid

◆ metadata()

GeoIp2\Database\Reader::metadata ( )
Exceptions
InvalidArgumentExceptionif arguments are passed to the method
BadMethodCallExceptionif the database has been closed
Return values
MaxMind\Db\Reader\Metadataobject for the database

The documentation for this class was generated from the following file: