PHP 클래스 Horde_Nls_Geoip, horde

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 Copyright 2003 MaxMind LLC Copyright 2003-2016 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.
저자: Michael Slusarz ([email protected])
파일 보기 프로젝트 열기: horde/horde 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$_countryCodes array Country list.
$_datafile string The location of the GeoIP database.
$_fh resource The open filehandle to the GeoIP database.

공개 메소드들

메소드 설명
__construct ( string $datafile ) Constructor.
countryCodeByAddr ( string $addr ) : integer Returns the country abbreviation (2-letter) for an IP Address.
countryCodeByName ( string $name ) : integer Returns the country abbreviation (2-letter) for a hostname.
countryIdByAddr ( string $addr ) : integer Returns the country ID for an IP Address.
countryIdByName ( string $name ) : integer Returns the country ID for a hostname.
countryNameByAddr ( string $addr ) : mixed Returns the country name for an IP address.
countryNameByName ( string $name ) : integer Returns the country name for a hostname.
getCountryInfo ( string $name ) : mixed Returns the country ID and Name for a given hostname.

보호된 메소드들

메소드 설명
_getName ( string $code ) : string Given a 2-letter country code, returns a country string.
_open ( ) : boolean Open the GeoIP database.
_seekCountry ( string $ipnum ) : mixed Finds a country by IP Address in the GeoIP database.

메소드 상세

__construct() 공개 메소드

Constructor.
public __construct ( string $datafile )
$datafile string The location of the GeoIP database.

_getName() 보호된 메소드

Given a 2-letter country code, returns a country string.
protected _getName ( string $code ) : string
$code string The country code.
리턴 string The country string.

_open() 보호된 메소드

Open the GeoIP database.
protected _open ( ) : boolean
리턴 boolean False on error.

_seekCountry() 보호된 메소드

Finds a country by IP Address in the GeoIP database.
protected _seekCountry ( string $ipnum ) : mixed
$ipnum string The IP Address to search for.
리턴 mixed The country ID or false if not found.

countryCodeByAddr() 공개 메소드

Returns the country abbreviation (2-letter) for an IP Address.
public countryCodeByAddr ( string $addr ) : integer
$addr string The IP Address.
리턴 integer The country abbreviation.

countryCodeByName() 공개 메소드

Returns the country abbreviation (2-letter) for a hostname.
public countryCodeByName ( string $name ) : integer
$name string The hostname.
리턴 integer The country abbreviation.

countryIdByAddr() 공개 메소드

Returns the country ID for an IP Address.
public countryIdByAddr ( string $addr ) : integer
$addr string The IP Address.
리턴 integer The GeoIP country ID.

countryIdByName() 공개 메소드

Returns the country ID for a hostname.
public countryIdByName ( string $name ) : integer
$name string The hostname.
리턴 integer The GeoIP country ID.

countryNameByAddr() 공개 메소드

Returns the country name for an IP address.
public countryNameByAddr ( string $addr ) : mixed
$addr string The IP address.
리턴 mixed The country name.

countryNameByName() 공개 메소드

Returns the country name for a hostname.
public countryNameByName ( string $name ) : integer
$name string The hostname.
리턴 integer The country name.

getCountryInfo() 공개 메소드

Returns the country ID and Name for a given hostname.
public getCountryInfo ( string $name ) : mixed
$name string The hostname.
리턴 mixed An array with 'code' as the country code and 'name' as the country name, or false if not found.

프로퍼티 상세

$_countryCodes 보호되어 있는 프로퍼티

Country list.
protected array $_countryCodes
리턴 array

$_datafile 보호되어 있는 프로퍼티

The location of the GeoIP database.
protected string $_datafile
리턴 string

$_fh 보호되어 있는 프로퍼티

The open filehandle to the GeoIP database.
protected resource $_fh
리턴 resource