Overview

Packages

  • Nls

Classes

  • Horde_Nls
  • Horde_Nls_Geoip
  • Horde_Nls_Translation
  • Overview
  • Package
  • Class
  • Tree

Class Horde_Nls_Geoip

Horde optimized interface to the MaxMind IP Address->Country listing.

Based on PHP geoip.inc library by MaxMind LLC: http://www.maxmind.com/download/geoip/api/php/

Originally based on php version of the geoip library written in May 2002 by jim winstead jimw@apache.org

Copyright 2003 MaxMind LLC Copyright 2003-2012 Horde LLC (http://www.horde.org/)

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

See the enclosed file COPYING for license information (LGPL). If you did not receive this file, see http://www.horde.org/licenses/lgpl21.

Package: Nls
Category: Horde
Author: Michael Slusarz slusarz@horde.org
Located at Horde/Nls/Geoip.php
Methods summary
public
# __construct( string $datafile )

Constructor.

Constructor.

Parameters

$datafile
The location of the GeoIP database.
public mixed
# getCountryInfo( string $name )

Returns the country ID and Name for a given hostname.

Returns the country ID and Name for a given hostname.

Parameters

$name
The hostname.

Returns

mixed

An array with 'code' as the country code and 'name' as the country name, or false if not found.

public integer
# countryIdByName( string $name )

Returns the country ID for a hostname.

Returns the country ID for a hostname.

Parameters

$name
The hostname.

Returns

integer
The GeoIP country ID.
public integer
# countryCodeByName( string $name )

Returns the country abbreviation (2-letter) for a hostname.

Returns the country abbreviation (2-letter) for a hostname.

Parameters

$name
The hostname.

Returns

integer
The country abbreviation.
public integer
# countryNameByName( string $name )

Returns the country name for a hostname.

Returns the country name for a hostname.

Parameters

$name
The hostname.

Returns

integer
The country name.
public integer
# countryIdByAddr( string $addr )

Returns the country ID for an IP Address.

Returns the country ID for an IP Address.

Parameters

$addr
The IP Address.

Returns

integer
The GeoIP country ID.
public integer
# countryCodeByAddr( string $addr )

Returns the country abbreviation (2-letter) for an IP Address.

Returns the country abbreviation (2-letter) for an IP Address.

Parameters

$addr
The IP Address.

Returns

integer
The country abbreviation.
public mixed
# countryNameByAddr( string $addr )

Returns the country name for an IP address.

Returns the country name for an IP address.

Parameters

$addr
The IP address.

Returns

mixed
The country name.
Constants summary
integer GEOIP_COUNTRY_BEGIN
# 16776960
integer STRUCTURE_INFO_MAX_SIZE
# 20
integer STANDARD_RECORD_LENGTH
# 3
API documentation generated by ApiGen