You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+2-117Lines changed: 2 additions & 117 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,123 +7,8 @@ This module allows user to query an IP address if it was being used as open prox
7
7
* Free IP2Proxy BIN Data: https://lite.ip2location.com
8
8
* Commercial IP2Proxy BIN Data: https://www.ip2location.com/proxy-database
9
9
10
-
## Methods
11
-
Below are the methods supported in this class.
12
-
13
-
14
-
15
-
### BIN Database Class
16
-
17
-
| Function Name | Description |
18
-
|---|---|
19
-
|Constructor|Expect 2 input parameters:<ol><li>Full path of IP2Proxy BIN data file.</li><li>File Open Mode<ul><li> SHARED_MEMORY</li><li>MEMORY_CACHE</li><li>FILE_IO</li></ul></li></ol>For SHARED_MEMORY and MEMORY_CACHE, it will require your server to have sufficient memory to hold the BIN data, otherwise it will raise the errors during the object initialization.|
20
-
|**string** getDatabaseVersion()|Return the database's compilation date as a string of the form 'YYYY-MM-DD',|
21
-
|**string** getPackageVersion()|Return the database's type, 1 to 10 respectively for PX1 to PX11. Please visit https://www.ip2location.com/databases/ip2proxy for details.|
22
-
|**string** getModuleVersion()|Return the version of module.|
23
-
|**array** lookup($ip)|Return the IP information in array. Below is the information returned:<ul><li>ipNumber</li><li>ipVersion</li><li>ipAddress</li><li>countryCode</li><li>countryName</li><li>regionName</li><li>cityName</li><li>isp</li><li>domain</li><li>usageType</li><li>asn</li><li>as</li><li>lastSeen</li><li>threat</li><li>proxyType</li><li>isProxy</li><li>provider</li></ul>You can visit [IP2Location](https://www.ip2location.com/database/px11-ip-proxytype-country-region-city-isp-domain-usagetype-asn-lastseen-threat-residential-provider) website for the description of each field. Note: although the above names are not exactly matched with the names given in this link, but they are self-described.|
| Constructor | Expect 3 input parameters:<ol><li>IP2Proxy API Key.</li><li>Package (PX1 - PX11)</li><li>Use HTTPS or HTTP</li></ol> |
32
-
| lookup | Return the proxy information in array.<ul><li>countryCode</li><li>countryName</li><li>regionName</li><li>cityName</li><li>isp</li><li>domain</li><li>usageType</li><li>asn</li><li>as</li><li>lastSeen</li><li>threat</li><li>proxyType</li><li>isProxy</li><li>provider</li></ul> |
33
-
| getCredit | Return remaining credit of the web service account. |
34
-
35
-
36
-
37
-
## Usage
38
-
39
-
### BIN Database
40
-
41
-
Open and read IP2Proxy binary database. There are 3 modes:
2.**\IP2Proxy\Database::MEMORY_CACHE** - Caches database into memory for faster lookup. Required high memory.
45
-
3.**\IP2Proxy\Database::SHARED_MEMORY** - Stores whole IP2Proxy database into system memory. Lookup is possible across all applications within the system. Extremely resources consuming. Do not use this mode if your system do not have enough memory.
46
-
47
-
```php
48
-
require 'vendor/autoload.php';
49
-
50
-
$db = new \IP2Proxy\Database('vendor/ip2location/ip2proxy-php/data/PX11.SAMPLE.BIN', \IP2PROXY\Database::FILE_IO);
51
-
```
52
-
53
-
To start lookup result from database, use the following codes:
To learn more about installation, usage, and code examples, please visit the developer documentation at [https://ip2proxy-php.readthedocs.io/en/latest/index.html.](https://ip2proxy-php.readthedocs.io/en/latest/index.html)
0 commit comments