diff --git a/reference/geoip/constants.xml b/reference/geoip/constants.xml new file mode 100644 index 0000000000..42b601bf56 --- /dev/null +++ b/reference/geoip/constants.xml @@ -0,0 +1,191 @@ + + +
+ &reftitle.constants; + &extension.constants; + + + + GEOIP_COUNTRY_EDITION + (integer) + + + + + + + + + + GEOIP_REGION_EDITION_REV0 + (integer) + + + + + + + + + + GEOIP_CITY_EDITION_REV0 + (integer) + + + + + + + + + + GEOIP_ORG_EDITION + (integer) + + + + + + + + + + GEOIP_ISP_EDITION + (integer) + + + + + + + + + + GEOIP_CITY_EDITION_REV1 + (integer) + + + + + + + + + + GEOIP_REGION_EDITION_REV1 + (integer) + + + + + + + + + + GEOIP_PROXY_EDITION + (integer) + + + + + + + + + + GEOIP_ASNUM_EDITION + (integer) + + + + + + + + + + GEOIP_NETSPEED_EDITION + (integer) + + + + + + + + + + GEOIP_DOMAIN_EDITION + (integer) + + + + + + + + + + The following constants are for net speed: + + + + + GEOIP_UNKNOWN_SPEED + (integer) + + + + + + + + GEOIP_DIALUP_SPEED + (integer) + + + + + + + + GEOIP_CABLEDSL_SPEED + (integer) + + + + + + + + GEOIP_CORPORATE_SPEED + (integer) + + + + + + +
+ + diff --git a/reference/geoip/functions/geoip-country-code-by-name.xml b/reference/geoip/functions/geoip-country-code-by-name.xml new file mode 100644 index 0000000000..f394d21cd2 --- /dev/null +++ b/reference/geoip/functions/geoip-country-code-by-name.xml @@ -0,0 +1,103 @@ + + + + + geoip_country_code_by_name + Get the two letter country code + + + &reftitle.description; + + stringgeoip_country_code_by_name + stringhostname + + + + The geoip_country_code_by_name function will return + the two letter country code corresponding to a hostname or an IP address. + + + + + &reftitle.parameters; + + + + hostname + + + The hostname or IP address whose location is to be looked-up. + + + + + + + + &reftitle.returnvalues; + + Returns the two letter ISO country code on success, or &false; + if the address cannot be found in the database. + + + + + &reftitle.examples; + + + A <function>geoip_country_code_by_name</function> example + + This will print where the host example.com is located. + + + +]]> + + &example.outputs; + + + + + + + + + &reftitle.seealso; + + + geoip_country_code3_by_name + geoip_country_name_by_name + + + + + + + diff --git a/reference/geoip/functions/geoip-country-code3-by-name.xml b/reference/geoip/functions/geoip-country-code3-by-name.xml new file mode 100644 index 0000000000..3bb983e0bc --- /dev/null +++ b/reference/geoip/functions/geoip-country-code3-by-name.xml @@ -0,0 +1,103 @@ + + + + + geoip_country_code3_by_name + Get the three letter country code + + + &reftitle.description; + + stringgeoip_country_code3_by_name + stringhostname + + + + The geoip_country_code3_by_name function will return the + three letter country code corresponding to a hostname or an IP address. + + + + + &reftitle.parameters; + + + + hostname + + + The hostname or IP address whose location is to be looked-up. + + + + + + + + &reftitle.returnvalues; + + Returns the three letter country code on success, or &false; + if the address cannot be found in the database. + + + + + &reftitle.examples; + + + A <function>geoip_country_code3_by_name</function> example + + This will print where the host example.com is located. + + + +]]> + + &example.outputs; + + + + + + + + + &reftitle.seealso; + + + geoip_country_code_by_name + geoip_country_name_by_name + + + + + + + diff --git a/reference/geoip/functions/geoip-country-name-by-name.xml b/reference/geoip/functions/geoip-country-name-by-name.xml new file mode 100644 index 0000000000..6f0893f95f --- /dev/null +++ b/reference/geoip/functions/geoip-country-name-by-name.xml @@ -0,0 +1,103 @@ + + + + + geoip_country_name_by_name + Get the full country name + + + &reftitle.description; + + stringgeoip_country_name_by_name + stringhostname + + + + The geoip_country_name_by_name function will return the + full country name corresponding to a hostname or an IP address. + + + + + &reftitle.parameters; + + + + hostname + + + The hostname or IP address whose location is to be looked-up. + + + + + + + + &reftitle.returnvalues; + + Returns the country name on success, or &false; if the address cannot + be found in the database. + + + + + &reftitle.examples; + + + A <function>geoip_country_name_by_name</function> example + + This will print where the host example.com is located. + + + +]]> + + &example.outputs; + + + + + + + + + &reftitle.seealso; + + + geoip_country_code_by_name + geoip_country_code3_by_name + + + + + + + diff --git a/reference/geoip/functions/geoip-database-info.xml b/reference/geoip/functions/geoip-database-info.xml new file mode 100644 index 0000000000..60c192b1e6 --- /dev/null +++ b/reference/geoip/functions/geoip-database-info.xml @@ -0,0 +1,97 @@ + + + + + geoip_database_info + Get GeoIP Database information + + + &reftitle.description; + + stringgeoip_database_info + intdatabase + + + + The geoip_database_info function returns the corresponding + GeoIP Database version as it is defined inside the binary file. + + + + If this function is called without arguments, it returns the version + of the GeoIP Free Country Edition. + + + + + &reftitle.parameters; + + + + database + + + The database type as an integer. You can use the + various constants defined with + this extension (ie: GEOIP_*_EDITION). + + + + + + + + + &reftitle.returnvalues; + + Returns the corresponding database version, or &null; on error. + + + + + &reftitle.examples; + + + A <function>geoip_region_by_name</function> example + + This will output the current database version string. + + + +]]> + + &example.outputs; + + + + + + + + + + diff --git a/reference/geoip/functions/geoip-id-by-name.xml b/reference/geoip/functions/geoip-id-by-name.xml new file mode 100644 index 0000000000..9ed801ffff --- /dev/null +++ b/reference/geoip/functions/geoip-id-by-name.xml @@ -0,0 +1,133 @@ + + + + + geoip_id_by_name + Get the Internet connection speed + + + &reftitle.description; + + integergeoip_id_by_name + stringhostname + + + + The geoip_id_by_name function will return the country + and region corresponding to a hostname or an IP address. + + + The return value is numeric and can be compared to the following constants: + + + + + + GEOIP_UNKNOWN_SPEED + + + + + GEOIP_DIALUP_SPEED + + + + + GEOIP_CABLEDSL_SPEED + + + + + GEOIP_CORPORATE_SPEED + + + + + + + + &reftitle.parameters; + + + + hostname + + + The hostname or IP address whose net speed is to be looked-up. + + + + + + + + &reftitle.returnvalues; + + Returns the net speed. + + + + + &reftitle.examples; + + + A <function>geoip_id_by_name</function> example + + This will output the net speed of the host example.com. + + + +]]> + + &example.outputs; + + + + + + + + + + diff --git a/reference/geoip/functions/geoip-org-by-name.xml b/reference/geoip/functions/geoip-org-by-name.xml new file mode 100644 index 0000000000..4207ec21a5 --- /dev/null +++ b/reference/geoip/functions/geoip-org-by-name.xml @@ -0,0 +1,98 @@ + + + + + geoip_org_by_name + Get the organization name + + + &reftitle.description; + + stringgeoip_org_by_name + stringhostname + + + + The geoip_org_by_name function will return the name of + the organization that an IP is assigned to. + + + This function is currently only available to users who have bought a commercial + GeoIP Organization, ISP or AS Edition. A warning will be issued if the proper + database cannot be located. + + + + + &reftitle.parameters; + + + + hostname + + + The hostname or IP address. + + + + + + + + &reftitle.returnvalues; + + Returns the organization name on success, or &false; if the address + cannot be found in the database. + + + + + &reftitle.examples; + + + A <function>geoip_org_by_name</function> example + + This will print to whom the host example.com IP is allocated. + + + +]]> + + &example.outputs; + + + + + + + + + + diff --git a/reference/geoip/functions/geoip-record-by-name.xml b/reference/geoip/functions/geoip-record-by-name.xml new file mode 100644 index 0000000000..3e83801d13 --- /dev/null +++ b/reference/geoip/functions/geoip-record-by-name.xml @@ -0,0 +1,156 @@ + + + + + geoip_record_by_name + Returns the detailed City information found in the GeoIP Database + + + &reftitle.description; + + arraygeoip_record_by_name + stringhostname + + + + The geoip_record_by_name function will return the + record information corresponding to a hostname or an IP address. + + + This function is available for both GeoLite City Edition and commercial GeoIP + City Edition. A warning will be issued if the proper database cannot be + located. + + + The names of the different keys of the returning associative array are as follows: + + + + + + "country_code" -- Two letter country code (see + geoip_country_code_by_name) + + + + + "region" -- The region code (ex: CA for California) + + + + + "city" -- The city. + + + + + "postal_code" -- The Postal Code, FSA or Zip Code. + + + + + "latitude" -- The Latitude as signed double. + + + + + "longitude" -- The Longitude as signed double. + + + + + "dma_code" + + + + + "area_code" -- The PSTN area code (ex: 212) + + + + + + + + &reftitle.parameters; + + + + hostname + + + The hostname or IP address whose record is to be looked-up. + + + + + + + + &reftitle.returnvalues; + + Returns the associative array on success, or &false; if the address + cannot be found in the database. + + + + + &reftitle.examples; + + + A <function>geoip_record_by_name</function> example + + This will print the array containing the record of host example.com. + + + +]]> + + &example.outputs; + + US + [region] => CA + [city] => Marina Del Rey + [postal_code] => + [latitude] => 33.9776992798 + [longitude] => -118.435096741 + [dma_code] => 803 + [area_code] => 310 +) +]]> + + + + + + + + diff --git a/reference/geoip/functions/geoip-region-by-name.xml b/reference/geoip/functions/geoip-region-by-name.xml new file mode 100644 index 0000000000..66b17f7adf --- /dev/null +++ b/reference/geoip/functions/geoip-region-by-name.xml @@ -0,0 +1,120 @@ + + + + + geoip_region_by_name + Get the country code and region + + + &reftitle.description; + + arraygeoip_region_by_name + stringhostname + + + + The geoip_region_by_name function will return the country + and region corresponding to a hostname or an IP address. + + + This function is currently only available to users who have bought a commercial + GeoIP Region Edition. A warning will be issued if the proper database cannot be + located. + + + The names of the different keys of the returning associative array are as follows: + + + + + + "country_code" -- Two letter country code (see + geoip_country_code_by_name) + + + + + "region" -- The region code (ex: CA for California) + + + + + + + &reftitle.parameters; + + + + hostname + + + The hostname or IP address whose region is to be looked-up. + + + + + + + + &reftitle.returnvalues; + + Returns the associative array on success, or &false; if the address + cannot be found in the database. + + + + + &reftitle.examples; + + + A <function>geoip_region_by_name</function> example + + This will print the array containing the country code and region + of the host example.com. + + + +]]> + + &example.outputs; + + US + [region] => CA +) +]]> + + + + + + + + diff --git a/reference/geoip/reference.xml b/reference/geoip/reference.xml new file mode 100644 index 0000000000..178ee38064 --- /dev/null +++ b/reference/geoip/reference.xml @@ -0,0 +1,74 @@ + + + + + + GeoIP Functions + GeoIP + + +
+ &reftitle.intro; + + The GeoIP extension allows you to find the location of an IP address. City, + State, Country, Longitude, Latitude, and other information as all, such as + ISP and connection type can be obtained with the help of GeoIP. + +
+
+ &reftitle.required; + + This extension requires the GeoIP C library version 1.4.0 or higher to be + installed. You can grab the latest version from + http://www.maxmind.com/app/c + and compile it yourself. + + + By default, you will only have access to the Free GeoIP Country or GeoLite + City databases. While this module can work with other types of database, + you must buy a commercial license from + Maxmind. + +
+ +
+ &reftitle.install; + + &pecl.moved; + + + &pecl.info; + &url.pecl.package;geoip. + +
+ +
+ &reftitle.resources; + &no.resource; +
+ + &reference.geoip.constants; +
+ &reference.geoip.functions; +
+ +