Skip to content

Commit 1c22aac

Browse files
committed
Removed statics functions and fixed errors under PHP 8.1.7.
1 parent 16e960b commit 1c22aac

File tree

6 files changed

+191
-183
lines changed

6 files changed

+191
-183
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@ Below are the methods supported in this class.
2020
|**string** getDatabaseVersion()|Return the database's compilation date as a string of the form 'YYYY-MM-DD',|
2121
|**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.|
2222
|**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/px10-ip-proxytype-country-region-city-isp-domain-usagetype-asn-lastseen-threat-residential) 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.|
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.|
2424

2525

2626

2727
### Web Service Class
2828

2929
| Method Name | Description |
3030
| ----------- | ------------------------------------------------------------ |
31-
| Constructor | Expect 3 input parameters:<ol><li>IP2Proxy API Key.</li><li>Package (PX1 - PX10)</li><li>Use HTTPS or HTTP</li></ol> |
31+
| Constructor | Expect 3 input parameters:<ol><li>IP2Proxy API Key.</li><li>Package (PX1 - PX11)</li><li>Use HTTPS or HTTP</li></ol> |
3232
| 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> |
3333
| getCredit | Return remaining credit of the web service account. |
3434

@@ -101,7 +101,7 @@ Start your lookup by following codes:
101101
require 'vendor/autoload.php';
102102

103103
// Lookup by Web API
104-
$ws = new \IP2Proxy\WebService('YOUR_API_KEY', 'PX10', false);
104+
$ws = new \IP2Proxy\WebService('YOUR_API_KEY', 'PX11', false);
105105

106106
$results = $ws->lookup('1.0.241.135');
107107

@@ -137,7 +137,7 @@ if ($results !== false) {
137137
| PUB | Public Proxies. These are services which make connection requests on a user's behalf. Proxy server software can be configured by the administrator to listen on some specified port. These differ from VPNs in that the proxies usually have limited functions compare to VPNs. | High |
138138
| WEB | Web Proxies. These are web services which make web requests on a user's behalf. These differ from VPNs or Public Proxies in that they are simple web-based proxies rather than operating at the IP address and other ports level. | High |
139139
| SES | Search Engine Robots. These are services which perform crawling or scraping to a website, such as, the search engine spider or bots engine. | Low |
140-
| RES | Residential proxies. These services offer users proxy connections through residential ISP with or without consents of peers to share their idle resources. Only available with PX10 | Medium |
140+
| RES | Residential proxies. These services offer users proxy connections through residential ISP with or without consents of peers to share their idle resources. Only available with PX11 | Medium |
141141

142142

143143

examples/example.php

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,23 @@
11
<?php
22

3+
error_reporting(\E_ALL);
4+
ini_set('display_errors', 1);
5+
36
require 'vendor/autoload.php';
47

58
// Lookup by local BIN database
69
$db = new \IP2Proxy\Database('./data/PX11.SAMPLE.BIN', \IP2PROXY\Database::FILE_IO);
710

8-
echo 'Module Version: ' . $db->getModuleVersion() . PHP_EOL. PHP_EOL;
9-
echo 'Package: PX'. $db->getPackageVersion() . PHP_EOL;
10-
echo 'Database Date: ' . $db->getDatabaseVersion() . PHP_EOL;
11-
echo '$records = $db->lookup(\'1.0.0.8\', \IP2PROXY\Database::ALL);' . PHP_EOL;
11+
echo 'Module Version: ' . $db->getModuleVersion() . \PHP_EOL . \PHP_EOL;
12+
echo 'Package: PX' . $db->getPackageVersion() . \PHP_EOL;
13+
echo 'Database Date: ' . $db->getDatabaseVersion() . \PHP_EOL;
14+
echo '$records = $db->lookup(\'1.0.0.8\', \IP2PROXY\Database::ALL);' . \PHP_EOL;
1215
$records = $db->lookup('1.0.0.8', \IP2PROXY\Database::ALL);
1316
print_r($records);
1417

15-
echo PHP_EOL . PHP_EOL;
18+
echo \PHP_EOL . \PHP_EOL;
1619

17-
echo 'Web Service' . PHP_EOL;
20+
echo 'Web Service' . \PHP_EOL;
1821

1922
// Lookup by Web API
2023
$ws = new \IP2Proxy\WebService('demo', 'PX11', false);

0 commit comments

Comments
 (0)