diff --git a/reference/geoip/book.xml b/reference/geoip/book.xml
new file mode 100644
index 0000000..b0d335e
--- /dev/null
+++ b/reference/geoip/book.xml
@@ -0,0 +1,46 @@
+
+
+
+ Geo IP Location
+ 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.
+
+
+
+ This extension does not support MaxMind's current "GeoIP2" databases,
+ only the "GeoIP legacy" database files.
+
+
+
+
+ &reference.geoip.setup;
+ &reference.geoip.constants;
+ &reference.geoip.reference;
+
+
+
diff --git a/reference/geoip/constants.xml b/reference/geoip/constants.xml
new file mode 100644
index 0000000..b653bba
--- /dev/null
+++ b/reference/geoip/constants.xml
@@ -0,0 +1,190 @@
+
+
+
+ &reftitle.constants;
+ &extension.constants;
+
+
+
+ GEOIP_COUNTRY_EDITION
+ (int)
+
+
+
+
+
+
+
+
+
+ GEOIP_REGION_EDITION_REV0
+ (int)
+
+
+
+
+
+
+
+
+
+ GEOIP_CITY_EDITION_REV0
+ (int)
+
+
+
+
+
+
+
+
+
+ GEOIP_ORG_EDITION
+ (int)
+
+
+
+
+
+
+
+
+
+ GEOIP_ISP_EDITION
+ (int)
+
+
+
+
+
+
+
+
+
+ GEOIP_CITY_EDITION_REV1
+ (int)
+
+
+
+
+
+
+
+
+
+ GEOIP_REGION_EDITION_REV1
+ (int)
+
+
+
+
+
+
+
+
+
+ GEOIP_PROXY_EDITION
+ (int)
+
+
+
+
+
+
+
+
+
+ GEOIP_ASNUM_EDITION
+ (int)
+
+
+
+
+
+
+
+
+
+ GEOIP_NETSPEED_EDITION
+ (int)
+
+
+
+
+
+
+
+
+
+ GEOIP_DOMAIN_EDITION
+ (int)
+
+
+
+
+
+
+
+
+
+ The following constants are for net speed:
+
+
+
+
+ GEOIP_UNKNOWN_SPEED
+ (int)
+
+
+
+
+
+
+
+ GEOIP_DIALUP_SPEED
+ (int)
+
+
+
+
+
+
+
+ GEOIP_CABLEDSL_SPEED
+ (int)
+
+
+
+
+
+
+
+ GEOIP_CORPORATE_SPEED
+ (int)
+
+
+
+
+
+
+
+
diff --git a/reference/geoip/functions/geoip-asnum-by-name.xml b/reference/geoip/functions/geoip-asnum-by-name.xml
new file mode 100644
index 0000000..675773a
--- /dev/null
+++ b/reference/geoip/functions/geoip-asnum-by-name.xml
@@ -0,0 +1,89 @@
+
+
+
+
+ geoip_asnum_by_name
+ Get the Autonomous System Numbers (ASN)
+
+
+ &reftitle.description;
+
+ stringgeoip_asnum_by_name
+ stringhostname
+
+
+
+ The geoip_asnum_by_name function will return the Autonomous
+ System Numbers (ASN) associated with an IP address.
+
+
+
+
+ &reftitle.parameters;
+
+
+ hostname
+
+
+ The hostname or IP address.
+
+
+
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the ASN on success, or &false; if the address
+ cannot be found in the database.
+
+
+
+
+ &reftitle.examples;
+
+ A geoip_asnum_by_name example
+
+ This will output the ASN of the host www.example.com.
+
+
+
+]]>
+
+ &example.outputs;
+
+
+
+
+
+
+
+
diff --git a/reference/geoip/functions/geoip-continent-code-by-name.xml b/reference/geoip/functions/geoip-continent-code-by-name.xml
new file mode 100644
index 0000000..613b339
--- /dev/null
+++ b/reference/geoip/functions/geoip-continent-code-by-name.xml
@@ -0,0 +1,136 @@
+
+
+
+
+ geoip_continent_code_by_name
+ Get the two letter continent code
+
+
+ &reftitle.description;
+
+ stringgeoip_continent_code_by_name
+ stringhostname
+
+
+
+ The geoip_continent_code_by_name function will return
+ the two letter continent 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 continent code on success, or &false; if the
+ address cannot be found in the database.
+
+
+ Continent codes
+
+
+
+ Code
+ Continent name
+
+
+
+
+ AF
+ Africa
+
+
+ AN
+ Antarctica
+
+
+ AS
+ Asia
+
+
+ EU
+ Europe
+
+
+ NA
+ North america
+
+
+ OC
+ Oceania
+
+
+ SA
+ South america
+
+
+
+
+
+
+
+ &reftitle.examples;
+
+ A geoip_continent_code_by_name example
+
+ This will print where the host example.com is located.
+
+
+
+]]>
+
+ &example.outputs;
+
+
+
+
+
+
+
+ &reftitle.seealso;
+
+ geoip_country_code_by_name
+
+
+
+
+
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 0000000..1407a18
--- /dev/null
+++ b/reference/geoip/functions/geoip-country-code-by-name.xml
@@ -0,0 +1,107 @@
+
+
+
+
+ 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 geoip_country_code_by_name example
+
+ This will print where the host example.com is located.
+
+
+
+]]>
+
+ &example.outputs;
+
+
+
+
+
+
+
+ &reftitle.notes;
+
+
+ Please see
+ &url.maxmind.iso3166; for
+ a complete list of possible return values, including special codes.
+
+
+
+
+
+ &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 0000000..7fc0433
--- /dev/null
+++ b/reference/geoip/functions/geoip-country-code3-by-name.xml
@@ -0,0 +1,96 @@
+
+
+
+
+ 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 geoip_country_code3_by_name 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 0000000..e10ae38
--- /dev/null
+++ b/reference/geoip/functions/geoip-country-name-by-name.xml
@@ -0,0 +1,96 @@
+
+
+
+
+ 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 geoip_country_name_by_name 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 0000000..120d055
--- /dev/null
+++ b/reference/geoip/functions/geoip-database-info.xml
@@ -0,0 +1,92 @@
+
+
+
+
+ geoip_database_info
+ Get GeoIP Database information
+
+
+ &reftitle.description;
+
+ stringgeoip_database_info
+ intdatabaseGEOIP_COUNTRY_EDITION
+
+
+
+ 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 geoip_database_info example
+
+ This will output information regarding the database.
+
+
+
+]]>
+
+ &example.outputs;
+
+
+
+
+
+
+
+
diff --git a/reference/geoip/functions/geoip-db-avail.xml b/reference/geoip/functions/geoip-db-avail.xml
new file mode 100644
index 0000000..583b6d6
--- /dev/null
+++ b/reference/geoip/functions/geoip-db-avail.xml
@@ -0,0 +1,93 @@
+
+
+
+
+ geoip_db_avail
+ Determine if GeoIP Database is available
+
+
+ &reftitle.description;
+
+ boolgeoip_db_avail
+ intdatabase
+
+
+
+ The geoip_db_avail function returns if the corresponding
+ GeoIP Database is available and can be opened on disk.
+
+
+
+ It does not indicate if the file is a proper database, only if it is readable.
+
+
+
+
+ &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 &true; is database exists, &false; if not found, or &null; on error.
+
+
+
+
+ &reftitle.examples;
+
+ A geoip_db_avail example
+
+ This will output the current database version string.
+
+
+
+]]>
+
+ &example.outputs;
+
+
+
+
+
+
+
+
diff --git a/reference/geoip/functions/geoip-db-filename.xml b/reference/geoip/functions/geoip-db-filename.xml
new file mode 100644
index 0000000..39eaae6
--- /dev/null
+++ b/reference/geoip/functions/geoip-db-filename.xml
@@ -0,0 +1,94 @@
+
+
+
+
+ geoip_db_filename
+ Returns the filename of the corresponding GeoIP Database
+
+
+ &reftitle.description;
+
+ stringgeoip_db_filename
+ intdatabase
+
+
+
+ The geoip_db_filename function returns the filename of
+ the corresponding GeoIP Database.
+
+
+
+ It does not indicate if the file exists or not on disk, only where the library
+ is looking for the database.
+
+
+
+
+ &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 filename of the corresponding database, or &null; on error.
+
+
+
+
+ &reftitle.examples;
+
+ A geoip_db_filename example
+
+ This will output the filename of the corresponding database.
+
+
+
+]]>
+
+ &example.outputs;
+
+
+
+
+
+
+
+
diff --git a/reference/geoip/functions/geoip-db-get-all-info.xml b/reference/geoip/functions/geoip-db-get-all-info.xml
new file mode 100644
index 0000000..bbdab2b
--- /dev/null
+++ b/reference/geoip/functions/geoip-db-get-all-info.xml
@@ -0,0 +1,152 @@
+
+
+
+
+ geoip_db_get_all_info
+ Returns detailed information about all GeoIP database types
+
+
+ &reftitle.description;
+
+ arraygeoip_db_get_all_info
+
+
+
+
+ The geoip_db_get_all_info function will return
+ detailed information as a multi-dimensional array about all the
+ GeoIP database types.
+
+
+ This function is available even if no databases are installed. It
+ will simply list them as non-available.
+
+
+ The names of the different keys of the returning associative array are as follows:
+
+
+
+
+ "available" -- Boolean, indicate if DB is available (see
+ geoip_db_avail)
+
+
+
+
+ "description" -- The database description
+
+
+
+
+ "filename" -- The database filename on disk (see
+ geoip_db_filename)
+
+
+
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the associative array.
+
+
+
+
+ &reftitle.examples;
+
+ A geoip_db_get_all_info example
+
+ This will print the array containing all the information.
+
+
+
+]]>
+
+ &example.outputs;
+
+
+ array(3) {
+ ["available"]=>
+ bool(true)
+ ["description"]=>
+ string(21) "GeoIP Country Edition"
+ ["filename"]=>
+ string(32) "/usr/share/GeoIP/GeoIP.dat"
+ }
+
+[ ... ]
+
+ [11]=>
+ array(3) {
+ ["available"]=>
+ bool(false)
+ ["description"]=>
+ string(25) "GeoIP Domain Name Edition"
+ ["filename"]=>
+ string(38) "/usr/share/GeoIP/GeoIPDomain.dat"
+ }
+}
+]]>
+
+
+
+
+ A geoip_db_get_all_info example
+
+ You can use the various constants as keys to get only parts of the information.
+
+
+
+]]>
+
+ &example.outputs;
+
+
+
+
+
+
+
+
diff --git a/reference/geoip/functions/geoip-domain-by-name.xml b/reference/geoip/functions/geoip-domain-by-name.xml
new file mode 100644
index 0000000..5884d9e
--- /dev/null
+++ b/reference/geoip/functions/geoip-domain-by-name.xml
@@ -0,0 +1,95 @@
+
+
+
+
+ geoip_domain_by_name
+ Get the second level domain name
+
+
+ &reftitle.description;
+
+ stringgeoip_domain_by_name
+ stringhostname
+
+
+
+ The geoip_domain_by_name function will return the second level
+ domain names associated with a hostname or an IP address.
+
+
+ This function is currently only available to users who have bought a commercial
+ GeoIP Domain 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 domain name on success, or &false; if the address
+ cannot be found in the database.
+
+
+
+
+ &reftitle.examples;
+
+ A geoip_domain_by_name example
+
+ This will output the domain associated with IP 61.106.139.1.
+
+
+
+]]>
+
+ &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 0000000..363601c
--- /dev/null
+++ b/reference/geoip/functions/geoip-id-by-name.xml
@@ -0,0 +1,126 @@
+
+
+
+
+ geoip_id_by_name
+ Get the Internet connection type
+
+
+ &reftitle.description;
+
+ intgeoip_id_by_name
+ stringhostname
+
+
+
+ The geoip_id_by_name function will return the Internet
+ connection type 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 connection type is to be looked-up.
+
+
+
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the connection type.
+
+
+
+
+ &reftitle.examples;
+
+ A geoip_id_by_name example
+
+ This will output the connection type of the host example.com.
+
+
+
+]]>
+
+ &example.outputs;
+
+
+
+
+
+
+
+
diff --git a/reference/geoip/functions/geoip-isp-by-name.xml b/reference/geoip/functions/geoip-isp-by-name.xml
new file mode 100644
index 0000000..8106353
--- /dev/null
+++ b/reference/geoip/functions/geoip-isp-by-name.xml
@@ -0,0 +1,93 @@
+
+
+
+
+ geoip_isp_by_name
+ Get the Internet Service Provider (ISP) name
+
+
+ &reftitle.description;
+
+ stringgeoip_isp_by_name
+ stringhostname
+
+
+
+ The geoip_isp_by_name function will return the name of
+ the Internet Service Provider (ISP) that an IP is assigned to.
+
+
+ This function is currently only available to users who have bought a commercial
+ GeoIP ISP 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 ISP name on success, or &false; if the address
+ cannot be found in the database.
+
+
+
+
+ &reftitle.examples;
+
+ A geoip_isp_by_name example
+
+ This will print the ISP name of host example.com.
+
+
+
+]]>
+
+ &example.outputs;
+
+
+
+
+
+
+
+
diff --git a/reference/geoip/functions/geoip-netspeedcell-by-name.xml b/reference/geoip/functions/geoip-netspeedcell-by-name.xml
new file mode 100644
index 0000000..f71ac26
--- /dev/null
+++ b/reference/geoip/functions/geoip-netspeedcell-by-name.xml
@@ -0,0 +1,122 @@
+
+
+
+
+ geoip_netspeedcell_by_name
+ Get the Internet connection speed
+
+
+ &reftitle.description;
+
+ stringgeoip_netspeedcell_by_name
+ stringhostname
+
+
+
+ The geoip_netspeedcell_by_name function will return the Internet
+ connection type and speed corresponding to a hostname or an IP address.
+
+
+ This function is only available if using GeoIP Library version 1.4.8 or newer.
+
+
+ This function is currently only available to users who have bought a commercial
+ GeoIP NetSpeedCell Edition. A warning will be issued if the proper database cannot be
+ located.
+
+
+ The return value is a string, common values are:
+
+
+
+
+ Cable/DSL
+
+
+
+
+ Dialup
+
+
+
+
+ Cellular
+
+
+
+
+ Corporate
+
+
+
+
+
+
+ &reftitle.parameters;
+
+
+ hostname
+
+
+ The hostname or IP address.
+
+
+
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the connection speed on success, or &false; if the address
+ cannot be found in the database.
+
+
+
+
+ &reftitle.examples;
+
+ A geoip_netspeedcell_by_name example
+
+ This will output the connection 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 0000000..db7be7a
--- /dev/null
+++ b/reference/geoip/functions/geoip-org-by-name.xml
@@ -0,0 +1,93 @@
+
+
+
+
+ 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 geoip_org_by_name 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 0000000..73fbef3
--- /dev/null
+++ b/reference/geoip/functions/geoip-record-by-name.xml
@@ -0,0 +1,198 @@
+
+
+
+
+ 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:
+
+
+
+
+ "continent_code" -- Two letter continent code (as of version 1.0.4 with
+ libgeoip 1.4.3 or newer)
+
+
+
+
+ "country_code" -- Two letter country code (see
+ geoip_country_code_by_name)
+
+
+
+
+ "country_code3" -- Three letter country code (see
+ geoip_country_code3_by_name)
+
+
+
+
+ "country_name" -- The country name (see
+ geoip_country_name_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 float.
+
+
+
+
+ "longitude" -- The Longitude as signed float.
+
+
+
+
+ "dma_code" -- Designated Market Area code (USA and Canada only)
+
+
+
+
+ "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.changelog;
+
+
+
+
+ &Version;
+ &Description;
+
+
+
+
+ PECL geoip 1.0.4
+
+ Adding the continent_code with GeoIP Library 1.4.3 or newer only
+
+
+
+ PECL geoip 1.0.3
+
+ Adding country_code3 and country_name
+
+
+
+
+
+
+
+
+ &reftitle.examples;
+
+ A geoip_record_by_name example
+
+ This will print the array containing the record of host example.com.
+
+
+
+]]>
+
+ &example.outputs;
+
+ NA
+ [country_code] => US
+ [country_code3] => USA
+ [country_name] => United States
+ [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 0000000..af298da
--- /dev/null
+++ b/reference/geoip/functions/geoip-region-by-name.xml
@@ -0,0 +1,113 @@
+
+
+
+
+ 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 geoip_region_by_name 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/functions/geoip-region-name-by-code.xml b/reference/geoip/functions/geoip-region-name-by-code.xml
new file mode 100644
index 0000000..73b203b
--- /dev/null
+++ b/reference/geoip/functions/geoip-region-name-by-code.xml
@@ -0,0 +1,136 @@
+
+
+
+
+ geoip_region_name_by_code
+ Returns the region name for some country and region code combo
+
+
+ &reftitle.description;
+
+ stringgeoip_region_name_by_code
+ stringcountry_code
+ stringregion_code
+
+
+
+ The geoip_region_name_by_code function will return the region
+ name corresponding to a country and region code combo.
+
+
+ In the United States, the region code corresponds to the two-letter abbreviation
+ of each state. In Canada, the region code corresponds to the two-letter province or
+ territory code as attributed by Canada Post.
+
+
+ For the rest of the world, GeoIP uses FIPS 10-4 codes to represent regions.
+ You can check &url.maxmind.fips;
+ for a detailed list of FIPS 10-4 codes.
+
+
+ This function is always available if using GeoIP Library version 1.4.1 or newer. The
+ data is taken directly from the GeoIP Library and not from any database.
+
+
+
+ &reftitle.parameters;
+
+
+ country_code
+
+
+ The two-letter country code (see
+ geoip_country_code_by_name)
+
+
+
+
+ region_code
+
+
+ The two-letter (or digit) region code (see
+ geoip_region_by_name)
+
+
+
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the region name on success, or &false; if the country and region code
+ combo cannot be found.
+
+
+
+
+ &reftitle.examples;
+
+
+ A geoip_region_name_by_code example using region code for US/Canada
+
+ This will print the region name for country CA (Canada), region QC (Quebec).
+
+
+
+]]>
+
+ &example.outputs;
+
+
+
+
+
+ A geoip_region_name_by_code example using FIPS codes
+
+ This will print the region name for country JP (Japan), region 01.
+
+
+
+]]>
+
+ &example.outputs;
+
+
+
+
+
+
+
+
+
diff --git a/reference/geoip/functions/geoip-setup-custom-directory.xml b/reference/geoip/functions/geoip-setup-custom-directory.xml
new file mode 100644
index 0000000..734c05a
--- /dev/null
+++ b/reference/geoip/functions/geoip-setup-custom-directory.xml
@@ -0,0 +1,89 @@
+
+
+
+
+ geoip_setup_custom_directory
+ Set a custom directory for the GeoIP database
+
+
+ &reftitle.description;
+
+ voidgeoip_setup_custom_directory
+ stringpath
+
+
+
+ The geoip_setup_custom_directory function will change the
+ default directory of the GeoIP database. This is equivalent to changing
+ geoip.custom_directory.
+
+
+
+
+ &reftitle.parameters;
+
+
+ path
+
+
+ The full path of where the GeoIP database is on disk.
+
+
+
+
+
+
+ &reftitle.returnvalues;
+
+ &return.void;
+
+
+
+
+ &reftitle.examples;
+
+ A geoip_setup_custom_directory example
+
+ This will change the GeoIP default database path.
+
+
+
+]]>
+
+ &example.outputs;
+
+
+
+
+
+
+
+
diff --git a/reference/geoip/functions/geoip-time-zone-by-country-and-region.xml b/reference/geoip/functions/geoip-time-zone-by-country-and-region.xml
new file mode 100644
index 0000000..9aa2eed
--- /dev/null
+++ b/reference/geoip/functions/geoip-time-zone-by-country-and-region.xml
@@ -0,0 +1,136 @@
+
+
+
+
+ geoip_time_zone_by_country_and_region
+ Returns the time zone for some country and region code combo
+
+
+ &reftitle.description;
+
+ stringgeoip_time_zone_by_country_and_region
+ stringcountry_code
+ stringregion_code
+
+
+
+ The geoip_time_zone_by_country_and_region function will return the
+ time zone corresponding to a country and region code combo.
+
+
+ In the United States, the region code corresponds to the two-letter abbreviation
+ of each state. In Canada, the region code corresponds to the two-letter province or
+ territory code as attributed by Canada Post.
+
+
+ For the rest of the world, GeoIP uses FIPS 10-4 codes to represent regions.
+ You can check &url.maxmind.fips;
+ for a detailed list of FIPS 10-4 codes.
+
+
+ This function is always available if using GeoIP Library version 1.4.1 or newer. The
+ data is taken directly from the GeoIP Library and not from any database.
+
+
+
+ &reftitle.parameters;
+
+
+ country_code
+
+
+ The two-letter country code (see
+ geoip_country_code_by_name)
+
+
+
+
+ region_code
+
+
+ The two-letter (or digit) region code (see
+ geoip_region_by_name)
+
+
+
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the time zone on success, or &false; if the country and region code
+ combo cannot be found.
+
+
+
+
+ &reftitle.examples;
+
+
+ A geoip_time_zone_by_country_and_region example using region code for US/Canada
+
+ This will print the time zone for country CA (Canada), region QC (Quebec).
+
+
+
+]]>
+
+ &example.outputs;
+
+
+
+
+
+ A geoip_time_zone_by_country_and_region example using FIPS codes
+
+ This will print the time zone for country JP (Japan), region 01 (Aichi).
+
+
+
+]]>
+
+ &example.outputs;
+
+
+
+
+
+
+
+
+
diff --git a/reference/geoip/ini.xml b/reference/geoip/ini.xml
new file mode 100644
index 0000000..55b05fb
--- /dev/null
+++ b/reference/geoip/ini.xml
@@ -0,0 +1,43 @@
+
+
+
+ &reftitle.runtime;
+ &extension.runtime;
+
+
+ &ini.descriptions.title;
+
+
+
+
+ geoip.custom_directory
+ string
+
+
+
+ Empty by default, but can be set to force a different database path than the one compiled in the library.
+
+
+
+
+
diff --git a/reference/geoip/reference.xml b/reference/geoip/reference.xml
new file mode 100644
index 0000000..2440b29
--- /dev/null
+++ b/reference/geoip/reference.xml
@@ -0,0 +1,29 @@
+
+
+
+
+ GeoIP &Functions;
+ &reference.geoip.entities.functions;
+
+
+
+
diff --git a/reference/geoip/setup.xml b/reference/geoip/setup.xml
new file mode 100644
index 0000000..9b3f8dc
--- /dev/null
+++ b/reference/geoip/setup.xml
@@ -0,0 +1,55 @@
+
+
+
+ &reftitle.setup;
+
+
+ &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
+ &url.maxmind.geoip;
+ 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.
+
+
+
+ &reference.geoip.ini;
+
+
+
diff --git a/reference/geoip/versions.xml b/reference/geoip/versions.xml
new file mode 100644
index 0000000..b95d4cb
--- /dev/null
+++ b/reference/geoip/versions.xml
@@ -0,0 +1,47 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+