Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions reference/geoip/book.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?xml version="1.0" encoding="utf-8"?>
<book xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="book.geoip">
<?phpdoc extension-membership="pecl" ?>
<title>Geo IP Location</title>
<titleabbrev>GeoIP</titleabbrev>

<preface xml:id="intro.geoip">
&reftitle.intro;
<simpara>
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.
</simpara>
<warning>
<simpara>
This extension does not support MaxMind's current "GeoIP2" databases,
only the "GeoIP legacy" database files.
</simpara>
</warning>
</preface>

&reference.geoip.setup;
&reference.geoip.constants;
&reference.geoip.reference;

</book>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->
190 changes: 190 additions & 0 deletions reference/geoip/constants.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,190 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<appendix xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="geoip.constants">
&reftitle.constants;
&extension.constants;
<variablelist>
<varlistentry xml:id="constant.geoip-country-edition">
<term>
<constant>GEOIP_COUNTRY_EDITION</constant>
(<type>int</type>)
</term>
<listitem>
<simpara>

</simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="constant.geoip-region-edition-rev0">
<term>
<constant>GEOIP_REGION_EDITION_REV0</constant>
(<type>int</type>)
</term>
<listitem>
<simpara>

</simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="constant.geoip-city-edition-rev0">
<term>
<constant>GEOIP_CITY_EDITION_REV0</constant>
(<type>int</type>)
</term>
<listitem>
<simpara>

</simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="constant.geoip-org-edition">
<term>
<constant>GEOIP_ORG_EDITION</constant>
(<type>int</type>)
</term>
<listitem>
<simpara>

</simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="constant.geoip-isp-edition">
<term>
<constant>GEOIP_ISP_EDITION</constant>
(<type>int</type>)
</term>
<listitem>
<simpara>

</simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="constant.geoip-city-edition-rev1">
<term>
<constant>GEOIP_CITY_EDITION_REV1</constant>
(<type>int</type>)
</term>
<listitem>
<simpara>

</simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="constant.geoip-region-edition-rev1">
<term>
<constant>GEOIP_REGION_EDITION_REV1</constant>
(<type>int</type>)
</term>
<listitem>
<simpara>

</simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="constant.geoip-proxy-edition">
<term>
<constant>GEOIP_PROXY_EDITION</constant>
(<type>int</type>)
</term>
<listitem>
<simpara>

</simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="constant.geoip-asnum-edition">
<term>
<constant>GEOIP_ASNUM_EDITION</constant>
(<type>int</type>)
</term>
<listitem>
<simpara>

</simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="constant.geoip-netspeed-edition">
<term>
<constant>GEOIP_NETSPEED_EDITION</constant>
(<type>int</type>)
</term>
<listitem>
<simpara>

</simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="constant.geoip-domain-edition">
<term>
<constant>GEOIP_DOMAIN_EDITION</constant>
(<type>int</type>)
</term>
<listitem>
<simpara>

</simpara>
</listitem>
</varlistentry>
</variablelist>
<simpara>
The following constants are for net speed:
</simpara>
<variablelist>
<varlistentry xml:id="constant.geoip-unknown-speed">
<term>
<constant>GEOIP_UNKNOWN_SPEED</constant>
(<type>int</type>)
</term>
<listitem>
<simpara/>
</listitem>
</varlistentry>
<varlistentry xml:id="constant.geoip-dialup-speed">
<term>
<constant>GEOIP_DIALUP_SPEED</constant>
(<type>int</type>)
</term>
<listitem>
<simpara/>
</listitem>
</varlistentry>
<varlistentry xml:id="constant.geoip-cabledsl-speed">
<term>
<constant>GEOIP_CABLEDSL_SPEED</constant>
(<type>int</type>)
</term>
<listitem>
<simpara/>
</listitem>
</varlistentry>
<varlistentry xml:id="constant.geoip-corporate-speed">
<term>
<constant>GEOIP_CORPORATE_SPEED</constant>
(<type>int</type>)
</term>
<listitem>
<simpara/>
</listitem>
</varlistentry>
</variablelist>
</appendix>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->
89 changes: 89 additions & 0 deletions reference/geoip/functions/geoip-asnum-by-name.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.geoip-asnum-by-name">
<refnamediv>
<refname>geoip_asnum_by_name</refname>
<refpurpose>Get the Autonomous System Numbers (ASN)</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>string</type><methodname>geoip_asnum_by_name</methodname>
<methodparam><type>string</type><parameter>hostname</parameter></methodparam>
</methodsynopsis>

<simpara>
The <function>geoip_asnum_by_name</function> function will return the Autonomous
System Numbers (ASN) associated with an IP address.
</simpara>

</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<variablelist>
<varlistentry>
<term><parameter>hostname</parameter></term>
<listitem>
<simpara>
The hostname or IP address.
</simpara>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<simpara>
Returns the ASN on success, or &false; if the address
cannot be found in the database.
</simpara>
</refsect1>

<refsect1 role="examples">
&reftitle.examples;
<example>
<title>A <function>geoip_asnum_by_name</function> example</title>
<simpara>
This will output the ASN of the host www.example.com.
</simpara>
<programlisting role="php">
<![CDATA[
<?php
$asn = geoip_asnum_by_name('www.example.com');

if ($asn) {
echo 'The ASN is: ' . $asn;
}
?>
]]>
</programlisting>
&example.outputs;
<screen>
<![CDATA[
The ASN is: AS15133 EdgeCast Networks, Inc
]]>
</screen>
</example>
</refsect1>

</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->
Loading