Skip to content

Commit 18848a7

Browse files
committed
Added supports for PX5-PX8 database.
1 parent 70bfd98 commit 18848a7

File tree

6 files changed

+1753
-1433
lines changed

6 files changed

+1753
-1433
lines changed

LICENSE.TXT

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2017 IP2Location.com
3+
Copyright (c) 2019 IP2Location.com
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ Below are the methods supported in this class.
2525
|getRegion|Return the ISO3166-2 region name of the proxy. Please visit <a href="https://www.ip2location.com/free/iso3166-2" target="_blank">ISO3166-2 Subdivision Code</a> for the information of ISO3166-2 supported|
2626
|getCity|Return the city name of the proxy.|
2727
|getISP|Return the ISP name of the proxy.|
28+
|getDomain|Internet domain name associated with IP address range.|
29+
|getUsageType|Usage type classification of ISP or company. Refer to usage type reference below.|
30+
|getASN|Autonomous system number (ASN).|
31+
|getAS|Autonomous system (AS) name.|
32+
|getLastSeen|Proxy last seen in days.|
2833

2934
## Usage
3035

@@ -38,7 +43,7 @@ Open and read IP2Proxy binary database. There are 3 modes:
3843
require 'class.IP2Proxy.php';
3944
4045
$db = new \IP2Proxy\Database();
41-
$db->open('./samples/IP2PROXY-IP-PROXYTYPE-COUNTRY-REGION-CITY-ISP.SAMPLE.BIN', \IP2Proxy\Database::FILE_IO);
46+
$db->open('./samples/IP2PROXY-IP-PROXYTYPE-COUNTRY-REGION-CITY-ISP-DOMAIN-USAGETYPE-ASN-LASTSEEN.SAMPLE.BIN', \IP2Proxy\Database::FILE_IO);
4247
```
4348

4449
To start lookup result from database, use the following codes:
@@ -49,7 +54,7 @@ $records = $db->getAll('1.0.241.135');
4954

5055
Results are returned in array.
5156

52-
```
57+
```php
5358
echo '<p><strong>IP Address: </strong>' . $records['ipAddress'] . '</p>';
5459
echo '<p><strong>IP Number: </strong>' . $records['ipNumber'] . '</p>';
5560
echo '<p><strong>IP Version: </strong>' . $records['ipVersion'] . '</p>';
@@ -71,6 +76,38 @@ echo '<p><strong>Proxy Type: </strong>' . $records['proxyType'] . '</p>';
7176
*/
7277
echo '<p><strong>Is Proxy: </strong>' . $records['isProxy'] . '</p>';
7378
echo '<p><strong>ISP: </strong>' . $records['isp'] . '</p>';
79+
80+
$domain = $db->getDomain('1.0.241.135');
81+
echo '<p><strong>Domain: </strong>' . $domain . '</p>';
82+
83+
$usageType = $db->getUsageType('1.0.241.135');
84+
echo '<p><strong>Usage Type: </strong>' . $usageType . '</p>';
85+
86+
$asn = $db->getASN('1.0.241.135');
87+
echo '<p><strong>ASN: </strong>' . $asn . '</p>';
88+
89+
$as = $db->getAS('1.0.241.135');
90+
echo '<p><strong>AS: </strong>' . $as . '</p>';
91+
92+
$lastSeen = $db->getLastSeen('1.0.241.135');
93+
echo '<p><strong>Last Seen: </strong>' . $lastSeen . '</p>';
7494
```
7595

7696

97+
98+
# Reference
99+
100+
### Usage Type
101+
102+
- (COM) Commercial
103+
- (ORG) Organization
104+
- (GOV) Government
105+
- (MIL) Military
106+
- (EDU) University/College/School
107+
- (LIB) Library
108+
- (CDN) Content Delivery Network
109+
- (ISP) Fixed Line ISP
110+
- (MOB) Mobile ISP
111+
- (DCH) Data Center/Web Hosting/Transit
112+
- (SES) Search Engine Spider
113+
- (RSV) Reserved

0 commit comments

Comments
 (0)