Skip to content

Commit

Permalink
Added supports for PX5-PX8 database.
Browse files Browse the repository at this point in the history
  • Loading branch information
ip2location committed May 13, 2019
1 parent 70bfd98 commit 18848a7
Show file tree
Hide file tree
Showing 6 changed files with 1,753 additions and 1,433 deletions.
2 changes: 1 addition & 1 deletion LICENSE.TXT
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2017 IP2Location.com
Copyright (c) 2019 IP2Location.com

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
41 changes: 39 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ Below are the methods supported in this class.
|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|
|getCity|Return the city name of the proxy.|
|getISP|Return the ISP name of the proxy.|
|getDomain|Internet domain name associated with IP address range.|
|getUsageType|Usage type classification of ISP or company. Refer to usage type reference below.|
|getASN|Autonomous system number (ASN).|
|getAS|Autonomous system (AS) name.|
|getLastSeen|Proxy last seen in days.|

## Usage

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

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

Results are returned in array.

```
```php
echo '<p><strong>IP Address: </strong>' . $records['ipAddress'] . '</p>';
echo '<p><strong>IP Number: </strong>' . $records['ipNumber'] . '</p>';
echo '<p><strong>IP Version: </strong>' . $records['ipVersion'] . '</p>';
Expand All @@ -71,6 +76,38 @@ echo '<p><strong>Proxy Type: </strong>' . $records['proxyType'] . '</p>';
*/
echo '<p><strong>Is Proxy: </strong>' . $records['isProxy'] . '</p>';
echo '<p><strong>ISP: </strong>' . $records['isp'] . '</p>';

$domain = $db->getDomain('1.0.241.135');
echo '<p><strong>Domain: </strong>' . $domain . '</p>';

$usageType = $db->getUsageType('1.0.241.135');
echo '<p><strong>Usage Type: </strong>' . $usageType . '</p>';

$asn = $db->getASN('1.0.241.135');
echo '<p><strong>ASN: </strong>' . $asn . '</p>';

$as = $db->getAS('1.0.241.135');
echo '<p><strong>AS: </strong>' . $as . '</p>';

$lastSeen = $db->getLastSeen('1.0.241.135');
echo '<p><strong>Last Seen: </strong>' . $lastSeen . '</p>';
```



# Reference

### Usage Type

- (COM) Commercial
- (ORG) Organization
- (GOV) Government
- (MIL) Military
- (EDU) University/College/School
- (LIB) Library
- (CDN) Content Delivery Network
- (ISP) Fixed Line ISP
- (MOB) Mobile ISP
- (DCH) Data Center/Web Hosting/Transit
- (SES) Search Engine Spider
- (RSV) Reserved
Loading

0 comments on commit 18848a7

Please sign in to comment.