library/Dot/Geoip/Country.php

Properties

Description

DotBoost Technologies Inc.

DotKernel Application Framework


Classes

Dot_Geoip_Country

Properties

 
No 
No 

Description

Geo IP Country - connect to GeoIP.dat database to return the country based on IP address

Methods

__construct, _geoipClose, _geoipCountryCodeByAddr, _geoipCountryIdByAddr, _geoipOpen, _geoipSeekCountry, _getOrg, _getRegion, _setupSegments, geoipCountryCodeByName, geoipCountryIdByName, geoipCountryNameByAddr, geoipCountryNameByName, geoipDatabaseInfo, geoipOrgByAddr, geoipRegionByAddr, getCountryByAddr,

__construct( ) : Dot_Geoip_Country

Description

Constructor

Return value

Type Description
Dot_Geoip_Country

Tags

Name Description
access public

_geoipClose( ) : bool

Description

Close opened file

Return value

Type Description
bool

Tags

Name Description
access private

_geoipCountryCodeByAddr( string   $addr, ) : string

Description

Get country code based on IP address

Arguments

Name Type Description Default
$addr string

Return value

Type Description
string

Tags

Name Description
access private

_geoipCountryIdByAddr( string   $addr, ) : int

Description

Get country id based on IP address

Arguments

Name Type Description Default
$addr string

Return value

Type Description
int

Tags

Name Description
access private

_geoipOpen( string   $filename, int   $flags, ) : void

Description

Open Geoip database

Arguments

Name Type Description Default
$filename string
$flags int

Return value

Type Description
void

Tags

Name Description
access private

_geoipSeekCountry(   $ipNum, ) : int

Description

Search the country based on IP address

Arguments

Name Type Description Default
$ipNum n/a

Return value

Type Description
int

Tags

Name Description
access private

_getOrg( string   $ipnum, ) : string

Description

Get GeoIP Organization by IP address Note: file GeoIPOrg.dat is required

Arguments

Name Type Description Default
$ipnum string

Return value

Type Description
string

_getRegion( object   $ipnum, ) : array

Description

Get GeoIp region based on IP address.

Return an array with country code and region name


Arguments

Name Type Description Default
$ipnum object

Return value

Type Description
array

Tags

Name Description
access private

_setupSegments( ) : void

Description

Setup segments from GeoIp

Return value

Type Description
void

Tags

Name Description
access private

geoipCountryCodeByName( string   $name, ) : string

Description

Get country code by name

Arguments

Name Type Description Default
$name string

Return value

Type Description
string

Tags

Name Description
access public

geoipCountryIdByName( string   $name, ) : int

Description

Get the country ID by name.

Return the ID of the country or false if no country found


Arguments

Name Type Description Default
$name string

Return value

Type Description
int

Tags

Name Description
access public

geoipCountryNameByAddr( string   $addr, ) : string

Description

Get country name based on IP address

Arguments

Name Type Description Default
$addr string

Return value

Type Description
string

Tags

Name Description
access public

geoipCountryNameByName( string   $name, ) : string

Description

Get country name by name

Arguments

Name Type Description Default
$name string

Return value

Type Description
string

Tags

Name Description
access public

geoipDatabaseInfo( string   $path, ) : string

Description

Get file version Return database name and version

Arguments

Name Type Description Default
$path string - path to GeoIP.dat database file

Return value

Type Description
string

Tags

Name Description
access public

geoipOrgByAddr( string   $addr, ) : string

Description

Get Orgasnization based on IP address

Arguments

Name Type Description Default
$addr string

Return value

Type Description
string

Tags

Name Description
access private

geoipRegionByAddr( string   $addr, ) : array

Description

Get GeoIp region based on IP address

Arguments

Name Type Description Default
$addr string

Return value

Type Description
array

Tags

Name Description
access public

getCountryByAddr( string   $path, string   $ip, ) : array

Description

Get the country by IP Return an array with : short name, like 'us' and long name, like 'United States'

Arguments

Name Type Description Default
$path string - path to GeoIP.dat database file
$ip string

Return value

Type Description
array

Tags

Name Description
access public

Properties

$_databaseSegments, $_databaseType, $_filehandle, $_flags, $_geoipContinentCodes, $_geoipCountryCodeToNumber, $_geoipCountryCodes, $_geoipCountryCodes3, $_geoipCountryNames, $_memoryBuffer, $_recordLength, $_shmid,

  private  $_databaseSegments =

Database segmentsint


  private  $_databaseType =

Database typeint


  private  $_filehandle =

File handle identifierresource


  private  $_flags =

Flags country codestring


  private  $_geoipContinentCodes = array

Array with continent codesarray


  private  $_geoipCountryCodeToNumber = array

Array with country code to number corespondencearray


  private  $_geoipCountryCodes = array

Array with country codes (2 chars)array


  private  $_geoipCountryCodes3 = array

Array with country codes (3 chars)array


  private  $_geoipCountryNames = array

Array with country namesarray


  private  $_memoryBuffer =

Memmory buffered - the read stringstring


  private  $_recordLength =

Record lengtint


  private  $_shmid =

ID returned by shmop_open() function to access the shared memory segment int


Documentation was generated by DocBlox.

Packages

  • Admin
    • Admin
      Admin Model Here are all the actions related to the user
    • Admin_View
      Admin View Class class that prepare output related to User controller
    • System
      System Model Here are all the actions related to the system settings
    • System_View
      System View Class class that prepare output related to User controller
    • User
      User Model Here are all the actions related to the user
    • User_View
      User View Class class that prepare output related to User controller
    • View
      Admin View abstract over the Dot_Template class
  • DotKernel
    • DotLibrary
    • Frontend
      • Page
        Page Model Dummy class, is not doing anything
      • Page
        Page Model Dummy class, is not doing anything yet
      • Page_View
        Page View Class functions that prepare output related to Page controller
      • User
        User Model Here are all the actions related to the user
      • User_View
        User View Class class that prepare output related to User controller
      • View
        View Model abstract over the Dot_Template class
    • Mobile
      • Page_View
        Page View Class functions that prepare output related to Page controller
      • View
        View Model abstract over the Dot_Template class
    • Rss
      • Sample
        Sample Model Here are all the actions related to the Sample
      • Sample_View
        Sample View Class
      • View
        View class - used for outputting rss content