apidoc
[ class tree: apidoc ] [ index: apidoc ] [ all elements ]

Class: Net_Geo

Source Location: /Net_Geo-1.0.5/Net/Geo.php

Class Overview




Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 76]


[ Top ]


Class Variables

$cache_path =  "/tmp/"

[line 86]

Path to local cache file.

Caching is compulsory to reduce load on CAIDA server

  • Access: public

Type:   string


[ Top ]

$cache_ttl =  30

[line 95]

How long to wait befire rechecking cached entries in *days* This should be something nice and high
  • Access: public

Type:   in


[ Top ]

$default_caida_server =  "http://netgeo.caida.org/perl/netgeo.cgi"

[line 118]

CAIDA only

Location of the default netgeo server If port not specified, defaults to 80

  • Access: public

Type:   string


[ Top ]

$default_hostip_server =  "http://api.hostip.info/"

[line 129]

HostIP only

Location of the default hostip server If port not specified, defaults to 80

  • Access: public

Type:   string


[ Top ]

$default_timeout =  60

[line 107]

CAIDA only

Maximum length of time, in seconds, which will be allowed during a whois lookup by the NetGeo server. The actual default value is maintained by the server.

  • Access: public

Type:   int


[ Top ]

$localizer_data =  "./demo.csv"

[line 139]

localizer only

Location of the localizer data file

  • Access: public

Type:   string


[ Top ]

$service =

[line 148]

Type of service to use. May be either 'caida' or 'localizer' Default is 'caida'

Type:   string


[ Top ]



Method Detail

Net_Geo (Constructor)   [line 242]

bool Net_Geo( [string $applicationName = ""], [string $alternateServerUrl = ""])

Constructor Both $applicationName and $alternateServerUrl are for compatibility with the perl and java netgeo classes.

I don't guarantee to use these variables

  • Access: public

Parameters:

string   $applicationName   —  Application using the NetGeo class.
string   $alternateServerUrl   —  Alternate NetGeo server url

[ Top ]

getCountry   [line 361]

array getCountry( string $target)

Returns the 2-letter ISO 3166 country code Returns NO_MATCH if the AS number has been looked up but nothing was found in the whois lookups.

Returns NO_COUNTRY if the lookup returned a record but no country could be found. Returns an empty string if nothing was found in the database

  • Access: public

Parameters:

string   $target   —  single address

[ Top ]

getLat   [line 397]

double getLat( $latLongRef, string $target)

Included here to make the NetGeo class as similar as possible to the NetGeoClient.java interface.

It's probably just as easy for the user to extract lat and long directly from the array.

  • Access: public

Parameters:

string   $target   —  single address
   $latLongRef   — 

[ Top ]

getLatLong   [line 382]

array getLatLong( string $target)

Returns an array with keys LAT, LONG, LAT_LONG_GRAN, and STATUS.

Lat/Long will be (0,0) if the target has been looked up but there was no match in the whois lookups, or if no address could be parsed from the whois record, or if the lat/long for the address is unknown. Returns an empty string if nothing was found in the database

  • Access: public

Parameters:

string   $target   —  single address

[ Top ]

getLong   [line 418]

double getLong( $latLongHashRef, string $target)

Included here to make the NetGeo class as similar as possible to the NetGeoClient.java interface.

It's probably just as easy for the user to extract lat and long directly from the array

  • Access: public

Parameters:

string   $target   —  single address
   $latLongHashRef   — 

[ Top ]

getRecord   [line 344]

array getRecord( mixed $target)

Gets a complete record for an address Returns either a single or multidimentional arrray if input is a string or an array respectively
  • Access: public

Parameters:

mixed   $target   —  Single or list of addresses

[ Top ]

setService   [line 265]

bool setService( [string $service = "caida"])

Sets the service to use to lookup data (defaults to 'caida')
  • Access: public

Parameters:

string   $service   —  Service to use (caida, hostip or localizer)

[ Top ]


Documentation generated on Mon, 11 Mar 2019 15:40:19 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.