Version Description
3.0 was not compatible with the WooCommerce plugin.
Download this release
Release Info
Developer | benjamin4 |
Plugin | GeoIP Detection |
Version | 3.0.1 |
Comparing to | |
See all releases |
Code changes from version 3.0 to 3.0.1
- admin-ui.php +1 -1
- ajax.php +1 -1
- api.php +1 -1
- check_requirements.php +1 -1
- composer.lock +31 -35
- data-sources/auto.php +6 -3
- data-sources/header.php +1 -1
- data-sources/ipstack.php +1 -1
- data-sources/manual.php +1 -1
- data-sources/precision.php +1 -1
- data-sources/registry.php +1 -1
- filter.php +1 -1
- geoip-detect-lib.php +1 -1
- geoip-detect.php +3 -3
- legacy-api.php +1 -1
- lib/geonames/geonames-country-info.php +1 -1
- lib/get-client-ip.php +1 -1
- readme.txt +8 -0
- shortcode.php +1 -1
- upgrade-plugin.php +1 -1
- vendor/composer/ClassLoader.php +3 -3
- vendor/composer/ca-bundle/composer.json +1 -1
- vendor/composer/ca-bundle/res/cacert.pem +46 -2
- vendor/composer/ca-bundle/src/CaBundle.php +0 -1
- vendor/composer/installed.json +56 -60
- vendor/geoip2/geoip2/CHANGELOG.md +0 -20
- vendor/geoip2/geoip2/README.md +17 -25
- vendor/geoip2/geoip2/composer.json +5 -6
- vendor/geoip2/geoip2/src/Database/Reader.php +9 -13
- vendor/geoip2/geoip2/src/Model/AnonymousIp.php +4 -14
- vendor/geoip2/geoip2/src/Model/Asn.php +1 -9
- vendor/geoip2/geoip2/src/Model/City.php +21 -4
- vendor/geoip2/geoip2/src/Model/ConnectionType.php +1 -9
- vendor/geoip2/geoip2/src/Model/Country.php +1 -1
- vendor/geoip2/geoip2/src/Model/Domain.php +1 -9
- vendor/geoip2/geoip2/src/Model/Enterprise.php +34 -1
- vendor/geoip2/geoip2/src/Model/Insights.php +34 -1
- vendor/geoip2/geoip2/src/Model/Isp.php +1 -9
- vendor/geoip2/geoip2/src/Record/AbstractRecord.php +1 -1
- vendor/geoip2/geoip2/src/Record/Country.php +4 -3
- vendor/geoip2/geoip2/src/Record/Location.php +4 -4
- vendor/geoip2/geoip2/src/Record/RepresentedCountry.php +13 -0
- vendor/geoip2/geoip2/src/Record/Subdivision.php +3 -3
- vendor/geoip2/geoip2/src/Record/Traits.php +17 -43
- vendor/geoip2/geoip2/src/WebService/Client.php +4 -4
- vendor/maxmind-db/reader/CHANGELOG.md +0 -21
- vendor/maxmind-db/reader/composer.json +0 -8
- vendor/maxmind-db/reader/ext/maxminddb.c +12 -19
- vendor/maxmind-db/reader/ext/php_maxminddb.h +1 -1
- vendor/maxmind-db/reader/src/MaxMind/Db/Reader.php +12 -11
- vendor/maxmind-db/reader/src/MaxMind/Db/Reader/Decoder.php +13 -6
- vendor/maxmind/web-service-common/CHANGELOG.md +0 -7
- vendor/maxmind/web-service-common/README.md +3 -2
- vendor/maxmind/web-service-common/composer.json +2 -2
- vendor/maxmind/web-service-common/src/WebService/Client.php +17 -17
- vendor/maxmind/web-service-common/src/WebService/Http/CurlRequest.php +9 -35
- vendor/maxmind/web-service-common/src/WebService/Http/Request.php +3 -3
- vendor/maxmind/web-service-common/src/WebService/Http/RequestFactory.php +3 -20
admin-ui.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
/*
|
3 |
-
Copyright 2013-
|
4 |
Author: Benjamin Pick (wp-geoip-detect| |posteo.de)
|
5 |
|
6 |
This program is free software; you can redistribute it and/or modify
|
1 |
<?php
|
2 |
/*
|
3 |
+
Copyright 2013-2020 Yellow Tree, Siegen, Germany
|
4 |
Author: Benjamin Pick (wp-geoip-detect| |posteo.de)
|
5 |
|
6 |
This program is free software; you can redistribute it and/or modify
|
ajax.php
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?php
|
2 |
|
3 |
/*
|
4 |
-
Copyright 2013-
|
5 |
Author: Benjamin Pick (wp-geoip-detect| |posteo.de)
|
6 |
|
7 |
This program is free software; you can redistribute it and/or modify
|
1 |
<?php
|
2 |
|
3 |
/*
|
4 |
+
Copyright 2013-2020 Yellow Tree, Siegen, Germany
|
5 |
Author: Benjamin Pick (wp-geoip-detect| |posteo.de)
|
6 |
|
7 |
This program is free software; you can redistribute it and/or modify
|
api.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
/*
|
3 |
-
Copyright 2013-
|
4 |
Author: Benjamin Pick (wp-geoip-detect| |posteo.de)
|
5 |
|
6 |
This program is free software; you can redistribute it and/or modify
|
1 |
<?php
|
2 |
/*
|
3 |
+
Copyright 2013-2020 Yellow Tree, Siegen, Germany
|
4 |
Author: Benjamin Pick (wp-geoip-detect| |posteo.de)
|
5 |
|
6 |
This program is free software; you can redistribute it and/or modify
|
check_requirements.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
/*
|
3 |
-
Copyright 2013-
|
4 |
Author: Benjamin Pick (wp-geoip-detect| |posteo.de)
|
5 |
|
6 |
This program is free software; you can redistribute it and/or modify
|
1 |
<?php
|
2 |
/*
|
3 |
+
Copyright 2013-2020 Yellow Tree, Siegen, Germany
|
4 |
Author: Benjamin Pick (wp-geoip-detect| |posteo.de)
|
5 |
|
6 |
This program is free software; you can redistribute it and/or modify
|
composer.lock
CHANGED
@@ -1,23 +1,23 @@
|
|
1 |
{
|
2 |
"_readme": [
|
3 |
"This file locks the dependencies of your project to a known state",
|
4 |
-
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#
|
5 |
"This file is @generated automatically"
|
6 |
],
|
7 |
-
"content-hash": "
|
8 |
"packages": [
|
9 |
{
|
10 |
"name": "composer/ca-bundle",
|
11 |
-
"version": "1.2.
|
12 |
"source": {
|
13 |
"type": "git",
|
14 |
"url": "https://github.com/composer/ca-bundle.git",
|
15 |
-
"reference": "
|
16 |
},
|
17 |
"dist": {
|
18 |
"type": "zip",
|
19 |
-
"url": "https://api.github.com/repos/composer/ca-bundle/zipball/
|
20 |
-
"reference": "
|
21 |
"shasum": ""
|
22 |
},
|
23 |
"require": {
|
@@ -28,7 +28,7 @@
|
|
28 |
"require-dev": {
|
29 |
"phpunit/phpunit": "^4.8.35 || ^5.7 || 6.5 - 8",
|
30 |
"psr/log": "^1.0",
|
31 |
-
"symfony/process": "^2.5 || ^3.0 || ^4.0
|
32 |
},
|
33 |
"type": "library",
|
34 |
"extra": {
|
@@ -60,31 +60,30 @@
|
|
60 |
"ssl",
|
61 |
"tls"
|
62 |
],
|
63 |
-
"time": "2019-
|
64 |
},
|
65 |
{
|
66 |
"name": "geoip2/geoip2",
|
67 |
-
"version": "v2.
|
68 |
"source": {
|
69 |
"type": "git",
|
70 |
"url": "https://github.com/maxmind/GeoIP2-php.git",
|
71 |
-
"reference": "
|
72 |
},
|
73 |
"dist": {
|
74 |
"type": "zip",
|
75 |
-
"url": "https://api.github.com/repos/maxmind/GeoIP2-php/zipball/
|
76 |
-
"reference": "
|
77 |
"shasum": ""
|
78 |
},
|
79 |
"require": {
|
80 |
-
"
|
81 |
-
"maxmind-
|
82 |
-
"
|
83 |
-
"php": ">=5.6"
|
84 |
},
|
85 |
"require-dev": {
|
86 |
"friendsofphp/php-cs-fixer": "2.*",
|
87 |
-
"phpunit/phpunit": "
|
88 |
"squizlabs/php_codesniffer": "3.*"
|
89 |
},
|
90 |
"type": "library",
|
@@ -101,7 +100,7 @@
|
|
101 |
{
|
102 |
"name": "Gregory J. Oschwald",
|
103 |
"email": "goschwald@maxmind.com",
|
104 |
-
"homepage": "
|
105 |
}
|
106 |
],
|
107 |
"description": "MaxMind GeoIP2 PHP API",
|
@@ -113,28 +112,25 @@
|
|
113 |
"geolocation",
|
114 |
"maxmind"
|
115 |
],
|
116 |
-
"time": "
|
117 |
},
|
118 |
{
|
119 |
"name": "maxmind-db/reader",
|
120 |
-
"version": "v1.
|
121 |
"source": {
|
122 |
"type": "git",
|
123 |
"url": "https://github.com/maxmind/MaxMind-DB-Reader-php.git",
|
124 |
-
"reference": "
|
125 |
},
|
126 |
"dist": {
|
127 |
"type": "zip",
|
128 |
-
"url": "https://api.github.com/repos/maxmind/MaxMind-DB-Reader-php/zipball/
|
129 |
-
"reference": "
|
130 |
"shasum": ""
|
131 |
},
|
132 |
"require": {
|
133 |
"php": ">=5.6"
|
134 |
},
|
135 |
-
"conflict": {
|
136 |
-
"ext-maxminddb": "<1.6.0,>=2.0.0"
|
137 |
-
},
|
138 |
"require-dev": {
|
139 |
"friendsofphp/php-cs-fixer": "2.*",
|
140 |
"php-coveralls/php-coveralls": "^2.1",
|
@@ -173,31 +169,31 @@
|
|
173 |
"geolocation",
|
174 |
"maxmind"
|
175 |
],
|
176 |
-
"time": "2019-
|
177 |
},
|
178 |
{
|
179 |
"name": "maxmind/web-service-common",
|
180 |
-
"version": "v0.
|
181 |
"source": {
|
182 |
"type": "git",
|
183 |
"url": "https://github.com/maxmind/web-service-common-php.git",
|
184 |
-
"reference": "
|
185 |
},
|
186 |
"dist": {
|
187 |
"type": "zip",
|
188 |
-
"url": "https://api.github.com/repos/maxmind/web-service-common-php/zipball/
|
189 |
-
"reference": "
|
190 |
"shasum": ""
|
191 |
},
|
192 |
"require": {
|
193 |
"composer/ca-bundle": "^1.0.3",
|
194 |
"ext-curl": "*",
|
195 |
"ext-json": "*",
|
196 |
-
"php": ">=5.
|
197 |
},
|
198 |
"require-dev": {
|
199 |
"friendsofphp/php-cs-fixer": "2.*",
|
200 |
-
"phpunit/phpunit": "
|
201 |
"squizlabs/php_codesniffer": "3.*"
|
202 |
},
|
203 |
"type": "library",
|
@@ -219,7 +215,7 @@
|
|
219 |
],
|
220 |
"description": "Internal MaxMind Web Service API",
|
221 |
"homepage": "https://github.com/maxmind/web-service-common-php",
|
222 |
-
"time": "
|
223 |
}
|
224 |
],
|
225 |
"packages-dev": [],
|
@@ -229,7 +225,7 @@
|
|
229 |
"prefer-stable": false,
|
230 |
"prefer-lowest": false,
|
231 |
"platform": {
|
232 |
-
"php": ">=5.
|
233 |
},
|
234 |
"platform-dev": []
|
235 |
}
|
1 |
{
|
2 |
"_readme": [
|
3 |
"This file locks the dependencies of your project to a known state",
|
4 |
+
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
5 |
"This file is @generated automatically"
|
6 |
],
|
7 |
+
"content-hash": "1469024a23af7d9facb99a4208b34160",
|
8 |
"packages": [
|
9 |
{
|
10 |
"name": "composer/ca-bundle",
|
11 |
+
"version": "1.2.4",
|
12 |
"source": {
|
13 |
"type": "git",
|
14 |
"url": "https://github.com/composer/ca-bundle.git",
|
15 |
+
"reference": "10bb96592168a0f8e8f6dcde3532d9fa50b0b527"
|
16 |
},
|
17 |
"dist": {
|
18 |
"type": "zip",
|
19 |
+
"url": "https://api.github.com/repos/composer/ca-bundle/zipball/10bb96592168a0f8e8f6dcde3532d9fa50b0b527",
|
20 |
+
"reference": "10bb96592168a0f8e8f6dcde3532d9fa50b0b527",
|
21 |
"shasum": ""
|
22 |
},
|
23 |
"require": {
|
28 |
"require-dev": {
|
29 |
"phpunit/phpunit": "^4.8.35 || ^5.7 || 6.5 - 8",
|
30 |
"psr/log": "^1.0",
|
31 |
+
"symfony/process": "^2.5 || ^3.0 || ^4.0"
|
32 |
},
|
33 |
"type": "library",
|
34 |
"extra": {
|
60 |
"ssl",
|
61 |
"tls"
|
62 |
],
|
63 |
+
"time": "2019-08-30T08:44:50+00:00"
|
64 |
},
|
65 |
{
|
66 |
"name": "geoip2/geoip2",
|
67 |
+
"version": "v2.9.0",
|
68 |
"source": {
|
69 |
"type": "git",
|
70 |
"url": "https://github.com/maxmind/GeoIP2-php.git",
|
71 |
+
"reference": "a807fbf65212eef5d8d2db1a1b31082b53633d77"
|
72 |
},
|
73 |
"dist": {
|
74 |
"type": "zip",
|
75 |
+
"url": "https://api.github.com/repos/maxmind/GeoIP2-php/zipball/a807fbf65212eef5d8d2db1a1b31082b53633d77",
|
76 |
+
"reference": "a807fbf65212eef5d8d2db1a1b31082b53633d77",
|
77 |
"shasum": ""
|
78 |
},
|
79 |
"require": {
|
80 |
+
"maxmind-db/reader": "~1.0",
|
81 |
+
"maxmind/web-service-common": "~0.5",
|
82 |
+
"php": ">=5.4"
|
|
|
83 |
},
|
84 |
"require-dev": {
|
85 |
"friendsofphp/php-cs-fixer": "2.*",
|
86 |
+
"phpunit/phpunit": "4.*",
|
87 |
"squizlabs/php_codesniffer": "3.*"
|
88 |
},
|
89 |
"type": "library",
|
100 |
{
|
101 |
"name": "Gregory J. Oschwald",
|
102 |
"email": "goschwald@maxmind.com",
|
103 |
+
"homepage": "http://www.maxmind.com/"
|
104 |
}
|
105 |
],
|
106 |
"description": "MaxMind GeoIP2 PHP API",
|
112 |
"geolocation",
|
113 |
"maxmind"
|
114 |
],
|
115 |
+
"time": "2018-04-10T15:32:59+00:00"
|
116 |
},
|
117 |
{
|
118 |
"name": "maxmind-db/reader",
|
119 |
+
"version": "v1.5.0",
|
120 |
"source": {
|
121 |
"type": "git",
|
122 |
"url": "https://github.com/maxmind/MaxMind-DB-Reader-php.git",
|
123 |
+
"reference": "bd436094fc0a9b0558a899fb80b0ae34fe1808a0"
|
124 |
},
|
125 |
"dist": {
|
126 |
"type": "zip",
|
127 |
+
"url": "https://api.github.com/repos/maxmind/MaxMind-DB-Reader-php/zipball/bd436094fc0a9b0558a899fb80b0ae34fe1808a0",
|
128 |
+
"reference": "bd436094fc0a9b0558a899fb80b0ae34fe1808a0",
|
129 |
"shasum": ""
|
130 |
},
|
131 |
"require": {
|
132 |
"php": ">=5.6"
|
133 |
},
|
|
|
|
|
|
|
134 |
"require-dev": {
|
135 |
"friendsofphp/php-cs-fixer": "2.*",
|
136 |
"php-coveralls/php-coveralls": "^2.1",
|
169 |
"geolocation",
|
170 |
"maxmind"
|
171 |
],
|
172 |
+
"time": "2019-09-30T22:56:38+00:00"
|
173 |
},
|
174 |
{
|
175 |
"name": "maxmind/web-service-common",
|
176 |
+
"version": "v0.5.0",
|
177 |
"source": {
|
178 |
"type": "git",
|
179 |
"url": "https://github.com/maxmind/web-service-common-php.git",
|
180 |
+
"reference": "61a9836fa3bb1743ab89752bae5005d71e78c73b"
|
181 |
},
|
182 |
"dist": {
|
183 |
"type": "zip",
|
184 |
+
"url": "https://api.github.com/repos/maxmind/web-service-common-php/zipball/61a9836fa3bb1743ab89752bae5005d71e78c73b",
|
185 |
+
"reference": "61a9836fa3bb1743ab89752bae5005d71e78c73b",
|
186 |
"shasum": ""
|
187 |
},
|
188 |
"require": {
|
189 |
"composer/ca-bundle": "^1.0.3",
|
190 |
"ext-curl": "*",
|
191 |
"ext-json": "*",
|
192 |
+
"php": ">=5.4"
|
193 |
},
|
194 |
"require-dev": {
|
195 |
"friendsofphp/php-cs-fixer": "2.*",
|
196 |
+
"phpunit/phpunit": "4.*",
|
197 |
"squizlabs/php_codesniffer": "3.*"
|
198 |
},
|
199 |
"type": "library",
|
215 |
],
|
216 |
"description": "Internal MaxMind Web Service API",
|
217 |
"homepage": "https://github.com/maxmind/web-service-common-php",
|
218 |
+
"time": "2018-02-12T22:31:54+00:00"
|
219 |
}
|
220 |
],
|
221 |
"packages-dev": [],
|
225 |
"prefer-stable": false,
|
226 |
"prefer-lowest": false,
|
227 |
"platform": {
|
228 |
+
"php": ">=5.4"
|
229 |
},
|
230 |
"platform-dev": []
|
231 |
}
|
data-sources/auto.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
/*
|
3 |
-
Copyright 2013-
|
4 |
Author: Benjamin Pick (wp-geoip-detect| |posteo.de)
|
5 |
|
6 |
This program is free software; you can redistribute it and/or modify
|
@@ -79,13 +79,16 @@ HTML;
|
|
79 |
|
80 |
$text_update = __('Update now', 'geoip-detect');
|
81 |
$nonce_field = wp_nonce_field( 'geoip_detect_update' );
|
82 |
-
|
83 |
-
|
|
|
84 |
$nonce_field
|
85 |
<input type="hidden" name="action" value="update" />
|
86 |
<input type="submit" class="button button-secondary" value="$text_update" $disabled />
|
87 |
</form>
|
88 |
HTML;
|
|
|
|
|
89 |
return $html . $error;
|
90 |
}
|
91 |
|
1 |
<?php
|
2 |
/*
|
3 |
+
Copyright 2013-2020 Yellow Tree, Siegen, Germany
|
4 |
Author: Benjamin Pick (wp-geoip-detect| |posteo.de)
|
5 |
|
6 |
This program is free software; you can redistribute it and/or modify
|
79 |
|
80 |
$text_update = __('Update now', 'geoip-detect');
|
81 |
$nonce_field = wp_nonce_field( 'geoip_detect_update' );
|
82 |
+
if (current_user_can('manage_options')) {
|
83 |
+
$html .= <<<HTML
|
84 |
+
<form method="post" action="options-general.php?page=geoip-detect%2Fgeoip-detect.php">
|
85 |
$nonce_field
|
86 |
<input type="hidden" name="action" value="update" />
|
87 |
<input type="submit" class="button button-secondary" value="$text_update" $disabled />
|
88 |
</form>
|
89 |
HTML;
|
90 |
+
}
|
91 |
+
|
92 |
return $html . $error;
|
93 |
}
|
94 |
|
data-sources/header.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
/*
|
3 |
-
Copyright 2013-
|
4 |
Author: Benjamin Pick (wp-geoip-detect| |posteo.de)
|
5 |
|
6 |
This program is free software; you can redistribute it and/or modify
|
1 |
<?php
|
2 |
/*
|
3 |
+
Copyright 2013-2020 Yellow Tree, Siegen, Germany
|
4 |
Author: Benjamin Pick (wp-geoip-detect| |posteo.de)
|
5 |
|
6 |
This program is free software; you can redistribute it and/or modify
|
data-sources/ipstack.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
/*
|
3 |
-
Copyright 2013-
|
4 |
Author: Benjamin Pick (wp-geoip-detect| |posteo.de)
|
5 |
|
6 |
This program is free software; you can redistribute it and/or modify
|
1 |
<?php
|
2 |
/*
|
3 |
+
Copyright 2013-2020 Yellow Tree, Siegen, Germany
|
4 |
Author: Benjamin Pick (wp-geoip-detect| |posteo.de)
|
5 |
|
6 |
This program is free software; you can redistribute it and/or modify
|
data-sources/manual.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
/*
|
3 |
-
Copyright 2013-
|
4 |
Author: Benjamin Pick (wp-geoip-detect| |posteo.de)
|
5 |
|
6 |
This program is free software; you can redistribute it and/or modify
|
1 |
<?php
|
2 |
/*
|
3 |
+
Copyright 2013-2020 Yellow Tree, Siegen, Germany
|
4 |
Author: Benjamin Pick (wp-geoip-detect| |posteo.de)
|
5 |
|
6 |
This program is free software; you can redistribute it and/or modify
|
data-sources/precision.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
/*
|
3 |
-
Copyright 2013-
|
4 |
Author: Benjamin Pick (wp-geoip-detect| |posteo.de)
|
5 |
|
6 |
This program is free software; you can redistribute it and/or modify
|
1 |
<?php
|
2 |
/*
|
3 |
+
Copyright 2013-2020 Yellow Tree, Siegen, Germany
|
4 |
Author: Benjamin Pick (wp-geoip-detect| |posteo.de)
|
5 |
|
6 |
This program is free software; you can redistribute it and/or modify
|
data-sources/registry.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
/*
|
3 |
-
Copyright 2013-
|
4 |
Author: Benjamin Pick (wp-geoip-detect| |posteo.de)
|
5 |
|
6 |
This program is free software; you can redistribute it and/or modify
|
1 |
<?php
|
2 |
/*
|
3 |
+
Copyright 2013-2020 Yellow Tree, Siegen, Germany
|
4 |
Author: Benjamin Pick (wp-geoip-detect| |posteo.de)
|
5 |
|
6 |
This program is free software; you can redistribute it and/or modify
|
filter.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
/*
|
3 |
-
Copyright 2013-
|
4 |
Author: Benjamin Pick (wp-geoip-detect| |posteo.de)
|
5 |
|
6 |
This program is free software; you can redistribute it and/or modify
|
1 |
<?php
|
2 |
/*
|
3 |
+
Copyright 2013-2020 Yellow Tree, Siegen, Germany
|
4 |
Author: Benjamin Pick (wp-geoip-detect| |posteo.de)
|
5 |
|
6 |
This program is free software; you can redistribute it and/or modify
|
geoip-detect-lib.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
/*
|
3 |
-
Copyright 2013-
|
4 |
Author: Benjamin Pick (wp-geoip-detect| |posteo.de)
|
5 |
|
6 |
This program is free software; you can redistribute it and/or modify
|
1 |
<?php
|
2 |
/*
|
3 |
+
Copyright 2013-2020 Yellow Tree, Siegen, Germany
|
4 |
Author: Benjamin Pick (wp-geoip-detect| |posteo.de)
|
5 |
|
6 |
This program is free software; you can redistribute it and/or modify
|
geoip-detect.php
CHANGED
@@ -5,7 +5,7 @@ Plugin URI: http://www.yellowtree.de
|
|
5 |
Description: Retrieving Geo-Information using the Maxmind GeoIP (Lite) Database.
|
6 |
Author: Yellow Tree (Benjamin Pick)
|
7 |
Author URI: http://www.yellowtree.de
|
8 |
-
Version: 3.0
|
9 |
License: GPLv3 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
11 |
Text Domain: geoip-detect
|
@@ -16,10 +16,10 @@ Requires WP: 4.0
|
|
16 |
Requires PHP: 5.6
|
17 |
*/
|
18 |
|
19 |
-
define('GEOIP_DETECT_VERSION', '3.0');
|
20 |
|
21 |
/*
|
22 |
-
Copyright 2013-
|
23 |
Author: Benjamin Pick (wp-geoip-detect| |posteo.de)
|
24 |
|
25 |
This program is free software; you can redistribute it and/or modify
|
5 |
Description: Retrieving Geo-Information using the Maxmind GeoIP (Lite) Database.
|
6 |
Author: Yellow Tree (Benjamin Pick)
|
7 |
Author URI: http://www.yellowtree.de
|
8 |
+
Version: 3.0.1
|
9 |
License: GPLv3 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
11 |
Text Domain: geoip-detect
|
16 |
Requires PHP: 5.6
|
17 |
*/
|
18 |
|
19 |
+
define('GEOIP_DETECT_VERSION', '3.0.1');
|
20 |
|
21 |
/*
|
22 |
+
Copyright 2013-2020 Yellow Tree, Siegen, Germany
|
23 |
Author: Benjamin Pick (wp-geoip-detect| |posteo.de)
|
24 |
|
25 |
This program is free software; you can redistribute it and/or modify
|
legacy-api.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
/*
|
3 |
-
Copyright 2013-
|
4 |
Author: Benjamin Pick (wp-geoip-detect| |posteo.de)
|
5 |
|
6 |
This program is free software; you can redistribute it and/or modify
|
1 |
<?php
|
2 |
/*
|
3 |
+
Copyright 2013-2020 Yellow Tree, Siegen, Germany
|
4 |
Author: Benjamin Pick (wp-geoip-detect| |posteo.de)
|
5 |
|
6 |
This program is free software; you can redistribute it and/or modify
|
lib/geonames/geonames-country-info.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
/*
|
3 |
-
Copyright 2013-
|
4 |
Author: Benjamin Pick (wp-geoip-detect| |posteo.de)
|
5 |
|
6 |
This program is free software; you can redistribute it and/or modify
|
1 |
<?php
|
2 |
/*
|
3 |
+
Copyright 2013-2020 Yellow Tree, Siegen, Germany
|
4 |
Author: Benjamin Pick (wp-geoip-detect| |posteo.de)
|
5 |
|
6 |
This program is free software; you can redistribute it and/or modify
|
lib/get-client-ip.php
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?php
|
2 |
|
3 |
/*
|
4 |
-
Copyright 2013-
|
5 |
Author: Benjamin Pick (wp-geoip-detect| |posteo.de)
|
6 |
|
7 |
This program is free software; you can redistribute it and/or modify
|
1 |
<?php
|
2 |
|
3 |
/*
|
4 |
+
Copyright 2013-2020 Yellow Tree, Siegen, Germany
|
5 |
Author: Benjamin Pick (wp-geoip-detect| |posteo.de)
|
6 |
|
7 |
This program is free software; you can redistribute it and/or modify
|
readme.txt
CHANGED
@@ -111,6 +111,10 @@ Does `geoip_detect2_get_info_from_current_ip()` return the same country, regardl
|
|
111 |
|
112 |
== Upgrade Notice ==
|
113 |
|
|
|
|
|
|
|
|
|
114 |
= 3.0 =
|
115 |
|
116 |
If you use Maxmind "Automatic download" then you need to upgrade to this plugin version in order to continue to receive database update. The Database licence changed and you will need to register at their website and agree to the EULA.
|
@@ -142,6 +146,10 @@ New: Shortcode for showing/hiding content!
|
|
142 |
|
143 |
== Changelog ==
|
144 |
|
|
|
|
|
|
|
|
|
145 |
= 3.0 =
|
146 |
* MAJOR CHANGE: Due to legal reasons, Maxmind now requires registration and some use cases are no longer allowed with the free data. If you use the Maxmind data source with automatic update, the update will fail for versions < 3.0 or if you have not entered a license key yet.
|
147 |
* Updated the Maxmind update mechanism
|
111 |
|
112 |
== Upgrade Notice ==
|
113 |
|
114 |
+
= 3.0.1 =
|
115 |
+
|
116 |
+
3.0 was not compatible with the WooCommerce plugin.
|
117 |
+
|
118 |
= 3.0 =
|
119 |
|
120 |
If you use Maxmind "Automatic download" then you need to upgrade to this plugin version in order to continue to receive database update. The Database licence changed and you will need to register at their website and agree to the EULA.
|
146 |
|
147 |
== Changelog ==
|
148 |
|
149 |
+
= 3.0.1 =
|
150 |
+
* FIX: Button "Update now" now works also on the lookup page.
|
151 |
+
* FIX: Reverted the vendor code to the one used in 2.13 because it broke installations with the WooCommerce-plugin. I will update the vendor code again once we found a long-term solution for this interdepency.
|
152 |
+
|
153 |
= 3.0 =
|
154 |
* MAJOR CHANGE: Due to legal reasons, Maxmind now requires registration and some use cases are no longer allowed with the free data. If you use the Maxmind data source with automatic update, the update will fail for versions < 3.0 or if you have not entered a license key yet.
|
155 |
* Updated the Maxmind update mechanism
|
shortcode.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
/*
|
3 |
-
Copyright 2013-
|
4 |
Author: Benjamin Pick (wp-geoip-detect| |posteo.de)
|
5 |
|
6 |
This program is free software; you can redistribute it and/or modify
|
1 |
<?php
|
2 |
/*
|
3 |
+
Copyright 2013-2020 Yellow Tree, Siegen, Germany
|
4 |
Author: Benjamin Pick (wp-geoip-detect| |posteo.de)
|
5 |
|
6 |
This program is free software; you can redistribute it and/or modify
|
upgrade-plugin.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
/*
|
3 |
-
Copyright 2013-
|
4 |
Author: Benjamin Pick (wp-geoip-detect| |posteo.de)
|
5 |
|
6 |
This program is free software; you can redistribute it and/or modify
|
1 |
<?php
|
2 |
/*
|
3 |
+
Copyright 2013-2020 Yellow Tree, Siegen, Germany
|
4 |
Author: Benjamin Pick (wp-geoip-detect| |posteo.de)
|
5 |
|
6 |
This program is free software; you can redistribute it and/or modify
|
vendor/composer/ClassLoader.php
CHANGED
@@ -377,11 +377,11 @@ class ClassLoader
|
|
377 |
$subPath = $class;
|
378 |
while (false !== $lastPos = strrpos($subPath, '\\')) {
|
379 |
$subPath = substr($subPath, 0, $lastPos);
|
380 |
-
$search = $subPath.'\\';
|
381 |
if (isset($this->prefixDirsPsr4[$search])) {
|
|
|
382 |
foreach ($this->prefixDirsPsr4[$search] as $dir) {
|
383 |
-
$
|
384 |
-
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $length))) {
|
385 |
return $file;
|
386 |
}
|
387 |
}
|
377 |
$subPath = $class;
|
378 |
while (false !== $lastPos = strrpos($subPath, '\\')) {
|
379 |
$subPath = substr($subPath, 0, $lastPos);
|
380 |
+
$search = $subPath . '\\';
|
381 |
if (isset($this->prefixDirsPsr4[$search])) {
|
382 |
+
$pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1);
|
383 |
foreach ($this->prefixDirsPsr4[$search] as $dir) {
|
384 |
+
if (file_exists($file = $dir . $pathEnd)) {
|
|
|
385 |
return $file;
|
386 |
}
|
387 |
}
|
vendor/composer/ca-bundle/composer.json
CHANGED
@@ -29,7 +29,7 @@
|
|
29 |
"require-dev": {
|
30 |
"phpunit/phpunit": "^4.8.35 || ^5.7 || 6.5 - 8",
|
31 |
"psr/log": "^1.0",
|
32 |
-
"symfony/process": "^2.5 || ^3.0 || ^4.0
|
33 |
},
|
34 |
"autoload": {
|
35 |
"psr-4": {
|
29 |
"require-dev": {
|
30 |
"phpunit/phpunit": "^4.8.35 || ^5.7 || 6.5 - 8",
|
31 |
"psr/log": "^1.0",
|
32 |
+
"symfony/process": "^2.5 || ^3.0 || ^4.0"
|
33 |
},
|
34 |
"autoload": {
|
35 |
"psr-4": {
|
vendor/composer/ca-bundle/res/cacert.pem
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
##
|
2 |
## Bundle of CA Root Certificates
|
3 |
##
|
4 |
-
## Certificate data from Mozilla as of: Wed
|
5 |
##
|
6 |
## This is a bundle of X.509 certificates of public Certificate Authorities
|
7 |
## (CA). These were automatically extracted from Mozilla's root certificates
|
@@ -14,7 +14,7 @@
|
|
14 |
## Just configure this file as the SSLCACertificateFile.
|
15 |
##
|
16 |
## Conversion done with mk-ca-bundle.pl version 1.27.
|
17 |
-
## SHA256:
|
18 |
##
|
19 |
|
20 |
|
@@ -592,6 +592,28 @@ mNEVX58Svnw2Yzi9RKR/5CYrCsSXaQ3pjOLAEFe4yHYSkVXySGnYvCoCWw9E1CAx2/S6cCZdkGCe
|
|
592 |
vEsXCS+0yx5DaMkHJ8HSXPfqIbloEpw8nL+e/IBcm2PN7EeqJSdnoDfzAIJ9VNep+OkuE6N36B9K
|
593 |
-----END CERTIFICATE-----
|
594 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
595 |
DST Root CA X3
|
596 |
==============
|
597 |
-----BEGIN CERTIFICATE-----
|
@@ -899,6 +921,28 @@ PBS1xp81HlDQwY9qcEQCYsuuHWhBp6pX6FOqB9IG9tUUBguRA3UsbHK1YZWaDYu5Def131TN3ubY
|
|
899 |
WyH8EZE0vkHve52Xdf+XlcCWWC/qu0bXu+TZLg==
|
900 |
-----END CERTIFICATE-----
|
901 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
902 |
Cybertrust Global Root
|
903 |
======================
|
904 |
-----BEGIN CERTIFICATE-----
|
1 |
##
|
2 |
## Bundle of CA Root Certificates
|
3 |
##
|
4 |
+
## Certificate data from Mozilla as of: Wed Aug 28 03:12:10 2019 GMT
|
5 |
##
|
6 |
## This is a bundle of X.509 certificates of public Certificate Authorities
|
7 |
## (CA). These were automatically extracted from Mozilla's root certificates
|
14 |
## Just configure this file as the SSLCACertificateFile.
|
15 |
##
|
16 |
## Conversion done with mk-ca-bundle.pl version 1.27.
|
17 |
+
## SHA256: fffa309937c3be940649293f749b8207fabc6eb224e50e4bb3f2c5e44e0d6a6b
|
18 |
##
|
19 |
|
20 |
|
592 |
vEsXCS+0yx5DaMkHJ8HSXPfqIbloEpw8nL+e/IBcm2PN7EeqJSdnoDfzAIJ9VNep+OkuE6N36B9K
|
593 |
-----END CERTIFICATE-----
|
594 |
|
595 |
+
Certplus Class 2 Primary CA
|
596 |
+
===========================
|
597 |
+
-----BEGIN CERTIFICATE-----
|
598 |
+
MIIDkjCCAnqgAwIBAgIRAIW9S/PY2uNp9pTXX8OlRCMwDQYJKoZIhvcNAQEFBQAwPTELMAkGA1UE
|
599 |
+
BhMCRlIxETAPBgNVBAoTCENlcnRwbHVzMRswGQYDVQQDExJDbGFzcyAyIFByaW1hcnkgQ0EwHhcN
|
600 |
+
OTkwNzA3MTcwNTAwWhcNMTkwNzA2MjM1OTU5WjA9MQswCQYDVQQGEwJGUjERMA8GA1UEChMIQ2Vy
|
601 |
+
dHBsdXMxGzAZBgNVBAMTEkNsYXNzIDIgUHJpbWFyeSBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEP
|
602 |
+
ADCCAQoCggEBANxQltAS+DXSCHh6tlJw/W/uz7kRy1134ezpfgSN1sxvc0NXYKwzCkTsA18cgCSR
|
603 |
+
5aiRVhKC9+Ar9NuuYS6JEI1rbLqzAr3VNsVINyPi8Fo3UjMXEuLRYE2+L0ER4/YXJQyLkcAbmXuZ
|
604 |
+
Vg2v7tK8R1fjeUl7NIknJITesezpWE7+Tt9avkGtrAjFGA7v0lPubNCdEgETjdyAYveVqUSISnFO
|
605 |
+
YFWe2yMZeVYHDD9jC1yw4r5+FfyUM1hBOHTE4Y+L3yasH7WLO7dDWWuwJKZtkIvEcupdM5i3y95e
|
606 |
+
e++U8Rs+yskhwcWYAqqi9lt3m/V+llU0HGdpwPFC40es/CgcZlUCAwEAAaOBjDCBiTAPBgNVHRME
|
607 |
+
CDAGAQH/AgEKMAsGA1UdDwQEAwIBBjAdBgNVHQ4EFgQU43Mt38sOKAze3bOkynm4jrvoMIkwEQYJ
|
608 |
+
YIZIAYb4QgEBBAQDAgEGMDcGA1UdHwQwMC4wLKAqoCiGJmh0dHA6Ly93d3cuY2VydHBsdXMuY29t
|
609 |
+
L0NSTC9jbGFzczIuY3JsMA0GCSqGSIb3DQEBBQUAA4IBAQCnVM+IRBnL39R/AN9WM2K191EBkOvD
|
610 |
+
P9GIROkkXe/nFL0gt5o8AP5tn9uQ3Nf0YtaLcF3n5QRIqWh8yfFC82x/xXp8HVGIutIKPidd3i1R
|
611 |
+
TtMTZGnkLuPT55sJmabglZvOGtd/vjzOUrMRFcEPF80Du5wlFbqidon8BvEY0JNLDnyCt6X09l/+
|
612 |
+
7UCmnYR0ObncHoUW2ikbhiMAybuJfm6AiB4vFLQDJKgybwOaRywwvlbGp0ICcBvqQNi6BQNwB6SW
|
613 |
+
//1IMwrh3KWBkJtN3X3n57LNXMhqlfil9o3EXXgIvnsG1knPGTZQIy4I5p4FTUcY1Rbpsda2ENW7
|
614 |
+
l7+ijrRU
|
615 |
+
-----END CERTIFICATE-----
|
616 |
+
|
617 |
DST Root CA X3
|
618 |
==============
|
619 |
-----BEGIN CERTIFICATE-----
|
921 |
WyH8EZE0vkHve52Xdf+XlcCWWC/qu0bXu+TZLg==
|
922 |
-----END CERTIFICATE-----
|
923 |
|
924 |
+
Deutsche Telekom Root CA 2
|
925 |
+
==========================
|
926 |
+
-----BEGIN CERTIFICATE-----
|
927 |
+
MIIDnzCCAoegAwIBAgIBJjANBgkqhkiG9w0BAQUFADBxMQswCQYDVQQGEwJERTEcMBoGA1UEChMT
|
928 |
+
RGV1dHNjaGUgVGVsZWtvbSBBRzEfMB0GA1UECxMWVC1UZWxlU2VjIFRydXN0IENlbnRlcjEjMCEG
|
929 |
+
A1UEAxMaRGV1dHNjaGUgVGVsZWtvbSBSb290IENBIDIwHhcNOTkwNzA5MTIxMTAwWhcNMTkwNzA5
|
930 |
+
MjM1OTAwWjBxMQswCQYDVQQGEwJERTEcMBoGA1UEChMTRGV1dHNjaGUgVGVsZWtvbSBBRzEfMB0G
|
931 |
+
A1UECxMWVC1UZWxlU2VjIFRydXN0IENlbnRlcjEjMCEGA1UEAxMaRGV1dHNjaGUgVGVsZWtvbSBS
|
932 |
+
b290IENBIDIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCrC6M14IspFLEUha88EOQ5
|
933 |
+
bzVdSq7d6mGNlUn0b2SjGmBmpKlAIoTZ1KXleJMOaAGtuU1cOs7TuKhCQN/Po7qCWWqSG6wcmtoI
|
934 |
+
KyUn+WkjR/Hg6yx6m/UTAtB+NHzCnjwAWav12gz1MjwrrFDa1sPeg5TKqAyZMg4ISFZbavva4VhY
|
935 |
+
AUlfckE8FQYBjl2tqriTtM2e66foai1SNNs671x1Udrb8zH57nGYMsRUFUQM+ZtV7a3fGAigo4aK
|
936 |
+
Se5TBY8ZTNXeWHmb0mocQqvF1afPaA+W5OFhmHZhyJF81j4A4pFQh+GdCuatl9Idxjp9y7zaAzTV
|
937 |
+
jlsB9WoHtxa2bkp/AgMBAAGjQjBAMB0GA1UdDgQWBBQxw3kbuvVT1xfgiXotF2wKsyudMzAPBgNV
|
938 |
+
HRMECDAGAQH/AgEFMA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQUFAAOCAQEAlGRZrTlk5ynr
|
939 |
+
E/5aw4sTV8gEJPB0d8Bg42f76Ymmg7+Wgnxu1MM9756AbrsptJh6sTtU6zkXR34ajgv8HzFZMQSy
|
940 |
+
zhfzLMdiNlXiItiJVbSYSKpk+tYcNthEeFpaIzpXl/V6ME+un2pMSyuOoAPjPuCp1NJ70rOo4nI8
|
941 |
+
rZ7/gFnkm0W09juwzTkZmDLl6iFhkOQxIY40sfcvNUqFENrnijchvllj4PKFiDFT1FQUhXB59C4G
|
942 |
+
dyd1Lx+4ivn+xbrYNuSD7Odlt79jWvNGr4GUN9RBjNYj1h7P9WgbRGOiWrqnNVmh5XAFmw4jV5mU
|
943 |
+
Cm26OWMohpLzGITY+9HPBVZkVw==
|
944 |
+
-----END CERTIFICATE-----
|
945 |
+
|
946 |
Cybertrust Global Root
|
947 |
======================
|
948 |
-----BEGIN CERTIFICATE-----
|
vendor/composer/ca-bundle/src/CaBundle.php
CHANGED
@@ -92,7 +92,6 @@ class CaBundle
|
|
92 |
'/etc/ssl/cert.pem', // OpenBSD
|
93 |
'/usr/local/etc/ssl/cert.pem', // FreeBSD 10.x
|
94 |
'/usr/local/etc/openssl/cert.pem', // OS X homebrew, openssl package
|
95 |
-
'/usr/local/etc/openssl@1.1/cert.pem', // OS X homebrew, openssl@1.1 package
|
96 |
);
|
97 |
|
98 |
foreach($otherLocations as $location) {
|
92 |
'/etc/ssl/cert.pem', // OpenBSD
|
93 |
'/usr/local/etc/ssl/cert.pem', // FreeBSD 10.x
|
94 |
'/usr/local/etc/openssl/cert.pem', // OS X homebrew, openssl package
|
|
|
95 |
);
|
96 |
|
97 |
foreach($otherLocations as $location) {
|
vendor/composer/installed.json
CHANGED
@@ -1,17 +1,17 @@
|
|
1 |
[
|
2 |
{
|
3 |
"name": "composer/ca-bundle",
|
4 |
-
"version": "1.2.
|
5 |
-
"version_normalized": "1.2.
|
6 |
"source": {
|
7 |
"type": "git",
|
8 |
"url": "https://github.com/composer/ca-bundle.git",
|
9 |
-
"reference": "
|
10 |
},
|
11 |
"dist": {
|
12 |
"type": "zip",
|
13 |
-
"url": "https://api.github.com/repos/composer/ca-bundle/zipball/
|
14 |
-
"reference": "
|
15 |
"shasum": ""
|
16 |
},
|
17 |
"require": {
|
@@ -22,9 +22,9 @@
|
|
22 |
"require-dev": {
|
23 |
"phpunit/phpunit": "^4.8.35 || ^5.7 || 6.5 - 8",
|
24 |
"psr/log": "^1.0",
|
25 |
-
"symfony/process": "^2.5 || ^3.0 || ^4.0
|
26 |
},
|
27 |
-
"time": "2019-
|
28 |
"type": "library",
|
29 |
"extra": {
|
30 |
"branch-alias": {
|
@@ -58,38 +58,36 @@
|
|
58 |
]
|
59 |
},
|
60 |
{
|
61 |
-
"name": "
|
62 |
-
"version": "
|
63 |
-
"version_normalized": "
|
64 |
"source": {
|
65 |
"type": "git",
|
66 |
-
"url": "https://github.com/maxmind/
|
67 |
-
"reference": "
|
68 |
},
|
69 |
"dist": {
|
70 |
"type": "zip",
|
71 |
-
"url": "https://api.github.com/repos/maxmind/
|
72 |
-
"reference": "
|
73 |
"shasum": ""
|
74 |
},
|
75 |
"require": {
|
76 |
-
"
|
77 |
-
"
|
78 |
-
"
|
79 |
-
"php": ">=5.6"
|
80 |
},
|
81 |
"require-dev": {
|
82 |
"friendsofphp/php-cs-fixer": "2.*",
|
83 |
-
"phpunit/phpunit": "
|
84 |
"squizlabs/php_codesniffer": "3.*"
|
85 |
},
|
86 |
-
"time": "
|
87 |
"type": "library",
|
88 |
"installation-source": "dist",
|
89 |
"autoload": {
|
90 |
"psr-4": {
|
91 |
-
"
|
92 |
-
"MaxMind\\WebService\\": "src/WebService"
|
93 |
}
|
94 |
},
|
95 |
"notification-url": "https://packagist.org/downloads/",
|
@@ -98,34 +96,39 @@
|
|
98 |
],
|
99 |
"authors": [
|
100 |
{
|
101 |
-
"name": "Gregory Oschwald",
|
102 |
-
"email": "goschwald@maxmind.com"
|
|
|
103 |
}
|
104 |
],
|
105 |
-
"description": "
|
106 |
-
"homepage": "https://github.com/maxmind/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
107 |
},
|
108 |
{
|
109 |
"name": "maxmind-db/reader",
|
110 |
-
"version": "v1.
|
111 |
-
"version_normalized": "1.
|
112 |
"source": {
|
113 |
"type": "git",
|
114 |
"url": "https://github.com/maxmind/MaxMind-DB-Reader-php.git",
|
115 |
-
"reference": "
|
116 |
},
|
117 |
"dist": {
|
118 |
"type": "zip",
|
119 |
-
"url": "https://api.github.com/repos/maxmind/MaxMind-DB-Reader-php/zipball/
|
120 |
-
"reference": "
|
121 |
"shasum": ""
|
122 |
},
|
123 |
"require": {
|
124 |
"php": ">=5.6"
|
125 |
},
|
126 |
-
"conflict": {
|
127 |
-
"ext-maxminddb": "<1.6.0,>=2.0.0"
|
128 |
-
},
|
129 |
"require-dev": {
|
130 |
"friendsofphp/php-cs-fixer": "2.*",
|
131 |
"php-coveralls/php-coveralls": "^2.1",
|
@@ -138,7 +141,7 @@
|
|
138 |
"ext-gmp": "bcmath or gmp is required for decoding larger integers with the pure PHP decoder",
|
139 |
"ext-maxminddb": "A C-based database decoder that provides significantly faster lookups"
|
140 |
},
|
141 |
-
"time": "2019-
|
142 |
"type": "library",
|
143 |
"installation-source": "dist",
|
144 |
"autoload": {
|
@@ -168,37 +171,38 @@
|
|
168 |
]
|
169 |
},
|
170 |
{
|
171 |
-
"name": "
|
172 |
-
"version": "
|
173 |
-
"version_normalized": "
|
174 |
"source": {
|
175 |
"type": "git",
|
176 |
-
"url": "https://github.com/maxmind/
|
177 |
-
"reference": "
|
178 |
},
|
179 |
"dist": {
|
180 |
"type": "zip",
|
181 |
-
"url": "https://api.github.com/repos/maxmind/
|
182 |
-
"reference": "
|
183 |
"shasum": ""
|
184 |
},
|
185 |
"require": {
|
|
|
|
|
186 |
"ext-json": "*",
|
187 |
-
"
|
188 |
-
"maxmind/web-service-common": "~0.6",
|
189 |
-
"php": ">=5.6"
|
190 |
},
|
191 |
"require-dev": {
|
192 |
"friendsofphp/php-cs-fixer": "2.*",
|
193 |
-
"phpunit/phpunit": "
|
194 |
"squizlabs/php_codesniffer": "3.*"
|
195 |
},
|
196 |
-
"time": "
|
197 |
"type": "library",
|
198 |
"installation-source": "dist",
|
199 |
"autoload": {
|
200 |
"psr-4": {
|
201 |
-
"
|
|
|
202 |
}
|
203 |
},
|
204 |
"notification-url": "https://packagist.org/downloads/",
|
@@ -207,19 +211,11 @@
|
|
207 |
],
|
208 |
"authors": [
|
209 |
{
|
210 |
-
"name": "Gregory
|
211 |
-
"email": "goschwald@maxmind.com"
|
212 |
-
"homepage": "https://www.maxmind.com/"
|
213 |
}
|
214 |
],
|
215 |
-
"description": "MaxMind
|
216 |
-
"homepage": "https://github.com/maxmind/
|
217 |
-
"keywords": [
|
218 |
-
"IP",
|
219 |
-
"geoip",
|
220 |
-
"geoip2",
|
221 |
-
"geolocation",
|
222 |
-
"maxmind"
|
223 |
-
]
|
224 |
}
|
225 |
]
|
1 |
[
|
2 |
{
|
3 |
"name": "composer/ca-bundle",
|
4 |
+
"version": "1.2.4",
|
5 |
+
"version_normalized": "1.2.4.0",
|
6 |
"source": {
|
7 |
"type": "git",
|
8 |
"url": "https://github.com/composer/ca-bundle.git",
|
9 |
+
"reference": "10bb96592168a0f8e8f6dcde3532d9fa50b0b527"
|
10 |
},
|
11 |
"dist": {
|
12 |
"type": "zip",
|
13 |
+
"url": "https://api.github.com/repos/composer/ca-bundle/zipball/10bb96592168a0f8e8f6dcde3532d9fa50b0b527",
|
14 |
+
"reference": "10bb96592168a0f8e8f6dcde3532d9fa50b0b527",
|
15 |
"shasum": ""
|
16 |
},
|
17 |
"require": {
|
22 |
"require-dev": {
|
23 |
"phpunit/phpunit": "^4.8.35 || ^5.7 || 6.5 - 8",
|
24 |
"psr/log": "^1.0",
|
25 |
+
"symfony/process": "^2.5 || ^3.0 || ^4.0"
|
26 |
},
|
27 |
+
"time": "2019-08-30T08:44:50+00:00",
|
28 |
"type": "library",
|
29 |
"extra": {
|
30 |
"branch-alias": {
|
58 |
]
|
59 |
},
|
60 |
{
|
61 |
+
"name": "geoip2/geoip2",
|
62 |
+
"version": "v2.9.0",
|
63 |
+
"version_normalized": "2.9.0.0",
|
64 |
"source": {
|
65 |
"type": "git",
|
66 |
+
"url": "https://github.com/maxmind/GeoIP2-php.git",
|
67 |
+
"reference": "a807fbf65212eef5d8d2db1a1b31082b53633d77"
|
68 |
},
|
69 |
"dist": {
|
70 |
"type": "zip",
|
71 |
+
"url": "https://api.github.com/repos/maxmind/GeoIP2-php/zipball/a807fbf65212eef5d8d2db1a1b31082b53633d77",
|
72 |
+
"reference": "a807fbf65212eef5d8d2db1a1b31082b53633d77",
|
73 |
"shasum": ""
|
74 |
},
|
75 |
"require": {
|
76 |
+
"maxmind-db/reader": "~1.0",
|
77 |
+
"maxmind/web-service-common": "~0.5",
|
78 |
+
"php": ">=5.4"
|
|
|
79 |
},
|
80 |
"require-dev": {
|
81 |
"friendsofphp/php-cs-fixer": "2.*",
|
82 |
+
"phpunit/phpunit": "4.*",
|
83 |
"squizlabs/php_codesniffer": "3.*"
|
84 |
},
|
85 |
+
"time": "2018-04-10T15:32:59+00:00",
|
86 |
"type": "library",
|
87 |
"installation-source": "dist",
|
88 |
"autoload": {
|
89 |
"psr-4": {
|
90 |
+
"GeoIp2\\": "src"
|
|
|
91 |
}
|
92 |
},
|
93 |
"notification-url": "https://packagist.org/downloads/",
|
96 |
],
|
97 |
"authors": [
|
98 |
{
|
99 |
+
"name": "Gregory J. Oschwald",
|
100 |
+
"email": "goschwald@maxmind.com",
|
101 |
+
"homepage": "http://www.maxmind.com/"
|
102 |
}
|
103 |
],
|
104 |
+
"description": "MaxMind GeoIP2 PHP API",
|
105 |
+
"homepage": "https://github.com/maxmind/GeoIP2-php",
|
106 |
+
"keywords": [
|
107 |
+
"IP",
|
108 |
+
"geoip",
|
109 |
+
"geoip2",
|
110 |
+
"geolocation",
|
111 |
+
"maxmind"
|
112 |
+
]
|
113 |
},
|
114 |
{
|
115 |
"name": "maxmind-db/reader",
|
116 |
+
"version": "v1.5.0",
|
117 |
+
"version_normalized": "1.5.0.0",
|
118 |
"source": {
|
119 |
"type": "git",
|
120 |
"url": "https://github.com/maxmind/MaxMind-DB-Reader-php.git",
|
121 |
+
"reference": "bd436094fc0a9b0558a899fb80b0ae34fe1808a0"
|
122 |
},
|
123 |
"dist": {
|
124 |
"type": "zip",
|
125 |
+
"url": "https://api.github.com/repos/maxmind/MaxMind-DB-Reader-php/zipball/bd436094fc0a9b0558a899fb80b0ae34fe1808a0",
|
126 |
+
"reference": "bd436094fc0a9b0558a899fb80b0ae34fe1808a0",
|
127 |
"shasum": ""
|
128 |
},
|
129 |
"require": {
|
130 |
"php": ">=5.6"
|
131 |
},
|
|
|
|
|
|
|
132 |
"require-dev": {
|
133 |
"friendsofphp/php-cs-fixer": "2.*",
|
134 |
"php-coveralls/php-coveralls": "^2.1",
|
141 |
"ext-gmp": "bcmath or gmp is required for decoding larger integers with the pure PHP decoder",
|
142 |
"ext-maxminddb": "A C-based database decoder that provides significantly faster lookups"
|
143 |
},
|
144 |
+
"time": "2019-09-30T22:56:38+00:00",
|
145 |
"type": "library",
|
146 |
"installation-source": "dist",
|
147 |
"autoload": {
|
171 |
]
|
172 |
},
|
173 |
{
|
174 |
+
"name": "maxmind/web-service-common",
|
175 |
+
"version": "v0.5.0",
|
176 |
+
"version_normalized": "0.5.0.0",
|
177 |
"source": {
|
178 |
"type": "git",
|
179 |
+
"url": "https://github.com/maxmind/web-service-common-php.git",
|
180 |
+
"reference": "61a9836fa3bb1743ab89752bae5005d71e78c73b"
|
181 |
},
|
182 |
"dist": {
|
183 |
"type": "zip",
|
184 |
+
"url": "https://api.github.com/repos/maxmind/web-service-common-php/zipball/61a9836fa3bb1743ab89752bae5005d71e78c73b",
|
185 |
+
"reference": "61a9836fa3bb1743ab89752bae5005d71e78c73b",
|
186 |
"shasum": ""
|
187 |
},
|
188 |
"require": {
|
189 |
+
"composer/ca-bundle": "^1.0.3",
|
190 |
+
"ext-curl": "*",
|
191 |
"ext-json": "*",
|
192 |
+
"php": ">=5.4"
|
|
|
|
|
193 |
},
|
194 |
"require-dev": {
|
195 |
"friendsofphp/php-cs-fixer": "2.*",
|
196 |
+
"phpunit/phpunit": "4.*",
|
197 |
"squizlabs/php_codesniffer": "3.*"
|
198 |
},
|
199 |
+
"time": "2018-02-12T22:31:54+00:00",
|
200 |
"type": "library",
|
201 |
"installation-source": "dist",
|
202 |
"autoload": {
|
203 |
"psr-4": {
|
204 |
+
"MaxMind\\Exception\\": "src/Exception",
|
205 |
+
"MaxMind\\WebService\\": "src/WebService"
|
206 |
}
|
207 |
},
|
208 |
"notification-url": "https://packagist.org/downloads/",
|
211 |
],
|
212 |
"authors": [
|
213 |
{
|
214 |
+
"name": "Gregory Oschwald",
|
215 |
+
"email": "goschwald@maxmind.com"
|
|
|
216 |
}
|
217 |
],
|
218 |
+
"description": "Internal MaxMind Web Service API",
|
219 |
+
"homepage": "https://github.com/maxmind/web-service-common-php"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
220 |
}
|
221 |
]
|
vendor/geoip2/geoip2/CHANGELOG.md
CHANGED
@@ -1,26 +1,6 @@
|
|
1 |
CHANGELOG
|
2 |
=========
|
3 |
|
4 |
-
2.10.0 (2019-12-12)
|
5 |
-
-------------------
|
6 |
-
|
7 |
-
* PHP 5.6 or greater is now required.
|
8 |
-
* The `network` property was added to `GeoIp2\Record\Traits`,
|
9 |
-
`GeoIp2\Model\AnonymousIp`, `GeoIp2\Model\Asn`,
|
10 |
-
`GeoIp2\Model\ConnectionType`, `Geoip2\Model\Domain`,
|
11 |
-
and `GeoIp2\Model\Isp`. This is a string in CIDR format representing the
|
12 |
-
largest network where all of the properties besides `ipAddress` have the
|
13 |
-
same value.
|
14 |
-
* Updated documentation of anonymizer properties - `isAnonymousVpn`
|
15 |
-
and `isHostingProvider` - to be more descriptive.
|
16 |
-
* The `userCount` property was added to `GeoIp2\Record\Traits`. This is an
|
17 |
-
integer which indicates the estimated number of users sharing the
|
18 |
-
IP/network during the past 24 hours. This output is available from GeoIP2
|
19 |
-
Precision Insights.
|
20 |
-
* The `staticIpScore` property was added to `GeoIp2\Record\Traits`. This is
|
21 |
-
a float which indicates how static or dynamic an IP address is. This
|
22 |
-
output is available from GeoIP2 Precision Insights.
|
23 |
-
|
24 |
2.9.0 (2018-04-10)
|
25 |
------------------
|
26 |
|
1 |
CHANGELOG
|
2 |
=========
|
3 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
2.9.0 (2018-04-10)
|
5 |
------------------
|
6 |
|
vendor/geoip2/geoip2/README.md
CHANGED
@@ -3,14 +3,14 @@
|
|
3 |
## Description ##
|
4 |
|
5 |
This package provides an API for the GeoIP2
|
6 |
-
[web services](
|
7 |
-
[databases](
|
8 |
works with the free
|
9 |
-
[GeoLite2 databases](
|
10 |
|
11 |
## Install via Composer ##
|
12 |
|
13 |
-
We recommend installing this package with [Composer](
|
14 |
|
15 |
### Download Composer ###
|
16 |
|
@@ -46,18 +46,18 @@ require 'vendor/autoload.php';
|
|
46 |
## Install via Phar ##
|
47 |
|
48 |
Although we strongly recommend using Composer, we also provide a
|
49 |
-
[phar archive](
|
50 |
dependencies for GeoIP2. Our latest phar archive is available on
|
51 |
[our releases page](https://github.com/maxmind/GeoIP2-php/releases).
|
52 |
|
53 |
### Install Dependencies ###
|
54 |
|
55 |
In order to use the phar archive, you must have the PHP
|
56 |
-
[Phar extension](
|
57 |
enabled.
|
58 |
|
59 |
If you will be making web service requests, you must have the PHP
|
60 |
-
[cURL extension](
|
61 |
installed to use this archive. For Debian based distributions, this can
|
62 |
typically be found in the the `php-curl` package. For other operating
|
63 |
systems, please consult the relevant documentation. After installing the
|
@@ -140,8 +140,6 @@ print($record->postal->code . "\n"); // '55455'
|
|
140 |
print($record->location->latitude . "\n"); // 44.9733
|
141 |
print($record->location->longitude . "\n"); // -93.2323
|
142 |
|
143 |
-
print($record->traits->network . "\n"); // '128.101.101.101/32'
|
144 |
-
|
145 |
```
|
146 |
|
147 |
### Anonymous IP Example ###
|
@@ -159,7 +157,6 @@ $record = $reader->anonymousIp('128.101.101.101');
|
|
159 |
|
160 |
if ($record->isAnonymous) { print "anon\n"; }
|
161 |
print($record->ipAddress . "\n"); // '128.101.101.101'
|
162 |
-
print($record->network . "\n"); // '128.101.101.101/32'
|
163 |
|
164 |
```
|
165 |
|
@@ -178,7 +175,6 @@ $record = $reader->connectionType('128.101.101.101');
|
|
178 |
|
179 |
print($record->connectionType . "\n"); // 'Corporate'
|
180 |
print($record->ipAddress . "\n"); // '128.101.101.101'
|
181 |
-
print($record->network . "\n"); // '128.101.101.101/32'
|
182 |
|
183 |
```
|
184 |
|
@@ -197,7 +193,6 @@ $record = $reader->domain('128.101.101.101');
|
|
197 |
|
198 |
print($record->domain . "\n"); // 'umn.edu'
|
199 |
print($record->ipAddress . "\n"); // '128.101.101.101'
|
200 |
-
print($record->network . "\n"); // '128.101.101.101/32'
|
201 |
|
202 |
```
|
203 |
|
@@ -233,8 +228,6 @@ print($record->location->accuracyRadius . "\n"); // 50
|
|
233 |
print($record->location->latitude . "\n"); // 44.9733
|
234 |
print($record->location->longitude . "\n"); // -93.2323
|
235 |
|
236 |
-
print($record->traits->network . "\n"); // '128.101.101.101/32'
|
237 |
-
|
238 |
```
|
239 |
|
240 |
### ISP Example ###
|
@@ -256,7 +249,6 @@ print($record->isp . "\n"); // 'University of Minnesota'
|
|
256 |
print($record->organization . "\n"); // 'University of Minnesota'
|
257 |
|
258 |
print($record->ipAddress . "\n"); // '128.101.101.101'
|
259 |
-
print($record->network . "\n"); // '128.101.101.101/32'
|
260 |
|
261 |
```
|
262 |
|
@@ -307,8 +299,6 @@ print($record->postal->code . "\n"); // '55455'
|
|
307 |
print($record->location->latitude . "\n"); // 44.9733
|
308 |
print($record->location->longitude . "\n"); // -93.2323
|
309 |
|
310 |
-
print($record->traits->network . "\n"); // '128.101.101.101/32'
|
311 |
-
|
312 |
```
|
313 |
|
314 |
## Values to use for Database or Array Keys ##
|
@@ -336,7 +326,7 @@ Because of these factors, it is possible for any end point to return a record
|
|
336 |
where some or all of the attributes are unpopulated.
|
337 |
|
338 |
See the
|
339 |
-
[GeoIP2 Precision web service docs](
|
340 |
for details on what data each end point may return.
|
341 |
|
342 |
The only piece of data which is always returned is the `ipAddress`
|
@@ -344,7 +334,7 @@ attribute in the `GeoIp2\Record\Traits` record.
|
|
344 |
|
345 |
## Integration with GeoNames ##
|
346 |
|
347 |
-
[GeoNames](
|
348 |
databases with data on geographical features around the world, including
|
349 |
populated places. They offer both free and paid premium data. Each
|
350 |
feature is unique identified by a `geonameId`, which is an integer.
|
@@ -361,10 +351,10 @@ the GeoNames premium data set.
|
|
361 |
|
362 |
If the problem you find is that an IP address is incorrectly mapped,
|
363 |
please
|
364 |
-
[submit your correction to MaxMind](
|
365 |
|
366 |
If you find some other sort of mistake, like an incorrect spelling,
|
367 |
-
please check the [GeoNames site](
|
368 |
you've searched for a place and found it on the GeoNames map view, there
|
369 |
are a number of links you can use to correct data ("move", "edit",
|
370 |
"alternate names", etc.). Once the correction is part of the GeoNames
|
@@ -373,7 +363,7 @@ releases.
|
|
373 |
|
374 |
If you are a paying MaxMind customer and you're not sure where to submit
|
375 |
a correction, please
|
376 |
-
[contact MaxMind support](
|
377 |
|
378 |
## Other Support ##
|
379 |
|
@@ -382,11 +372,12 @@ Please report all issues with this code using the
|
|
382 |
|
383 |
If you are having an issue with a MaxMind service that is not specific
|
384 |
to the client API, please see
|
385 |
-
[our support page](
|
386 |
|
387 |
## Requirements ##
|
388 |
|
389 |
-
This library requires PHP 5.
|
|
|
390 |
|
391 |
This library also relies on the [MaxMind DB Reader](https://github.com/maxmind/MaxMind-DB-Reader-php).
|
392 |
|
@@ -400,10 +391,11 @@ https://github.com/maxmind/MaxMind-DB
|
|
400 |
|
401 |
## Versioning ##
|
402 |
|
403 |
-
The GeoIP2 PHP API uses [Semantic Versioning](
|
404 |
|
405 |
## Copyright and License ##
|
406 |
|
407 |
This software is Copyright (c) 2013-2019 by MaxMind, Inc.
|
408 |
|
409 |
This is free software, licensed under the Apache License, Version 2.0.
|
|
3 |
## Description ##
|
4 |
|
5 |
This package provides an API for the GeoIP2
|
6 |
+
[web services](http://dev.maxmind.com/geoip/geoip2/web-services) and
|
7 |
+
[databases](http://dev.maxmind.com/geoip/geoip2/downloadable). The API also
|
8 |
works with the free
|
9 |
+
[GeoLite2 databases](http://dev.maxmind.com/geoip/geoip2/geolite2/).
|
10 |
|
11 |
## Install via Composer ##
|
12 |
|
13 |
+
We recommend installing this package with [Composer](http://getcomposer.org/).
|
14 |
|
15 |
### Download Composer ###
|
16 |
|
46 |
## Install via Phar ##
|
47 |
|
48 |
Although we strongly recommend using Composer, we also provide a
|
49 |
+
[phar archive](http://php.net/manual/en/book.phar.php) containing most of the
|
50 |
dependencies for GeoIP2. Our latest phar archive is available on
|
51 |
[our releases page](https://github.com/maxmind/GeoIP2-php/releases).
|
52 |
|
53 |
### Install Dependencies ###
|
54 |
|
55 |
In order to use the phar archive, you must have the PHP
|
56 |
+
[Phar extension](http://php.net/manual/en/book.phar.php) installed and
|
57 |
enabled.
|
58 |
|
59 |
If you will be making web service requests, you must have the PHP
|
60 |
+
[cURL extension](http://php.net/manual/en/book.curl.php)
|
61 |
installed to use this archive. For Debian based distributions, this can
|
62 |
typically be found in the the `php-curl` package. For other operating
|
63 |
systems, please consult the relevant documentation. After installing the
|
140 |
print($record->location->latitude . "\n"); // 44.9733
|
141 |
print($record->location->longitude . "\n"); // -93.2323
|
142 |
|
|
|
|
|
143 |
```
|
144 |
|
145 |
### Anonymous IP Example ###
|
157 |
|
158 |
if ($record->isAnonymous) { print "anon\n"; }
|
159 |
print($record->ipAddress . "\n"); // '128.101.101.101'
|
|
|
160 |
|
161 |
```
|
162 |
|
175 |
|
176 |
print($record->connectionType . "\n"); // 'Corporate'
|
177 |
print($record->ipAddress . "\n"); // '128.101.101.101'
|
|
|
178 |
|
179 |
```
|
180 |
|
193 |
|
194 |
print($record->domain . "\n"); // 'umn.edu'
|
195 |
print($record->ipAddress . "\n"); // '128.101.101.101'
|
|
|
196 |
|
197 |
```
|
198 |
|
228 |
print($record->location->latitude . "\n"); // 44.9733
|
229 |
print($record->location->longitude . "\n"); // -93.2323
|
230 |
|
|
|
|
|
231 |
```
|
232 |
|
233 |
### ISP Example ###
|
249 |
print($record->organization . "\n"); // 'University of Minnesota'
|
250 |
|
251 |
print($record->ipAddress . "\n"); // '128.101.101.101'
|
|
|
252 |
|
253 |
```
|
254 |
|
299 |
print($record->location->latitude . "\n"); // 44.9733
|
300 |
print($record->location->longitude . "\n"); // -93.2323
|
301 |
|
|
|
|
|
302 |
```
|
303 |
|
304 |
## Values to use for Database or Array Keys ##
|
326 |
where some or all of the attributes are unpopulated.
|
327 |
|
328 |
See the
|
329 |
+
[GeoIP2 Precision web service docs](http://dev.maxmind.com/geoip/geoip2/web-services)
|
330 |
for details on what data each end point may return.
|
331 |
|
332 |
The only piece of data which is always returned is the `ipAddress`
|
334 |
|
335 |
## Integration with GeoNames ##
|
336 |
|
337 |
+
[GeoNames](http://www.geonames.org/) offers web services and downloadable
|
338 |
databases with data on geographical features around the world, including
|
339 |
populated places. They offer both free and paid premium data. Each
|
340 |
feature is unique identified by a `geonameId`, which is an integer.
|
351 |
|
352 |
If the problem you find is that an IP address is incorrectly mapped,
|
353 |
please
|
354 |
+
[submit your correction to MaxMind](http://www.maxmind.com/en/correction).
|
355 |
|
356 |
If you find some other sort of mistake, like an incorrect spelling,
|
357 |
+
please check the [GeoNames site](http://www.geonames.org/) first. Once
|
358 |
you've searched for a place and found it on the GeoNames map view, there
|
359 |
are a number of links you can use to correct data ("move", "edit",
|
360 |
"alternate names", etc.). Once the correction is part of the GeoNames
|
363 |
|
364 |
If you are a paying MaxMind customer and you're not sure where to submit
|
365 |
a correction, please
|
366 |
+
[contact MaxMind support](http://www.maxmind.com/en/support) for help.
|
367 |
|
368 |
## Other Support ##
|
369 |
|
372 |
|
373 |
If you are having an issue with a MaxMind service that is not specific
|
374 |
to the client API, please see
|
375 |
+
[our support page](http://www.maxmind.com/en/support).
|
376 |
|
377 |
## Requirements ##
|
378 |
|
379 |
+
This library requires PHP 5.4 or greater. This library works and is tested
|
380 |
+
with HHVM.
|
381 |
|
382 |
This library also relies on the [MaxMind DB Reader](https://github.com/maxmind/MaxMind-DB-Reader-php).
|
383 |
|
391 |
|
392 |
## Versioning ##
|
393 |
|
394 |
+
The GeoIP2 PHP API uses [Semantic Versioning](http://semver.org/).
|
395 |
|
396 |
## Copyright and License ##
|
397 |
|
398 |
This software is Copyright (c) 2013-2019 by MaxMind, Inc.
|
399 |
|
400 |
This is free software, licensed under the Apache License, Version 2.0.
|
401 |
+
|
vendor/geoip2/geoip2/composer.json
CHANGED
@@ -9,18 +9,17 @@
|
|
9 |
{
|
10 |
"name": "Gregory J. Oschwald",
|
11 |
"email": "goschwald@maxmind.com",
|
12 |
-
"homepage": "
|
13 |
}
|
14 |
],
|
15 |
"require": {
|
16 |
-
"maxmind-db/reader": "~1.
|
17 |
-
"maxmind/web-service-common": "~0.
|
18 |
-
"php": ">=5.
|
19 |
-
"ext-json": "*"
|
20 |
},
|
21 |
"require-dev": {
|
22 |
"friendsofphp/php-cs-fixer": "2.*",
|
23 |
-
"phpunit/phpunit": "
|
24 |
"squizlabs/php_codesniffer": "3.*"
|
25 |
},
|
26 |
"autoload": {
|
9 |
{
|
10 |
"name": "Gregory J. Oschwald",
|
11 |
"email": "goschwald@maxmind.com",
|
12 |
+
"homepage": "http://www.maxmind.com/"
|
13 |
}
|
14 |
],
|
15 |
"require": {
|
16 |
+
"maxmind-db/reader": "~1.0",
|
17 |
+
"maxmind/web-service-common": "~0.5",
|
18 |
+
"php": ">=5.4"
|
|
|
19 |
},
|
20 |
"require-dev": {
|
21 |
"friendsofphp/php-cs-fixer": "2.*",
|
22 |
+
"phpunit/phpunit": "4.*",
|
23 |
"squizlabs/php_codesniffer": "3.*"
|
24 |
},
|
25 |
"autoload": {
|
vendor/geoip2/geoip2/src/Database/Reader.php
CHANGED
@@ -34,7 +34,6 @@ use MaxMind\Db\Reader\InvalidDatabaseException;
|
|
34 |
class Reader implements ProviderInterface
|
35 |
{
|
36 |
private $dbReader;
|
37 |
-
private $dbType;
|
38 |
private $locales;
|
39 |
|
40 |
/**
|
@@ -52,7 +51,6 @@ class Reader implements ProviderInterface
|
|
52 |
$locales = ['en']
|
53 |
) {
|
54 |
$this->dbReader = new DbReader($filename);
|
55 |
-
$this->dbType = $this->dbReader->metadata()->databaseType;
|
56 |
$this->locales = $locales;
|
57 |
}
|
58 |
|
@@ -214,11 +212,9 @@ class Reader implements ProviderInterface
|
|
214 |
|
215 |
private function modelFor($class, $type, $ipAddress)
|
216 |
{
|
217 |
-
|
218 |
|
219 |
$record['traits']['ip_address'] = $ipAddress;
|
220 |
-
$record['traits']['prefix_len'] = $prefixLen;
|
221 |
-
|
222 |
$class = 'GeoIp2\\Model\\' . $class;
|
223 |
|
224 |
return new $class($record, $this->locales);
|
@@ -226,10 +222,9 @@ class Reader implements ProviderInterface
|
|
226 |
|
227 |
private function flatModelFor($class, $type, $ipAddress)
|
228 |
{
|
229 |
-
|
230 |
|
231 |
$record['ip_address'] = $ipAddress;
|
232 |
-
$record['prefix_len'] = $prefixLen;
|
233 |
$class = 'GeoIp2\\Model\\' . $class;
|
234 |
|
235 |
return new $class($record);
|
@@ -237,19 +232,20 @@ class Reader implements ProviderInterface
|
|
237 |
|
238 |
private function getRecord($class, $type, $ipAddress)
|
239 |
{
|
240 |
-
if (strpos($this->
|
241 |
$method = lcfirst($class);
|
242 |
throw new \BadMethodCallException(
|
243 |
-
"The $method method cannot be used to open a
|
|
|
244 |
);
|
245 |
}
|
246 |
-
|
247 |
if ($record === null) {
|
248 |
throw new AddressNotFoundException(
|
249 |
"The address $ipAddress is not in the database."
|
250 |
);
|
251 |
}
|
252 |
-
if (
|
253 |
// This can happen on corrupt databases. Generally,
|
254 |
// MaxMind\Db\Reader will throw a
|
255 |
// MaxMind\Db\Reader\InvalidDatabaseException, but occasionally
|
@@ -259,11 +255,11 @@ class Reader implements ProviderInterface
|
|
259 |
// exceptions go unnoticed.
|
260 |
throw new InvalidDatabaseException(
|
261 |
"Expected an array when looking up $ipAddress but received: "
|
262 |
-
.
|
263 |
);
|
264 |
}
|
265 |
|
266 |
-
return
|
267 |
}
|
268 |
|
269 |
/**
|
34 |
class Reader implements ProviderInterface
|
35 |
{
|
36 |
private $dbReader;
|
|
|
37 |
private $locales;
|
38 |
|
39 |
/**
|
51 |
$locales = ['en']
|
52 |
) {
|
53 |
$this->dbReader = new DbReader($filename);
|
|
|
54 |
$this->locales = $locales;
|
55 |
}
|
56 |
|
212 |
|
213 |
private function modelFor($class, $type, $ipAddress)
|
214 |
{
|
215 |
+
$record = $this->getRecord($class, $type, $ipAddress);
|
216 |
|
217 |
$record['traits']['ip_address'] = $ipAddress;
|
|
|
|
|
218 |
$class = 'GeoIp2\\Model\\' . $class;
|
219 |
|
220 |
return new $class($record, $this->locales);
|
222 |
|
223 |
private function flatModelFor($class, $type, $ipAddress)
|
224 |
{
|
225 |
+
$record = $this->getRecord($class, $type, $ipAddress);
|
226 |
|
227 |
$record['ip_address'] = $ipAddress;
|
|
|
228 |
$class = 'GeoIp2\\Model\\' . $class;
|
229 |
|
230 |
return new $class($record);
|
232 |
|
233 |
private function getRecord($class, $type, $ipAddress)
|
234 |
{
|
235 |
+
if (strpos($this->metadata()->databaseType, $type) === false) {
|
236 |
$method = lcfirst($class);
|
237 |
throw new \BadMethodCallException(
|
238 |
+
"The $method method cannot be used to open a "
|
239 |
+
. $this->metadata()->databaseType . ' database'
|
240 |
);
|
241 |
}
|
242 |
+
$record = $this->dbReader->get($ipAddress);
|
243 |
if ($record === null) {
|
244 |
throw new AddressNotFoundException(
|
245 |
"The address $ipAddress is not in the database."
|
246 |
);
|
247 |
}
|
248 |
+
if (!is_array($record)) {
|
249 |
// This can happen on corrupt databases. Generally,
|
250 |
// MaxMind\Db\Reader will throw a
|
251 |
// MaxMind\Db\Reader\InvalidDatabaseException, but occasionally
|
255 |
// exceptions go unnoticed.
|
256 |
throw new InvalidDatabaseException(
|
257 |
"Expected an array when looking up $ipAddress but received: "
|
258 |
+
. gettype($record)
|
259 |
);
|
260 |
}
|
261 |
|
262 |
+
return $record;
|
263 |
}
|
264 |
|
265 |
/**
|
vendor/geoip2/geoip2/src/Model/AnonymousIp.php
CHANGED
@@ -2,28 +2,21 @@
|
|
2 |
|
3 |
namespace GeoIp2\Model;
|
4 |
|
5 |
-
use GeoIp2\Util;
|
6 |
-
|
7 |
/**
|
8 |
* This class provides the GeoIP2 Anonymous IP model.
|
9 |
*
|
10 |
* @property-read bool $isAnonymous This is true if the IP address belongs to
|
11 |
* any sort of anonymous network.
|
12 |
-
* @property-read bool $isAnonymousVpn This is true if the IP address
|
13 |
-
*
|
14 |
-
* register subnets under names associated with them, we will likely only
|
15 |
-
* flag their IP ranges using the isHostingProvider property.
|
16 |
* @property-read bool $isHostingProvider This is true if the IP address belongs
|
17 |
-
* to a hosting
|
18 |
* @property-read bool $isPublicProxy This is true if the IP address belongs to
|
19 |
* a public proxy.
|
20 |
* @property-read bool $isTorExitNode This is true if the IP address is a Tor
|
21 |
* exit node.
|
22 |
* @property-read string $ipAddress The IP address that the data in the model is
|
23 |
* for.
|
24 |
-
* @property-read string $network The network in CIDR notation associated with
|
25 |
-
* the record. In particular, this is the largest network where all of the
|
26 |
-
* fields besides $ipAddress have the same value.
|
27 |
*/
|
28 |
class AnonymousIp extends AbstractModel
|
29 |
{
|
@@ -33,7 +26,6 @@ class AnonymousIp extends AbstractModel
|
|
33 |
protected $isPublicProxy;
|
34 |
protected $isTorExitNode;
|
35 |
protected $ipAddress;
|
36 |
-
protected $network;
|
37 |
|
38 |
/**
|
39 |
* @ignore
|
@@ -49,8 +41,6 @@ class AnonymousIp extends AbstractModel
|
|
49 |
$this->isHostingProvider = $this->get('is_hosting_provider');
|
50 |
$this->isPublicProxy = $this->get('is_public_proxy');
|
51 |
$this->isTorExitNode = $this->get('is_tor_exit_node');
|
52 |
-
$ipAddress = $this->get('ip_address');
|
53 |
-
$this->ipAddress = $ipAddress;
|
54 |
-
$this->network = Util::cidr($ipAddress, $this->get('prefix_len'));
|
55 |
}
|
56 |
}
|
2 |
|
3 |
namespace GeoIp2\Model;
|
4 |
|
|
|
|
|
5 |
/**
|
6 |
* This class provides the GeoIP2 Anonymous IP model.
|
7 |
*
|
8 |
* @property-read bool $isAnonymous This is true if the IP address belongs to
|
9 |
* any sort of anonymous network.
|
10 |
+
* @property-read bool $isAnonymousVpn This is true if the IP address belongs to
|
11 |
+
* an anonymous VPN system.
|
|
|
|
|
12 |
* @property-read bool $isHostingProvider This is true if the IP address belongs
|
13 |
+
* to a hosting provider.
|
14 |
* @property-read bool $isPublicProxy This is true if the IP address belongs to
|
15 |
* a public proxy.
|
16 |
* @property-read bool $isTorExitNode This is true if the IP address is a Tor
|
17 |
* exit node.
|
18 |
* @property-read string $ipAddress The IP address that the data in the model is
|
19 |
* for.
|
|
|
|
|
|
|
20 |
*/
|
21 |
class AnonymousIp extends AbstractModel
|
22 |
{
|
26 |
protected $isPublicProxy;
|
27 |
protected $isTorExitNode;
|
28 |
protected $ipAddress;
|
|
|
29 |
|
30 |
/**
|
31 |
* @ignore
|
41 |
$this->isHostingProvider = $this->get('is_hosting_provider');
|
42 |
$this->isPublicProxy = $this->get('is_public_proxy');
|
43 |
$this->isTorExitNode = $this->get('is_tor_exit_node');
|
44 |
+
$this->ipAddress = $this->get('ip_address');
|
|
|
|
|
45 |
}
|
46 |
}
|
vendor/geoip2/geoip2/src/Model/Asn.php
CHANGED
@@ -2,8 +2,6 @@
|
|
2 |
|
3 |
namespace GeoIp2\Model;
|
4 |
|
5 |
-
use GeoIp2\Util;
|
6 |
-
|
7 |
/**
|
8 |
* This class provides the GeoLite2 ASN model.
|
9 |
*
|
@@ -14,16 +12,12 @@ use GeoIp2\Util;
|
|
14 |
* address.
|
15 |
* @property-read string $ipAddress The IP address that the data in the model is
|
16 |
* for.
|
17 |
-
* @property-read string $network The network in CIDR notation associated with
|
18 |
-
* the record. In particular, this is the largest network where all of the
|
19 |
-
* fields besides $ipAddress have the same value.
|
20 |
*/
|
21 |
class Asn extends AbstractModel
|
22 |
{
|
23 |
protected $autonomousSystemNumber;
|
24 |
protected $autonomousSystemOrganization;
|
25 |
protected $ipAddress;
|
26 |
-
protected $network;
|
27 |
|
28 |
/**
|
29 |
* @ignore
|
@@ -36,8 +30,6 @@ class Asn extends AbstractModel
|
|
36 |
$this->autonomousSystemNumber = $this->get('autonomous_system_number');
|
37 |
$this->autonomousSystemOrganization =
|
38 |
$this->get('autonomous_system_organization');
|
39 |
-
$ipAddress = $this->get('ip_address');
|
40 |
-
$this->ipAddress = $ipAddress;
|
41 |
-
$this->network = Util::cidr($ipAddress, $this->get('prefix_len'));
|
42 |
}
|
43 |
}
|
2 |
|
3 |
namespace GeoIp2\Model;
|
4 |
|
|
|
|
|
5 |
/**
|
6 |
* This class provides the GeoLite2 ASN model.
|
7 |
*
|
12 |
* address.
|
13 |
* @property-read string $ipAddress The IP address that the data in the model is
|
14 |
* for.
|
|
|
|
|
|
|
15 |
*/
|
16 |
class Asn extends AbstractModel
|
17 |
{
|
18 |
protected $autonomousSystemNumber;
|
19 |
protected $autonomousSystemOrganization;
|
20 |
protected $ipAddress;
|
|
|
21 |
|
22 |
/**
|
23 |
* @ignore
|
30 |
$this->autonomousSystemNumber = $this->get('autonomous_system_number');
|
31 |
$this->autonomousSystemOrganization =
|
32 |
$this->get('autonomous_system_organization');
|
33 |
+
$this->ipAddress = $this->get('ip_address');
|
|
|
|
|
34 |
}
|
35 |
}
|
vendor/geoip2/geoip2/src/Model/City.php
CHANGED
@@ -7,25 +7,42 @@ namespace GeoIp2\Model;
|
|
7 |
*
|
8 |
* The only difference between the City and Insights model classes is which
|
9 |
* fields in each record may be populated. See
|
10 |
-
*
|
11 |
*
|
12 |
* @property-read \GeoIp2\Record\City $city City data for the requested IP
|
13 |
* address.
|
|
|
|
|
|
|
|
|
|
|
14 |
* @property-read \GeoIp2\Record\Location $location Location data for the
|
15 |
* requested IP address.
|
16 |
* @property-read \GeoIp2\Record\Postal $postal Postal data for the
|
17 |
* requested IP address.
|
18 |
-
* @property-read
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
* objects representing the country subdivisions for the requested IP
|
20 |
* address. The number and type of subdivisions varies by country, but a
|
21 |
* subdivision is typically a state, province, county, etc. Subdivisions
|
22 |
* are ordered from most general (largest) to most specific (smallest).
|
23 |
* If the response did not contain any subdivisions, this method returns
|
24 |
* an empty array.
|
25 |
-
* @property-read \GeoIp2\Record\Subdivision $mostSpecificSubdivision An
|
26 |
* representing the most specific subdivision returned. If the response
|
27 |
* did not contain any subdivisions, this method returns an empty
|
28 |
-
* \GeoIp2\Record\Subdivision object.
|
|
|
|
|
29 |
*/
|
30 |
class City extends Country
|
31 |
{
|
7 |
*
|
8 |
* The only difference between the City and Insights model classes is which
|
9 |
* fields in each record may be populated. See
|
10 |
+
* http://dev.maxmind.com/geoip/geoip2/web-services more details.
|
11 |
*
|
12 |
* @property-read \GeoIp2\Record\City $city City data for the requested IP
|
13 |
* address.
|
14 |
+
* @property-read \GeoIp2\Record\Continent $continent Continent data for the
|
15 |
+
* requested IP address.
|
16 |
+
* @property-read \GeoIp2\Record\Country $country Country data for the requested
|
17 |
+
* IP address. This object represents the country where MaxMind believes the
|
18 |
+
* end user is located.
|
19 |
* @property-read \GeoIp2\Record\Location $location Location data for the
|
20 |
* requested IP address.
|
21 |
* @property-read \GeoIp2\Record\Postal $postal Postal data for the
|
22 |
* requested IP address.
|
23 |
+
* @property-read \GeoIp2\Record\MaxMind $maxmind Data related to your MaxMind
|
24 |
+
* account.
|
25 |
+
* @property-read \GeoIp2\Record\Country $registeredCountry Registered country
|
26 |
+
* data for the requested IP address. This record represents the country
|
27 |
+
* where the ISP has registered a given IP block and may differ from the
|
28 |
+
* user's country.
|
29 |
+
* @property-read \GeoIp2\Record\RepresentedCountry $representedCountry
|
30 |
+
* Represented country data for the requested IP address. The represented
|
31 |
+
* country is used for things like military bases. It is only present when
|
32 |
+
* the represented country differs from the country.
|
33 |
+
* @property-read array $subdivisions An array of {@link \GeoIp2\Record\Subdivision}
|
34 |
* objects representing the country subdivisions for the requested IP
|
35 |
* address. The number and type of subdivisions varies by country, but a
|
36 |
* subdivision is typically a state, province, county, etc. Subdivisions
|
37 |
* are ordered from most general (largest) to most specific (smallest).
|
38 |
* If the response did not contain any subdivisions, this method returns
|
39 |
* an empty array.
|
40 |
+
* @property-read \GeoIp2\Record\Subdivision $mostSpecificSubdivision An object
|
41 |
* representing the most specific subdivision returned. If the response
|
42 |
* did not contain any subdivisions, this method returns an empty
|
43 |
+
* {@link \GeoIp2\Record\Subdivision} object.
|
44 |
+
* @property-read \GeoIp2\Record\Traits $traits Data for the traits of the
|
45 |
+
* requested IP address.
|
46 |
*/
|
47 |
class City extends Country
|
48 |
{
|
vendor/geoip2/geoip2/src/Model/ConnectionType.php
CHANGED
@@ -2,8 +2,6 @@
|
|
2 |
|
3 |
namespace GeoIp2\Model;
|
4 |
|
5 |
-
use GeoIp2\Util;
|
6 |
-
|
7 |
/**
|
8 |
* This class provides the GeoIP2 Connection-Type model.
|
9 |
*
|
@@ -12,15 +10,11 @@ use GeoIp2\Util;
|
|
12 |
* Additional values may be added in the future.
|
13 |
* @property-read string $ipAddress The IP address that the data in the model is
|
14 |
* for.
|
15 |
-
* @property-read string $network The network in CIDR notation associated with
|
16 |
-
* the record. In particular, this is the largest network where all of the
|
17 |
-
* fields besides $ipAddress have the same value.
|
18 |
*/
|
19 |
class ConnectionType extends AbstractModel
|
20 |
{
|
21 |
protected $connectionType;
|
22 |
protected $ipAddress;
|
23 |
-
protected $network;
|
24 |
|
25 |
/**
|
26 |
* @ignore
|
@@ -32,8 +26,6 @@ class ConnectionType extends AbstractModel
|
|
32 |
parent::__construct($raw);
|
33 |
|
34 |
$this->connectionType = $this->get('connection_type');
|
35 |
-
$ipAddress = $this->get('ip_address');
|
36 |
-
$this->ipAddress = $ipAddress;
|
37 |
-
$this->network = Util::cidr($ipAddress, $this->get('prefix_len'));
|
38 |
}
|
39 |
}
|
2 |
|
3 |
namespace GeoIp2\Model;
|
4 |
|
|
|
|
|
5 |
/**
|
6 |
* This class provides the GeoIP2 Connection-Type model.
|
7 |
*
|
10 |
* Additional values may be added in the future.
|
11 |
* @property-read string $ipAddress The IP address that the data in the model is
|
12 |
* for.
|
|
|
|
|
|
|
13 |
*/
|
14 |
class ConnectionType extends AbstractModel
|
15 |
{
|
16 |
protected $connectionType;
|
17 |
protected $ipAddress;
|
|
|
18 |
|
19 |
/**
|
20 |
* @ignore
|
26 |
parent::__construct($raw);
|
27 |
|
28 |
$this->connectionType = $this->get('connection_type');
|
29 |
+
$this->ipAddress = $this->get('ip_address');
|
|
|
|
|
30 |
}
|
31 |
}
|
vendor/geoip2/geoip2/src/Model/Country.php
CHANGED
@@ -7,7 +7,7 @@ namespace GeoIp2\Model;
|
|
7 |
*
|
8 |
* The only difference between the City and Insights model classes is which
|
9 |
* fields in each record may be populated. See
|
10 |
-
*
|
11 |
*
|
12 |
* @property-read \GeoIp2\Record\Continent $continent Continent data for the
|
13 |
* requested IP address.
|
7 |
*
|
8 |
* The only difference between the City and Insights model classes is which
|
9 |
* fields in each record may be populated. See
|
10 |
+
* http://dev.maxmind.com/geoip/geoip2/web-services more details.
|
11 |
*
|
12 |
* @property-read \GeoIp2\Record\Continent $continent Continent data for the
|
13 |
* requested IP address.
|
vendor/geoip2/geoip2/src/Model/Domain.php
CHANGED
@@ -2,8 +2,6 @@
|
|
2 |
|
3 |
namespace GeoIp2\Model;
|
4 |
|
5 |
-
use GeoIp2\Util;
|
6 |
-
|
7 |
/**
|
8 |
* This class provides the GeoIP2 Domain model.
|
9 |
*
|
@@ -12,15 +10,11 @@ use GeoIp2\Util;
|
|
12 |
* "example.co.uk", not "foo.example.com".
|
13 |
* @property-read string $ipAddress The IP address that the data in the model is
|
14 |
* for.
|
15 |
-
* @property-read string $network The network in CIDR notation associated with
|
16 |
-
* the record. In particular, this is the largest network where all of the
|
17 |
-
* fields besides $ipAddress have the same value.
|
18 |
*/
|
19 |
class Domain extends AbstractModel
|
20 |
{
|
21 |
protected $domain;
|
22 |
protected $ipAddress;
|
23 |
-
protected $network;
|
24 |
|
25 |
/**
|
26 |
* @ignore
|
@@ -32,8 +26,6 @@ class Domain extends AbstractModel
|
|
32 |
parent::__construct($raw);
|
33 |
|
34 |
$this->domain = $this->get('domain');
|
35 |
-
$ipAddress = $this->get('ip_address');
|
36 |
-
$this->ipAddress = $ipAddress;
|
37 |
-
$this->network = Util::cidr($ipAddress, $this->get('prefix_len'));
|
38 |
}
|
39 |
}
|
2 |
|
3 |
namespace GeoIp2\Model;
|
4 |
|
|
|
|
|
5 |
/**
|
6 |
* This class provides the GeoIP2 Domain model.
|
7 |
*
|
10 |
* "example.co.uk", not "foo.example.com".
|
11 |
* @property-read string $ipAddress The IP address that the data in the model is
|
12 |
* for.
|
|
|
|
|
|
|
13 |
*/
|
14 |
class Domain extends AbstractModel
|
15 |
{
|
16 |
protected $domain;
|
17 |
protected $ipAddress;
|
|
|
18 |
|
19 |
/**
|
20 |
* @ignore
|
26 |
parent::__construct($raw);
|
27 |
|
28 |
$this->domain = $this->get('domain');
|
29 |
+
$this->ipAddress = $this->get('ip_address');
|
|
|
|
|
30 |
}
|
31 |
}
|
vendor/geoip2/geoip2/src/Model/Enterprise.php
CHANGED
@@ -7,7 +7,40 @@ namespace GeoIp2\Model;
|
|
7 |
*
|
8 |
* The only difference between the City and Enterprise model classes is which
|
9 |
* fields in each record may be populated. See
|
10 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
*/
|
12 |
class Enterprise extends City
|
13 |
{
|
7 |
*
|
8 |
* The only difference between the City and Enterprise model classes is which
|
9 |
* fields in each record may be populated. See
|
10 |
+
* http://dev.maxmind.com/geoip/geoip2/web-services more details.
|
11 |
+
*
|
12 |
+
* @property-read \GeoIp2\Record\City $city City data for the requested IP
|
13 |
+
* address.
|
14 |
+
* @property-read \GeoIp2\Record\Continent $continent Continent data for the
|
15 |
+
* requested IP address.
|
16 |
+
* @property-read \GeoIp2\Record\Country $country Country data for the requested
|
17 |
+
* IP address. This object represents the country where MaxMind believes the
|
18 |
+
* end user is located.
|
19 |
+
* @property-read \GeoIp2\Record\Location $location Location data for the
|
20 |
+
* requested IP address.
|
21 |
+
* @property-read \GeoIp2\Record\MaxMind $maxmind Data related to your MaxMind
|
22 |
+
* account.
|
23 |
+
* @property-read \GeoIp2\Record\Country $registeredCountry Registered country
|
24 |
+
* data for the requested IP address. This record represents the country
|
25 |
+
* where the ISP has registered a given IP block and may differ from the
|
26 |
+
* user's country.
|
27 |
+
* @property-read \GeoIp2\Record\RepresentedCountry $representedCountry
|
28 |
+
* Represented country data for the requested IP address. The represented
|
29 |
+
* country is used for things like military bases. It is only present when
|
30 |
+
* the represented country differs from the country.
|
31 |
+
* @property-read array $subdivisions An array of {@link \GeoIp2\Record\Subdivision}
|
32 |
+
* objects representing the country subdivisions for the requested IP
|
33 |
+
* address. The number and type of subdivisions varies by country, but a
|
34 |
+
* subdivision is typically a state, province, county, etc. Subdivisions
|
35 |
+
* are ordered from most general (largest) to most specific (smallest).
|
36 |
+
* If the response did not contain any subdivisions, this method returns
|
37 |
+
* an empty array.
|
38 |
+
* @property-read \GeoIp2\Record\Subdivision $mostSpecificSubdivision An object
|
39 |
+
* representing the most specific subdivision returned. If the response
|
40 |
+
* did not contain any subdivisions, this method returns an empty
|
41 |
+
* {@link \GeoIp2\Record\Subdivision} object.
|
42 |
+
* @property-read \GeoIp2\Record\Traits $traits Data for the traits of the
|
43 |
+
* requested IP address.
|
44 |
*/
|
45 |
class Enterprise extends City
|
46 |
{
|
vendor/geoip2/geoip2/src/Model/Insights.php
CHANGED
@@ -7,7 +7,40 @@ namespace GeoIp2\Model;
|
|
7 |
*
|
8 |
* The only difference between the City and Insights model classes is which
|
9 |
* fields in each record may be populated. See
|
10 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
*/
|
12 |
class Insights extends City
|
13 |
{
|
7 |
*
|
8 |
* The only difference between the City and Insights model classes is which
|
9 |
* fields in each record may be populated. See
|
10 |
+
* http://dev.maxmind.com/geoip/geoip2/web-services more details.
|
11 |
+
*
|
12 |
+
* @property-read \GeoIp2\Record\City $city City data for the requested IP
|
13 |
+
* address.
|
14 |
+
* @property-read \GeoIp2\Record\Continent $continent Continent data for the
|
15 |
+
* requested IP address.
|
16 |
+
* @property-read \GeoIp2\Record\Country $country Country data for the requested
|
17 |
+
* IP address. This object represents the country where MaxMind believes the
|
18 |
+
* end user is located.
|
19 |
+
* @property-read \GeoIp2\Record\Location $location Location data for the
|
20 |
+
* requested IP address.
|
21 |
+
* @property-read \GeoIp2\Record\MaxMind $maxmind Data related to your MaxMind
|
22 |
+
* account.
|
23 |
+
* @property-read \GeoIp2\Record\Country $registeredCountry Registered country
|
24 |
+
* data for the requested IP address. This record represents the country
|
25 |
+
* where the ISP has registered a given IP block and may differ from the
|
26 |
+
* user's country.
|
27 |
+
* @property-read \GeoIp2\Record\RepresentedCountry $representedCountry
|
28 |
+
* Represented country data for the requested IP address. The represented
|
29 |
+
* country is used for things like military bases. It is only present when
|
30 |
+
* the represented country differs from the country.
|
31 |
+
* @property-read array $subdivisions An array of {@link \GeoIp2\Record\Subdivision}
|
32 |
+
* objects representing the country subdivisions for the requested IP
|
33 |
+
* address. The number and type of subdivisions varies by country, but a
|
34 |
+
* subdivision is typically a state, province, county, etc. Subdivisions
|
35 |
+
* are ordered from most general (largest) to most specific (smallest).
|
36 |
+
* If the response did not contain any subdivisions, this method returns
|
37 |
+
* an empty array.
|
38 |
+
* @property-read \GeoIp2\Record\Subdivision $mostSpecificSubdivision An object
|
39 |
+
* representing the most specific subdivision returned. If the response
|
40 |
+
* did not contain any subdivisions, this method returns an empty
|
41 |
+
* {@link \GeoIp2\Record\Subdivision} object.
|
42 |
+
* @property-read \GeoIp2\Record\Traits $traits Data for the traits of the
|
43 |
+
* requested IP address.
|
44 |
*/
|
45 |
class Insights extends City
|
46 |
{
|
vendor/geoip2/geoip2/src/Model/Isp.php
CHANGED
@@ -2,8 +2,6 @@
|
|
2 |
|
3 |
namespace GeoIp2\Model;
|
4 |
|
5 |
-
use GeoIp2\Util;
|
6 |
-
|
7 |
/**
|
8 |
* This class provides the GeoIP2 ISP model.
|
9 |
*
|
@@ -18,9 +16,6 @@ use GeoIp2\Util;
|
|
18 |
* with the IP address.
|
19 |
* @property-read string $ipAddress The IP address that the data in the model is
|
20 |
* for.
|
21 |
-
* @property-read string $network The network in CIDR notation associated with
|
22 |
-
* the record. In particular, this is the largest network where all of the
|
23 |
-
* fields besides $ipAddress have the same value.
|
24 |
*/
|
25 |
class Isp extends AbstractModel
|
26 |
{
|
@@ -29,7 +24,6 @@ class Isp extends AbstractModel
|
|
29 |
protected $isp;
|
30 |
protected $organization;
|
31 |
protected $ipAddress;
|
32 |
-
protected $network;
|
33 |
|
34 |
/**
|
35 |
* @ignore
|
@@ -45,8 +39,6 @@ class Isp extends AbstractModel
|
|
45 |
$this->isp = $this->get('isp');
|
46 |
$this->organization = $this->get('organization');
|
47 |
|
48 |
-
$ipAddress = $this->get('ip_address');
|
49 |
-
$this->ipAddress = $ipAddress;
|
50 |
-
$this->network = Util::cidr($ipAddress, $this->get('prefix_len'));
|
51 |
}
|
52 |
}
|
2 |
|
3 |
namespace GeoIp2\Model;
|
4 |
|
|
|
|
|
5 |
/**
|
6 |
* This class provides the GeoIP2 ISP model.
|
7 |
*
|
16 |
* with the IP address.
|
17 |
* @property-read string $ipAddress The IP address that the data in the model is
|
18 |
* for.
|
|
|
|
|
|
|
19 |
*/
|
20 |
class Isp extends AbstractModel
|
21 |
{
|
24 |
protected $isp;
|
25 |
protected $organization;
|
26 |
protected $ipAddress;
|
|
|
27 |
|
28 |
/**
|
29 |
* @ignore
|
39 |
$this->isp = $this->get('isp');
|
40 |
$this->organization = $this->get('organization');
|
41 |
|
42 |
+
$this->ipAddress = $this->get('ip_address');
|
|
|
|
|
43 |
}
|
44 |
}
|
vendor/geoip2/geoip2/src/Record/AbstractRecord.php
CHANGED
@@ -51,7 +51,7 @@ abstract class AbstractRecord implements \JsonSerializable
|
|
51 |
|
52 |
private function validAttribute($attr)
|
53 |
{
|
54 |
-
return
|
55 |
}
|
56 |
|
57 |
public function jsonSerialize()
|
51 |
|
52 |
private function validAttribute($attr)
|
53 |
{
|
54 |
+
return in_array($attr, $this->validAttributes, true);
|
55 |
}
|
56 |
|
57 |
public function jsonSerialize()
|
vendor/geoip2/geoip2/src/Record/Country.php
CHANGED
@@ -15,9 +15,10 @@ namespace GeoIp2\Record;
|
|
15 |
* @property-read bool $isInEuropeanUnion This is true if the country is a
|
16 |
* member state of the European Union. This attribute is returned by all
|
17 |
* location services and databases.
|
18 |
-
* @property-read string|null $isoCode The
|
19 |
-
*
|
20 |
-
* attribute is returned by all location services
|
|
|
21 |
* @property-read string|null $name The name of the country based on the locales
|
22 |
* list passed to the constructor. This attribute is returned by all location
|
23 |
* services and databases.
|
15 |
* @property-read bool $isInEuropeanUnion This is true if the country is a
|
16 |
* member state of the European Union. This attribute is returned by all
|
17 |
* location services and databases.
|
18 |
+
* @property-read string|null $isoCode The
|
19 |
+
* {@link * http://en.wikipedia.org/wiki/ISO_3166-1 two-character ISO 3166-1 alpha
|
20 |
+
* code} for the country. This attribute is returned by all location services
|
21 |
+
* and databases.
|
22 |
* @property-read string|null $name The name of the country based on the locales
|
23 |
* list passed to the constructor. This attribute is returned by all location
|
24 |
* services and databases.
|
vendor/geoip2/geoip2/src/Record/Location.php
CHANGED
@@ -27,11 +27,11 @@ namespace GeoIp2\Record;
|
|
27 |
* from the Insights service.
|
28 |
* @property-read int|null $metroCode The metro code of the location if the location
|
29 |
* is in the US. MaxMind returns the same metro codes as the
|
30 |
-
*
|
31 |
-
*
|
32 |
* @property-read string|null $timeZone The time zone associated with location, as
|
33 |
-
* specified by the IANA Time Zone
|
34 |
-
*
|
35 |
*/
|
36 |
class Location extends AbstractRecord
|
37 |
{
|
27 |
* from the Insights service.
|
28 |
* @property-read int|null $metroCode The metro code of the location if the location
|
29 |
* is in the US. MaxMind returns the same metro codes as the
|
30 |
+
* {@link * https://developers.google.com/adwords/api/docs/appendix/cities-DMAregions
|
31 |
+
* Google AdWords API}.
|
32 |
* @property-read string|null $timeZone The time zone associated with location, as
|
33 |
+
* specified by the {@link http://www.iana.org/time-zones IANA Time Zone
|
34 |
+
* Database}, e.g., "America/New_York".
|
35 |
*/
|
36 |
class Location extends AbstractRecord
|
37 |
{
|
vendor/geoip2/geoip2/src/Record/RepresentedCountry.php
CHANGED
@@ -9,6 +9,19 @@ namespace GeoIp2\Record;
|
|
9 |
* for the IP's represented country. The represented country is the country
|
10 |
* represented by something like a military base.
|
11 |
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
* @property-read string|null $type A string indicating the type of entity that is
|
13 |
* representing the country. Currently we only return <code>military</code>
|
14 |
* but this could expand to include other types in the future.
|
9 |
* for the IP's represented country. The represented country is the country
|
10 |
* represented by something like a military base.
|
11 |
*
|
12 |
+
* @property-read int|null $confidence A value from 0-100 indicating MaxMind's
|
13 |
+
* confidence that the country is correct. This attribute is only available
|
14 |
+
* from the Insights service and the GeoIP2 Enterprise database.
|
15 |
+
* @property-read int|null $geonameId The GeoName ID for the country.
|
16 |
+
* @property-read bool $isInEuropeanUnion This is true if the country is a
|
17 |
+
* member state of the European Union. This attribute is returned by all
|
18 |
+
* location services and databases.
|
19 |
+
* @property-read string|null $isoCode The {@link http://en.wikipedia.org/wiki/ISO_3166-1
|
20 |
+
* two-character ISO 3166-1 alpha code} for the country.
|
21 |
+
* @property-read string|null $name The name of the country based on the locales list
|
22 |
+
* passed to the constructor.
|
23 |
+
* @property-read array|null $names An array map where the keys are locale codes and
|
24 |
+
* the values are names.
|
25 |
* @property-read string|null $type A string indicating the type of entity that is
|
26 |
* representing the country. Currently we only return <code>military</code>
|
27 |
* but this could expand to include other types in the future.
|
vendor/geoip2/geoip2/src/Record/Subdivision.php
CHANGED
@@ -16,9 +16,9 @@ namespace GeoIp2\Record;
|
|
16 |
* This attribute is returned by all location databases and services besides
|
17 |
* Country.
|
18 |
* @property-read string|null $isoCode This is a string up to three characters long
|
19 |
-
* contain the subdivision portion of the
|
20 |
-
*
|
21 |
-
* location databases and services except Country.
|
22 |
* @property-read string|null $name The name of the subdivision based on the
|
23 |
* locales list passed to the constructor. This attribute is returned by all
|
24 |
* location databases and services besides Country.
|
16 |
* This attribute is returned by all location databases and services besides
|
17 |
* Country.
|
18 |
* @property-read string|null $isoCode This is a string up to three characters long
|
19 |
+
* contain the subdivision portion of the
|
20 |
+
* {@link * http://en.wikipedia.org/wiki/ISO_3166-2 ISO 3166-2 code}. This attribute
|
21 |
+
* is returned by all location databases and services except Country.
|
22 |
* @property-read string|null $name The name of the subdivision based on the
|
23 |
* locales list passed to the constructor. This attribute is returned by all
|
24 |
* location databases and services besides Country.
|
vendor/geoip2/geoip2/src/Record/Traits.php
CHANGED
@@ -2,23 +2,21 @@
|
|
2 |
|
3 |
namespace GeoIp2\Record;
|
4 |
|
5 |
-
use GeoIp2\Util;
|
6 |
-
|
7 |
/**
|
8 |
* Contains data for the traits record associated with an IP address.
|
9 |
*
|
10 |
* This record is returned by all location services and databases.
|
11 |
*
|
12 |
-
* @property-read int|null $autonomousSystemNumber The
|
13 |
-
*
|
14 |
-
*
|
15 |
-
*
|
16 |
* Enterprise database.
|
17 |
* @property-read string|null $autonomousSystemOrganization The organization
|
18 |
-
* associated with the registered
|
19 |
-
*
|
20 |
-
*
|
21 |
-
*
|
22 |
* @property-read string|null $connectionType The connection type may take the
|
23 |
* following values: "Dialup", "Cable/DSL", "Corporate", "Cellular".
|
24 |
* Additional values may be added in the future. This attribute is only
|
@@ -37,18 +35,16 @@ use GeoIp2\Util;
|
|
37 |
* @property-read bool $isAnonymous This is true if the IP address belongs to
|
38 |
* any sort of anonymous network. This property is only available from GeoIP2
|
39 |
* Precision Insights.
|
40 |
-
* @property-read bool $isAnonymousProxy *Deprecated.* Please see our
|
41 |
-
*
|
42 |
-
*
|
43 |
-
*
|
44 |
-
* @property-read bool $isAnonymousVpn This is true if the IP address
|
45 |
-
*
|
46 |
-
*
|
47 |
-
* ranges using the isHostingProvider property. This property is only available
|
48 |
-
* from GeoIP2 Precision Insights.
|
49 |
* @property-read bool $isHostingProvider This is true if the IP address belongs
|
50 |
-
* to a hosting
|
51 |
-
*
|
52 |
* @property-read bool $isLegitimateProxy This attribute is true if MaxMind
|
53 |
* believes this IP address to be a legitimate proxy, such as an internal
|
54 |
* VPN used by a corporation. This attribute is only available in the GeoIP2
|
@@ -65,19 +61,9 @@ use GeoIp2\Util;
|
|
65 |
* @property-read string|null $isp The name of the ISP associated with the IP
|
66 |
* address. This attribute is only available from the City and Insights web
|
67 |
* services and the GeoIP2 Enterprise database.
|
68 |
-
* @property-read string $network The network in CIDR notation associated with
|
69 |
-
* the record. In particular, this is the largest network where all of the
|
70 |
-
* fields besides $ipAddress have the same value.
|
71 |
* @property-read string|null $organization The name of the organization associated
|
72 |
* with the IP address. This attribute is only available from the City and
|
73 |
* Insights web services and the GeoIP2 Enterprise database.
|
74 |
-
* @property-read float|null $staticIPScore An indicator of how static or
|
75 |
-
* dynamic an IP address is. This property is only available from GeoIP2
|
76 |
-
* Precision Insights.
|
77 |
-
* @property-read int|null $userCount The estimated number of users sharing
|
78 |
-
* the IP/network during the past 24 hours. For IPv4, the count is for the
|
79 |
-
* individual IP. For IPv6, the count is for the /64 network. This property is
|
80 |
-
* only available from GeoIP2 Precision Insights.
|
81 |
* @property-read string|null $userType <p>The user type associated with the IP
|
82 |
* address. This can be one of the following values:</p>
|
83 |
* <ul>
|
@@ -122,19 +108,7 @@ class Traits extends AbstractRecord
|
|
122 |
'isPublicProxy',
|
123 |
'isSatelliteProvider',
|
124 |
'isTorExitNode',
|
125 |
-
'network',
|
126 |
'organization',
|
127 |
-
'staticIpScore',
|
128 |
-
'userCount',
|
129 |
'userType',
|
130 |
];
|
131 |
-
|
132 |
-
public function __construct($record)
|
133 |
-
{
|
134 |
-
if (!isset($record['network']) && isset($record['ip_address']) && isset($record['prefix_len'])) {
|
135 |
-
$record['network'] = Util::cidr($record['ip_address'], $record['prefix_len']);
|
136 |
-
}
|
137 |
-
|
138 |
-
parent::__construct($record);
|
139 |
-
}
|
140 |
}
|
2 |
|
3 |
namespace GeoIp2\Record;
|
4 |
|
|
|
|
|
5 |
/**
|
6 |
* Contains data for the traits record associated with an IP address.
|
7 |
*
|
8 |
* This record is returned by all location services and databases.
|
9 |
*
|
10 |
+
* @property-read int|null $autonomousSystemNumber The
|
11 |
+
* {@link * http://en.wikipedia.org/wiki/Autonomous_system_(Internet) autonomous
|
12 |
+
* system number} associated with the IP address. This attribute is only
|
13 |
+
* available from the City and Insights web service and the GeoIP2
|
14 |
* Enterprise database.
|
15 |
* @property-read string|null $autonomousSystemOrganization The organization
|
16 |
+
* associated with the registered {@link * http://en.wikipedia.org/wiki/Autonomous_system_(Internet) autonomous
|
17 |
+
* system number} for the IP address. This attribute is only available from
|
18 |
+
* the City and Insights web service and the GeoIP2 Enterprise
|
19 |
+
* database.
|
20 |
* @property-read string|null $connectionType The connection type may take the
|
21 |
* following values: "Dialup", "Cable/DSL", "Corporate", "Cellular".
|
22 |
* Additional values may be added in the future. This attribute is only
|
35 |
* @property-read bool $isAnonymous This is true if the IP address belongs to
|
36 |
* any sort of anonymous network. This property is only available from GeoIP2
|
37 |
* Precision Insights.
|
38 |
+
* @property-read bool $isAnonymousProxy *Deprecated.* Please see our
|
39 |
+
* {@link * https://www.maxmind.com/en/geoip2-anonymous-ip-database GeoIP2
|
40 |
+
* Anonymous IP database} to determine whether the IP address is used by an
|
41 |
+
* anonymizing service.
|
42 |
+
* @property-read bool $isAnonymousVpn This is true if the IP address belongs to
|
43 |
+
* an anonymous VPN system. This property is only available from GeoIP2
|
44 |
+
* Precision Insights.
|
|
|
|
|
45 |
* @property-read bool $isHostingProvider This is true if the IP address belongs
|
46 |
+
* to a hosting provider. This property is only available from GeoIP2
|
47 |
+
* Precision Insights.
|
48 |
* @property-read bool $isLegitimateProxy This attribute is true if MaxMind
|
49 |
* believes this IP address to be a legitimate proxy, such as an internal
|
50 |
* VPN used by a corporation. This attribute is only available in the GeoIP2
|
61 |
* @property-read string|null $isp The name of the ISP associated with the IP
|
62 |
* address. This attribute is only available from the City and Insights web
|
63 |
* services and the GeoIP2 Enterprise database.
|
|
|
|
|
|
|
64 |
* @property-read string|null $organization The name of the organization associated
|
65 |
* with the IP address. This attribute is only available from the City and
|
66 |
* Insights web services and the GeoIP2 Enterprise database.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
67 |
* @property-read string|null $userType <p>The user type associated with the IP
|
68 |
* address. This can be one of the following values:</p>
|
69 |
* <ul>
|
108 |
'isPublicProxy',
|
109 |
'isSatelliteProvider',
|
110 |
'isTorExitNode',
|
|
|
111 |
'organization',
|
|
|
|
|
112 |
'userType',
|
113 |
];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
114 |
}
|
vendor/geoip2/geoip2/src/WebService/Client.php
CHANGED
@@ -47,7 +47,7 @@ class Client implements ProviderInterface
|
|
47 |
private $client;
|
48 |
private static $basePath = '/geoip/v2.1';
|
49 |
|
50 |
-
const VERSION = 'v2.
|
51 |
|
52 |
/**
|
53 |
* Constructor.
|
@@ -74,7 +74,7 @@ class Client implements ProviderInterface
|
|
74 |
|
75 |
// This is for backwards compatibility. Do not remove except for a
|
76 |
// major version bump.
|
77 |
-
if (
|
78 |
$options = ['host' => $options];
|
79 |
}
|
80 |
|
@@ -111,7 +111,7 @@ class Client implements ProviderInterface
|
|
111 |
* @throws \GeoIp2\Exception\HttpException if an unexpected HTTP error code or message was returned.
|
112 |
* This could indicate a problem with the connection between
|
113 |
* your server and the web service or that the web service
|
114 |
-
* returned an invalid document or 500 error code
|
115 |
* @throws \GeoIp2\Exception\GeoIp2Exception This serves as the parent
|
116 |
* class to the above exceptions. It will be thrown directly
|
117 |
* if a 200 status code is returned but the body is invalid.
|
@@ -173,7 +173,7 @@ class Client implements ProviderInterface
|
|
173 |
* @throws \GeoIp2\Exception\HttpException if an unexpected HTTP error code or message was returned.
|
174 |
* This could indicate a problem with the connection between
|
175 |
* your server and the web service or that the web service
|
176 |
-
* returned an invalid document or 500 error code
|
177 |
* @throws \GeoIp2\Exception\GeoIp2Exception This serves as the parent
|
178 |
* class to the above exceptions. It will be thrown directly
|
179 |
* if a 200 status code is returned but the body is invalid.
|
47 |
private $client;
|
48 |
private static $basePath = '/geoip/v2.1';
|
49 |
|
50 |
+
const VERSION = 'v2.9.0';
|
51 |
|
52 |
/**
|
53 |
* Constructor.
|
74 |
|
75 |
// This is for backwards compatibility. Do not remove except for a
|
76 |
// major version bump.
|
77 |
+
if (is_string($options)) {
|
78 |
$options = ['host' => $options];
|
79 |
}
|
80 |
|
111 |
* @throws \GeoIp2\Exception\HttpException if an unexpected HTTP error code or message was returned.
|
112 |
* This could indicate a problem with the connection between
|
113 |
* your server and the web service or that the web service
|
114 |
+
* returned an invalid document or 500 error code.
|
115 |
* @throws \GeoIp2\Exception\GeoIp2Exception This serves as the parent
|
116 |
* class to the above exceptions. It will be thrown directly
|
117 |
* if a 200 status code is returned but the body is invalid.
|
173 |
* @throws \GeoIp2\Exception\HttpException if an unexpected HTTP error code or message was returned.
|
174 |
* This could indicate a problem with the connection between
|
175 |
* your server and the web service or that the web service
|
176 |
+
* returned an invalid document or 500 error code.
|
177 |
* @throws \GeoIp2\Exception\GeoIp2Exception This serves as the parent
|
178 |
* class to the above exceptions. It will be thrown directly
|
179 |
* if a 200 status code is returned but the body is invalid.
|
vendor/maxmind-db/reader/CHANGELOG.md
CHANGED
@@ -1,27 +1,6 @@
|
|
1 |
CHANGELOG
|
2 |
=========
|
3 |
|
4 |
-
1.6.0 (2019-12-19)
|
5 |
-
------------------
|
6 |
-
|
7 |
-
* 1.5.0 and 1.5.1 contained a possible memory corruptions when using
|
8 |
-
`getWithPrefixLen`. This has been fixed. Reported by proton-ab.
|
9 |
-
GitHub #96.
|
10 |
-
* The `composer.json` file now conflicts with all versions of the
|
11 |
-
`maxminddb` C extension less than the Composer version. This is to
|
12 |
-
reduce the chance of having an older, conflicting version of the
|
13 |
-
extension installed. You will need to upgrade the extension before
|
14 |
-
running `composer update`. Pull request by Benoît Burnichon. GitHub
|
15 |
-
#97.
|
16 |
-
|
17 |
-
1.5.1 (2019-12-12)
|
18 |
-
------------------
|
19 |
-
|
20 |
-
* Minor performance improvements.
|
21 |
-
* Make tests pass with older versions of libmaxminddb. PR by Remi
|
22 |
-
Collet. GitHub #90.
|
23 |
-
* Test enhancements. PR by Chun-Sheng, Li. GitHub #91.
|
24 |
-
|
25 |
1.5.0 (2019-09-30)
|
26 |
------------------
|
27 |
|
1 |
CHANGELOG
|
2 |
=========
|
3 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
1.5.0 (2019-09-30)
|
5 |
------------------
|
6 |
|
vendor/maxmind-db/reader/composer.json
CHANGED
@@ -20,9 +20,6 @@
|
|
20 |
"ext-gmp": "bcmath or gmp is required for decoding larger integers with the pure PHP decoder",
|
21 |
"ext-maxminddb": "A C-based database decoder that provides significantly faster lookups"
|
22 |
},
|
23 |
-
"conflict": {
|
24 |
-
"ext-maxminddb": "<1.6.0,>=2.0.0"
|
25 |
-
},
|
26 |
"require-dev": {
|
27 |
"friendsofphp/php-cs-fixer": "2.*",
|
28 |
"phpunit/phpunit": "5.*",
|
@@ -34,10 +31,5 @@
|
|
34 |
"psr-4": {
|
35 |
"MaxMind\\Db\\": "src/MaxMind/Db"
|
36 |
}
|
37 |
-
},
|
38 |
-
"autoload-dev": {
|
39 |
-
"psr-4": {
|
40 |
-
"MaxMind\\Db\\Test\\Reader\\": "tests/MaxMind/Db/Test/Reader"
|
41 |
-
}
|
42 |
}
|
43 |
}
|
20 |
"ext-gmp": "bcmath or gmp is required for decoding larger integers with the pure PHP decoder",
|
21 |
"ext-maxminddb": "A C-based database decoder that provides significantly faster lookups"
|
22 |
},
|
|
|
|
|
|
|
23 |
"require-dev": {
|
24 |
"friendsofphp/php-cs-fixer": "2.*",
|
25 |
"phpunit/phpunit": "5.*",
|
31 |
"psr-4": {
|
32 |
"MaxMind\\Db\\": "src/MaxMind/Db"
|
33 |
}
|
|
|
|
|
|
|
|
|
|
|
34 |
}
|
35 |
}
|
vendor/maxmind-db/reader/ext/maxminddb.c
CHANGED
@@ -79,7 +79,7 @@ typedef struct _maxminddb_obj {
|
|
79 |
|
80 |
PHP_FUNCTION(maxminddb);
|
81 |
|
82 |
-
static
|
83 |
get_record(INTERNAL_FUNCTION_PARAMETERS, zval *record, int *prefix_len);
|
84 |
static const MMDB_entry_data_list_s *
|
85 |
handle_entry_data_list(const MMDB_entry_data_list_s *entry_data_list,
|
@@ -163,7 +163,7 @@ PHP_METHOD(MaxMind_Db_Reader, __construct) {
|
|
163 |
return;
|
164 |
}
|
165 |
|
166 |
-
MMDB_s *mmdb = (MMDB_s *)
|
167 |
uint16_t status = MMDB_open(db_file, MMDB_MODE_MMAP, mmdb);
|
168 |
|
169 |
if (MMDB_SUCCESS != status) {
|
@@ -200,9 +200,7 @@ PHP_METHOD(MaxMind_Db_Reader, getWithPrefixLen) {
|
|
200 |
#endif
|
201 |
|
202 |
int prefix_len = 0;
|
203 |
-
|
204 |
-
return;
|
205 |
-
}
|
206 |
|
207 |
array_init(return_value);
|
208 |
add_next_index_zval(return_value, record);
|
@@ -211,7 +209,7 @@ PHP_METHOD(MaxMind_Db_Reader, getWithPrefixLen) {
|
|
211 |
add_next_index_zval(return_value, z_prefix_len);
|
212 |
}
|
213 |
|
214 |
-
static
|
215 |
get_record(INTERNAL_FUNCTION_PARAMETERS, zval *record, int *prefix_len) {
|
216 |
char *ip_address = NULL;
|
217 |
strsize_t name_len;
|
@@ -226,7 +224,7 @@ get_record(INTERNAL_FUNCTION_PARAMETERS, zval *record, int *prefix_len) {
|
|
226 |
&name_len) == FAILURE) {
|
227 |
THROW_EXCEPTION("InvalidArgumentException",
|
228 |
"Method takes exactly one argument.");
|
229 |
-
return
|
230 |
}
|
231 |
|
232 |
const maxminddb_obj *mmdb_obj = (maxminddb_obj *)Z_MAXMINDDB_P(getThis());
|
@@ -236,7 +234,7 @@ get_record(INTERNAL_FUNCTION_PARAMETERS, zval *record, int *prefix_len) {
|
|
236 |
if (NULL == mmdb) {
|
237 |
THROW_EXCEPTION("BadMethodCallException",
|
238 |
"Attempt to read from a closed MaxMind DB.");
|
239 |
-
return
|
240 |
}
|
241 |
|
242 |
struct addrinfo hints = {
|
@@ -251,13 +249,13 @@ get_record(INTERNAL_FUNCTION_PARAMETERS, zval *record, int *prefix_len) {
|
|
251 |
THROW_EXCEPTION("InvalidArgumentException",
|
252 |
"The value \"%s\" is not a valid IP address.",
|
253 |
ip_address);
|
254 |
-
return
|
255 |
}
|
256 |
if (!addresses || !addresses->ai_addr) {
|
257 |
THROW_EXCEPTION(
|
258 |
"InvalidArgumentException",
|
259 |
"getaddrinfo was successful but failed to set the addrinfo");
|
260 |
-
return
|
261 |
}
|
262 |
|
263 |
int sa_family = addresses->ai_addr->sa_family;
|
@@ -279,7 +277,7 @@ get_record(INTERNAL_FUNCTION_PARAMETERS, zval *record, int *prefix_len) {
|
|
279 |
"Error looking up %s. %s",
|
280 |
ip_address,
|
281 |
MMDB_strerror(mmdb_error));
|
282 |
-
return
|
283 |
}
|
284 |
|
285 |
*prefix_len = result.netmask;
|
@@ -292,7 +290,7 @@ get_record(INTERNAL_FUNCTION_PARAMETERS, zval *record, int *prefix_len) {
|
|
292 |
|
293 |
if (!result.found_entry) {
|
294 |
ZVAL_NULL(record);
|
295 |
-
return
|
296 |
}
|
297 |
|
298 |
MMDB_entry_data_list_s *entry_data_list = NULL;
|
@@ -304,18 +302,17 @@ get_record(INTERNAL_FUNCTION_PARAMETERS, zval *record, int *prefix_len) {
|
|
304 |
ip_address,
|
305 |
MMDB_strerror(status));
|
306 |
MMDB_free_entry_data_list(entry_data_list);
|
307 |
-
return
|
308 |
} else if (NULL == entry_data_list) {
|
309 |
THROW_EXCEPTION(PHP_MAXMINDDB_READER_EX_NS,
|
310 |
"Error while looking up data for %s. Your database may "
|
311 |
"be corrupt or you have found a bug in libmaxminddb.",
|
312 |
ip_address);
|
313 |
-
return
|
314 |
}
|
315 |
|
316 |
handle_entry_data_list(entry_data_list, record TSRMLS_CC);
|
317 |
MMDB_free_entry_data_list(entry_data_list);
|
318 |
-
return 0;
|
319 |
}
|
320 |
|
321 |
ZEND_BEGIN_ARG_INFO_EX(arginfo_maxmindbreader_void, 0, 0, 0)
|
@@ -668,10 +665,6 @@ PHP_MINIT_FUNCTION(maxminddb) {
|
|
668 |
maxminddb_obj_handlers.offset = XtOffsetOf(maxminddb_obj, std);
|
669 |
maxminddb_obj_handlers.free_obj = maxminddb_free_storage;
|
670 |
#endif
|
671 |
-
zend_declare_class_constant_string(maxminddb_ce,
|
672 |
-
"MMDB_LIB_VERSION",
|
673 |
-
sizeof("MMDB_LIB_VERSION") - 1,
|
674 |
-
MMDB_lib_version() TSRMLS_CC);
|
675 |
|
676 |
return SUCCESS;
|
677 |
}
|
79 |
|
80 |
PHP_FUNCTION(maxminddb);
|
81 |
|
82 |
+
static void
|
83 |
get_record(INTERNAL_FUNCTION_PARAMETERS, zval *record, int *prefix_len);
|
84 |
static const MMDB_entry_data_list_s *
|
85 |
handle_entry_data_list(const MMDB_entry_data_list_s *entry_data_list,
|
163 |
return;
|
164 |
}
|
165 |
|
166 |
+
MMDB_s *mmdb = (MMDB_s *)emalloc(sizeof(MMDB_s));
|
167 |
uint16_t status = MMDB_open(db_file, MMDB_MODE_MMAP, mmdb);
|
168 |
|
169 |
if (MMDB_SUCCESS != status) {
|
200 |
#endif
|
201 |
|
202 |
int prefix_len = 0;
|
203 |
+
get_record(INTERNAL_FUNCTION_PARAM_PASSTHRU, record, &prefix_len);
|
|
|
|
|
204 |
|
205 |
array_init(return_value);
|
206 |
add_next_index_zval(return_value, record);
|
209 |
add_next_index_zval(return_value, z_prefix_len);
|
210 |
}
|
211 |
|
212 |
+
static void
|
213 |
get_record(INTERNAL_FUNCTION_PARAMETERS, zval *record, int *prefix_len) {
|
214 |
char *ip_address = NULL;
|
215 |
strsize_t name_len;
|
224 |
&name_len) == FAILURE) {
|
225 |
THROW_EXCEPTION("InvalidArgumentException",
|
226 |
"Method takes exactly one argument.");
|
227 |
+
return;
|
228 |
}
|
229 |
|
230 |
const maxminddb_obj *mmdb_obj = (maxminddb_obj *)Z_MAXMINDDB_P(getThis());
|
234 |
if (NULL == mmdb) {
|
235 |
THROW_EXCEPTION("BadMethodCallException",
|
236 |
"Attempt to read from a closed MaxMind DB.");
|
237 |
+
return;
|
238 |
}
|
239 |
|
240 |
struct addrinfo hints = {
|
249 |
THROW_EXCEPTION("InvalidArgumentException",
|
250 |
"The value \"%s\" is not a valid IP address.",
|
251 |
ip_address);
|
252 |
+
return;
|
253 |
}
|
254 |
if (!addresses || !addresses->ai_addr) {
|
255 |
THROW_EXCEPTION(
|
256 |
"InvalidArgumentException",
|
257 |
"getaddrinfo was successful but failed to set the addrinfo");
|
258 |
+
return;
|
259 |
}
|
260 |
|
261 |
int sa_family = addresses->ai_addr->sa_family;
|
277 |
"Error looking up %s. %s",
|
278 |
ip_address,
|
279 |
MMDB_strerror(mmdb_error));
|
280 |
+
return;
|
281 |
}
|
282 |
|
283 |
*prefix_len = result.netmask;
|
290 |
|
291 |
if (!result.found_entry) {
|
292 |
ZVAL_NULL(record);
|
293 |
+
return;
|
294 |
}
|
295 |
|
296 |
MMDB_entry_data_list_s *entry_data_list = NULL;
|
302 |
ip_address,
|
303 |
MMDB_strerror(status));
|
304 |
MMDB_free_entry_data_list(entry_data_list);
|
305 |
+
return;
|
306 |
} else if (NULL == entry_data_list) {
|
307 |
THROW_EXCEPTION(PHP_MAXMINDDB_READER_EX_NS,
|
308 |
"Error while looking up data for %s. Your database may "
|
309 |
"be corrupt or you have found a bug in libmaxminddb.",
|
310 |
ip_address);
|
311 |
+
return;
|
312 |
}
|
313 |
|
314 |
handle_entry_data_list(entry_data_list, record TSRMLS_CC);
|
315 |
MMDB_free_entry_data_list(entry_data_list);
|
|
|
316 |
}
|
317 |
|
318 |
ZEND_BEGIN_ARG_INFO_EX(arginfo_maxmindbreader_void, 0, 0, 0)
|
665 |
maxminddb_obj_handlers.offset = XtOffsetOf(maxminddb_obj, std);
|
666 |
maxminddb_obj_handlers.free_obj = maxminddb_free_storage;
|
667 |
#endif
|
|
|
|
|
|
|
|
|
668 |
|
669 |
return SUCCESS;
|
670 |
}
|
vendor/maxmind-db/reader/ext/php_maxminddb.h
CHANGED
@@ -15,7 +15,7 @@
|
|
15 |
|
16 |
#ifndef PHP_MAXMINDDB_H
|
17 |
#define PHP_MAXMINDDB_H 1
|
18 |
-
#define PHP_MAXMINDDB_VERSION "1.
|
19 |
#define PHP_MAXMINDDB_EXTNAME "maxminddb"
|
20 |
|
21 |
extern zend_module_entry maxminddb_module_entry;
|
15 |
|
16 |
#ifndef PHP_MAXMINDDB_H
|
17 |
#define PHP_MAXMINDDB_H 1
|
18 |
+
#define PHP_MAXMINDDB_VERSION "1.5.0"
|
19 |
#define PHP_MAXMINDDB_EXTNAME "maxminddb"
|
20 |
|
21 |
extern zend_module_entry maxminddb_module_entry;
|
vendor/maxmind-db/reader/src/MaxMind/Db/Reader.php
CHANGED
@@ -242,7 +242,7 @@ class Reader
|
|
242 |
{
|
243 |
$resolved = $pointer - $this->metadata->nodeCount
|
244 |
+ $this->metadata->searchTreeSize;
|
245 |
-
if ($resolved
|
246 |
throw new InvalidDatabaseException(
|
247 |
"The MaxMind DB file's search tree is corrupt"
|
248 |
);
|
@@ -265,18 +265,19 @@ class Reader
|
|
265 |
$fileSize = $fstat['size'];
|
266 |
$marker = self::$METADATA_START_MARKER;
|
267 |
$markerLength = self::$METADATA_START_MARKER_LENGTH;
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
for ($
|
272 |
-
|
273 |
-
|
|
|
|
|
|
|
|
|
274 |
}
|
275 |
|
276 |
-
$
|
277 |
-
if ($value === $marker) {
|
278 |
-
return $offset + $markerLength;
|
279 |
-
}
|
280 |
}
|
281 |
throw new InvalidDatabaseException(
|
282 |
"Error opening database file ($filename). " .
|
242 |
{
|
243 |
$resolved = $pointer - $this->metadata->nodeCount
|
244 |
+ $this->metadata->searchTreeSize;
|
245 |
+
if ($resolved > $this->fileSize) {
|
246 |
throw new InvalidDatabaseException(
|
247 |
"The MaxMind DB file's search tree is corrupt"
|
248 |
);
|
265 |
$fileSize = $fstat['size'];
|
266 |
$marker = self::$METADATA_START_MARKER;
|
267 |
$markerLength = self::$METADATA_START_MARKER_LENGTH;
|
268 |
+
$metadataMaxLengthExcludingMarker
|
269 |
+
= min(self::$METADATA_MAX_SIZE, $fileSize) - $markerLength;
|
270 |
+
|
271 |
+
for ($i = 0; $i <= $metadataMaxLengthExcludingMarker; ++$i) {
|
272 |
+
for ($j = 0; $j < $markerLength; ++$j) {
|
273 |
+
fseek($handle, $fileSize - $i - $j - 1);
|
274 |
+
$matchBit = fgetc($handle);
|
275 |
+
if ($matchBit !== $marker[$markerLength - $j - 1]) {
|
276 |
+
continue 2;
|
277 |
+
}
|
278 |
}
|
279 |
|
280 |
+
return $fileSize - $i;
|
|
|
|
|
|
|
281 |
}
|
282 |
throw new InvalidDatabaseException(
|
283 |
"Error opening database file ($filename). " .
|
vendor/maxmind-db/reader/src/MaxMind/Db/Reader/Decoder.php
CHANGED
@@ -70,7 +70,10 @@ class Decoder
|
|
70 |
|
71 |
public function decode($offset)
|
72 |
{
|
73 |
-
$ctrlByte =
|
|
|
|
|
|
|
74 |
++$offset;
|
75 |
|
76 |
$type = $ctrlByte >> 5;
|
@@ -92,7 +95,10 @@ class Decoder
|
|
92 |
}
|
93 |
|
94 |
if ($type === self::_EXTENDED) {
|
95 |
-
$nextByte =
|
|
|
|
|
|
|
96 |
|
97 |
$type = $nextByte + 7;
|
98 |
|
@@ -249,17 +255,17 @@ class Decoder
|
|
249 |
|
250 |
switch ($pointerSize) {
|
251 |
case 1:
|
252 |
-
$packed =
|
253 |
list(, $pointer) = unpack('n', $packed);
|
254 |
$pointer += $this->pointerBase;
|
255 |
break;
|
256 |
case 2:
|
257 |
-
$packed = "\x00" .
|
258 |
list(, $pointer) = unpack('N', $packed);
|
259 |
$pointer += $this->pointerBase + 2048;
|
260 |
break;
|
261 |
case 3:
|
262 |
-
$packed =
|
263 |
|
264 |
// It is safe to use 'N' here, even on 32 bit machines as the
|
265 |
// first bit is 0.
|
@@ -335,7 +341,8 @@ class Decoder
|
|
335 |
$size = 285 + $adjust;
|
336 |
} elseif ($size > 30) {
|
337 |
list(, $adjust) = unpack('N', "\x00" . $bytes);
|
338 |
-
$size = $adjust
|
|
|
339 |
}
|
340 |
|
341 |
return [$size, $offset + $bytesToRead];
|
70 |
|
71 |
public function decode($offset)
|
72 |
{
|
73 |
+
list(, $ctrlByte) = unpack(
|
74 |
+
'C',
|
75 |
+
Util::read($this->fileStream, $offset, 1)
|
76 |
+
);
|
77 |
++$offset;
|
78 |
|
79 |
$type = $ctrlByte >> 5;
|
95 |
}
|
96 |
|
97 |
if ($type === self::_EXTENDED) {
|
98 |
+
list(, $nextByte) = unpack(
|
99 |
+
'C',
|
100 |
+
Util::read($this->fileStream, $offset, 1)
|
101 |
+
);
|
102 |
|
103 |
$type = $nextByte + 7;
|
104 |
|
255 |
|
256 |
switch ($pointerSize) {
|
257 |
case 1:
|
258 |
+
$packed = (pack('C', $ctrlByte & 0x7)) . $buffer;
|
259 |
list(, $pointer) = unpack('n', $packed);
|
260 |
$pointer += $this->pointerBase;
|
261 |
break;
|
262 |
case 2:
|
263 |
+
$packed = "\x00" . (pack('C', $ctrlByte & 0x7)) . $buffer;
|
264 |
list(, $pointer) = unpack('N', $packed);
|
265 |
$pointer += $this->pointerBase + 2048;
|
266 |
break;
|
267 |
case 3:
|
268 |
+
$packed = (pack('C', $ctrlByte & 0x7)) . $buffer;
|
269 |
|
270 |
// It is safe to use 'N' here, even on 32 bit machines as the
|
271 |
// first bit is 0.
|
341 |
$size = 285 + $adjust;
|
342 |
} elseif ($size > 30) {
|
343 |
list(, $adjust) = unpack('N', "\x00" . $bytes);
|
344 |
+
$size = ($adjust & (0x0FFFFFFF >> (32 - (8 * $bytesToRead))))
|
345 |
+
+ 65821;
|
346 |
}
|
347 |
|
348 |
return [$size, $offset + $bytesToRead];
|
vendor/maxmind/web-service-common/CHANGELOG.md
CHANGED
@@ -1,13 +1,6 @@
|
|
1 |
CHANGELOG
|
2 |
=========
|
3 |
|
4 |
-
0.6.0 (2019-12-12)
|
5 |
-
------------------
|
6 |
-
|
7 |
-
* Curl handles are now reused across requests. Pull request by Willem
|
8 |
-
Stuursma-Ruwen. GitHub #24.
|
9 |
-
* PHP 5.6 is now required.
|
10 |
-
|
11 |
0.5.0 (2018-02-12)
|
12 |
------------------
|
13 |
|
1 |
CHANGELOG
|
2 |
=========
|
3 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
0.5.0 (2018-02-12)
|
5 |
------------------
|
6 |
|
vendor/maxmind/web-service-common/README.md
CHANGED
@@ -5,7 +5,8 @@ shared code between MaxMind's various web service client APIs.
|
|
5 |
|
6 |
## Requirements ##
|
7 |
|
8 |
-
The library requires PHP 5.
|
|
|
9 |
|
10 |
There are several other dependencies as defined in the `composer.json` file.
|
11 |
|
@@ -20,6 +21,6 @@ This API uses [Semantic Versioning](http://semver.org/).
|
|
20 |
|
21 |
## Copyright and License ##
|
22 |
|
23 |
-
This software is Copyright (c) 2015-
|
24 |
|
25 |
This is free software, licensed under the Apache License, Version 2.0.
|
5 |
|
6 |
## Requirements ##
|
7 |
|
8 |
+
The library requires PHP 5.4 or greater. This library works and is tested
|
9 |
+
with HHVM.
|
10 |
|
11 |
There are several other dependencies as defined in the `composer.json` file.
|
12 |
|
21 |
|
22 |
## Copyright and License ##
|
23 |
|
24 |
+
This software is Copyright (c) 2015-2018 by MaxMind, Inc.
|
25 |
|
26 |
This is free software, licensed under the Apache License, Version 2.0.
|
vendor/maxmind/web-service-common/composer.json
CHANGED
@@ -12,14 +12,14 @@
|
|
12 |
}
|
13 |
],
|
14 |
"require": {
|
15 |
-
"php": ">=5.
|
16 |
"composer/ca-bundle": "^1.0.3",
|
17 |
"ext-curl": "*",
|
18 |
"ext-json": "*"
|
19 |
},
|
20 |
"require-dev": {
|
21 |
"friendsofphp/php-cs-fixer": "2.*",
|
22 |
-
"phpunit/phpunit": "
|
23 |
"squizlabs/php_codesniffer": "3.*"
|
24 |
},
|
25 |
"autoload": {
|
12 |
}
|
13 |
],
|
14 |
"require": {
|
15 |
+
"php": ">=5.4",
|
16 |
"composer/ca-bundle": "^1.0.3",
|
17 |
"ext-curl": "*",
|
18 |
"ext-json": "*"
|
19 |
},
|
20 |
"require-dev": {
|
21 |
"friendsofphp/php-cs-fixer": "2.*",
|
22 |
+
"phpunit/phpunit": "4.*",
|
23 |
"squizlabs/php_codesniffer": "3.*"
|
24 |
},
|
25 |
"autoload": {
|
vendor/maxmind/web-service-common/src/WebService/Client.php
CHANGED
@@ -100,8 +100,8 @@ class Client
|
|
100 |
*/
|
101 |
public function post($service, $path, $input)
|
102 |
{
|
103 |
-
$
|
104 |
-
if ($
|
105 |
throw new InvalidInputException(
|
106 |
'Error encoding input as JSON: '
|
107 |
. $this->jsonErrorDescription()
|
@@ -113,12 +113,12 @@ class Client
|
|
113 |
['Content-Type: application/json']
|
114 |
);
|
115 |
|
116 |
-
list($statusCode, $contentType, $
|
117 |
|
118 |
return $this->handleResponse(
|
119 |
$statusCode,
|
120 |
$contentType,
|
121 |
-
$
|
122 |
$service,
|
123 |
$path
|
124 |
);
|
@@ -128,12 +128,12 @@ class Client
|
|
128 |
{
|
129 |
$request = $this->createRequest($path);
|
130 |
|
131 |
-
list($statusCode, $contentType, $
|
132 |
|
133 |
return $this->handleResponse(
|
134 |
$statusCode,
|
135 |
$contentType,
|
136 |
-
$
|
137 |
$service,
|
138 |
$path
|
139 |
);
|
@@ -170,11 +170,11 @@ class Client
|
|
170 |
}
|
171 |
|
172 |
/**
|
173 |
-
* @param int $statusCode
|
174 |
-
* @param string $contentType
|
175 |
-
* @param string $
|
176 |
-
* @param string $service
|
177 |
-
* @param string $path
|
178 |
*
|
179 |
* @throws AuthenticationException when there is an issue authenticating the
|
180 |
* request
|
@@ -190,19 +190,19 @@ class Client
|
|
190 |
private function handleResponse(
|
191 |
$statusCode,
|
192 |
$contentType,
|
193 |
-
$
|
194 |
$service,
|
195 |
$path
|
196 |
) {
|
197 |
if ($statusCode >= 400 && $statusCode <= 499) {
|
198 |
-
$this->handle4xx($statusCode, $contentType, $
|
199 |
} elseif ($statusCode >= 500) {
|
200 |
$this->handle5xx($statusCode, $service, $path);
|
201 |
} elseif ($statusCode !== 200) {
|
202 |
$this->handleUnexpectedStatus($statusCode, $service, $path);
|
203 |
}
|
204 |
|
205 |
-
return $this->handleSuccess($
|
206 |
}
|
207 |
|
208 |
/**
|
@@ -256,7 +256,7 @@ class Client
|
|
256 |
$service,
|
257 |
$path
|
258 |
) {
|
259 |
-
if (
|
260 |
throw new HttpException(
|
261 |
"Received a $statusCode error for $service with no body",
|
262 |
$statusCode,
|
@@ -406,7 +406,7 @@ class Client
|
|
406 |
*/
|
407 |
private function handleSuccess($body, $service)
|
408 |
{
|
409 |
-
if (
|
410 |
throw new WebServiceException(
|
411 |
"Received a 200 response for $service but did not " .
|
412 |
'receive a HTTP body.'
|
@@ -432,7 +432,7 @@ class Client
|
|
432 |
// On OS X, when the SSL version is "SecureTransport", the system's
|
433 |
// keychain will be used.
|
434 |
if ($curlVersion['ssl_version'] === 'SecureTransport') {
|
435 |
-
return
|
436 |
}
|
437 |
$cert = CaBundle::getSystemCaRootBundlePath();
|
438 |
|
100 |
*/
|
101 |
public function post($service, $path, $input)
|
102 |
{
|
103 |
+
$body = json_encode($input);
|
104 |
+
if ($body === false) {
|
105 |
throw new InvalidInputException(
|
106 |
'Error encoding input as JSON: '
|
107 |
. $this->jsonErrorDescription()
|
113 |
['Content-Type: application/json']
|
114 |
);
|
115 |
|
116 |
+
list($statusCode, $contentType, $body) = $request->post($body);
|
117 |
|
118 |
return $this->handleResponse(
|
119 |
$statusCode,
|
120 |
$contentType,
|
121 |
+
$body,
|
122 |
$service,
|
123 |
$path
|
124 |
);
|
128 |
{
|
129 |
$request = $this->createRequest($path);
|
130 |
|
131 |
+
list($statusCode, $contentType, $body) = $request->get();
|
132 |
|
133 |
return $this->handleResponse(
|
134 |
$statusCode,
|
135 |
$contentType,
|
136 |
+
$body,
|
137 |
$service,
|
138 |
$path
|
139 |
);
|
170 |
}
|
171 |
|
172 |
/**
|
173 |
+
* @param int $statusCode the HTTP status code of the response
|
174 |
+
* @param string $contentType the Content-Type of the response
|
175 |
+
* @param string $body the response body
|
176 |
+
* @param string $service the name of the service
|
177 |
+
* @param string $path the path used in the request
|
178 |
*
|
179 |
* @throws AuthenticationException when there is an issue authenticating the
|
180 |
* request
|
190 |
private function handleResponse(
|
191 |
$statusCode,
|
192 |
$contentType,
|
193 |
+
$body,
|
194 |
$service,
|
195 |
$path
|
196 |
) {
|
197 |
if ($statusCode >= 400 && $statusCode <= 499) {
|
198 |
+
$this->handle4xx($statusCode, $contentType, $body, $service, $path);
|
199 |
} elseif ($statusCode >= 500) {
|
200 |
$this->handle5xx($statusCode, $service, $path);
|
201 |
} elseif ($statusCode !== 200) {
|
202 |
$this->handleUnexpectedStatus($statusCode, $service, $path);
|
203 |
}
|
204 |
|
205 |
+
return $this->handleSuccess($body, $service);
|
206 |
}
|
207 |
|
208 |
/**
|
256 |
$service,
|
257 |
$path
|
258 |
) {
|
259 |
+
if (strlen($body) === 0) {
|
260 |
throw new HttpException(
|
261 |
"Received a $statusCode error for $service with no body",
|
262 |
$statusCode,
|
406 |
*/
|
407 |
private function handleSuccess($body, $service)
|
408 |
{
|
409 |
+
if (strlen($body) === 0) {
|
410 |
throw new WebServiceException(
|
411 |
"Received a 200 response for $service but did not " .
|
412 |
'receive a HTTP body.'
|
432 |
// On OS X, when the SSL version is "SecureTransport", the system's
|
433 |
// keychain will be used.
|
434 |
if ($curlVersion['ssl_version'] === 'SecureTransport') {
|
435 |
+
return;
|
436 |
}
|
437 |
$cert = CaBundle::getSystemCaRootBundlePath();
|
438 |
|
vendor/maxmind/web-service-common/src/WebService/Http/CurlRequest.php
CHANGED
@@ -11,36 +11,21 @@ use MaxMind\Exception\HttpException;
|
|
11 |
*/
|
12 |
class CurlRequest implements Request
|
13 |
{
|
14 |
-
/**
|
15 |
-
* @var resource
|
16 |
-
*/
|
17 |
-
private $ch;
|
18 |
-
|
19 |
-
/**
|
20 |
-
* @var string
|
21 |
-
*/
|
22 |
private $url;
|
23 |
-
|
24 |
-
/**
|
25 |
-
* @var array
|
26 |
-
*/
|
27 |
private $options;
|
28 |
|
29 |
/**
|
30 |
-
* @param
|
31 |
-
* @param
|
32 |
*/
|
33 |
public function __construct($url, $options)
|
34 |
{
|
35 |
$this->url = $url;
|
36 |
$this->options = $options;
|
37 |
-
$this->ch = $options['curlHandle'];
|
38 |
}
|
39 |
|
40 |
/**
|
41 |
-
* @param
|
42 |
-
*
|
43 |
-
* @throws HttpException
|
44 |
*
|
45 |
* @return array
|
46 |
*/
|
@@ -68,16 +53,11 @@ class CurlRequest implements Request
|
|
68 |
*/
|
69 |
private function createCurl()
|
70 |
{
|
71 |
-
|
72 |
-
|
73 |
-
$opts = [];
|
74 |
-
$opts[CURLOPT_URL] = $this->url;
|
75 |
|
76 |
if (!empty($this->options['caBundle'])) {
|
77 |
$opts[CURLOPT_CAINFO] = $this->options['caBundle'];
|
78 |
}
|
79 |
-
|
80 |
-
$opts[CURLOPT_ENCODING] = '';
|
81 |
$opts[CURLOPT_SSL_VERIFYHOST] = 2;
|
82 |
$opts[CURLOPT_FOLLOWLOCATION] = false;
|
83 |
$opts[CURLOPT_SSL_VERIFYPEER] = true;
|
@@ -90,31 +70,24 @@ class CurlRequest implements Request
|
|
90 |
// The defined()s are here as the *_MS opts are not available on older
|
91 |
// cURL versions
|
92 |
$connectTimeout = $this->options['connectTimeout'];
|
93 |
-
if (
|
94 |
$opts[CURLOPT_CONNECTTIMEOUT_MS] = ceil($connectTimeout * 1000);
|
95 |
} else {
|
96 |
$opts[CURLOPT_CONNECTTIMEOUT] = ceil($connectTimeout);
|
97 |
}
|
98 |
|
99 |
$timeout = $this->options['timeout'];
|
100 |
-
if (
|
101 |
$opts[CURLOPT_TIMEOUT_MS] = ceil($timeout * 1000);
|
102 |
} else {
|
103 |
$opts[CURLOPT_TIMEOUT] = ceil($timeout);
|
104 |
}
|
105 |
|
106 |
-
curl_setopt_array($
|
107 |
|
108 |
-
return $
|
109 |
}
|
110 |
|
111 |
-
/**
|
112 |
-
* @param resource $curl
|
113 |
-
*
|
114 |
-
* @throws HttpException
|
115 |
-
*
|
116 |
-
* @return array
|
117 |
-
*/
|
118 |
private function execute($curl)
|
119 |
{
|
120 |
$body = curl_exec($curl);
|
@@ -130,6 +103,7 @@ class CurlRequest implements Request
|
|
130 |
|
131 |
$statusCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);
|
132 |
$contentType = curl_getinfo($curl, CURLINFO_CONTENT_TYPE);
|
|
|
133 |
|
134 |
return [$statusCode, $contentType, $body];
|
135 |
}
|
11 |
*/
|
12 |
class CurlRequest implements Request
|
13 |
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
private $url;
|
|
|
|
|
|
|
|
|
15 |
private $options;
|
16 |
|
17 |
/**
|
18 |
+
* @param $url
|
19 |
+
* @param $options
|
20 |
*/
|
21 |
public function __construct($url, $options)
|
22 |
{
|
23 |
$this->url = $url;
|
24 |
$this->options = $options;
|
|
|
25 |
}
|
26 |
|
27 |
/**
|
28 |
+
* @param $body
|
|
|
|
|
29 |
*
|
30 |
* @return array
|
31 |
*/
|
53 |
*/
|
54 |
private function createCurl()
|
55 |
{
|
56 |
+
$curl = curl_init($this->url);
|
|
|
|
|
|
|
57 |
|
58 |
if (!empty($this->options['caBundle'])) {
|
59 |
$opts[CURLOPT_CAINFO] = $this->options['caBundle'];
|
60 |
}
|
|
|
|
|
61 |
$opts[CURLOPT_SSL_VERIFYHOST] = 2;
|
62 |
$opts[CURLOPT_FOLLOWLOCATION] = false;
|
63 |
$opts[CURLOPT_SSL_VERIFYPEER] = true;
|
70 |
// The defined()s are here as the *_MS opts are not available on older
|
71 |
// cURL versions
|
72 |
$connectTimeout = $this->options['connectTimeout'];
|
73 |
+
if (defined('CURLOPT_CONNECTTIMEOUT_MS')) {
|
74 |
$opts[CURLOPT_CONNECTTIMEOUT_MS] = ceil($connectTimeout * 1000);
|
75 |
} else {
|
76 |
$opts[CURLOPT_CONNECTTIMEOUT] = ceil($connectTimeout);
|
77 |
}
|
78 |
|
79 |
$timeout = $this->options['timeout'];
|
80 |
+
if (defined('CURLOPT_TIMEOUT_MS')) {
|
81 |
$opts[CURLOPT_TIMEOUT_MS] = ceil($timeout * 1000);
|
82 |
} else {
|
83 |
$opts[CURLOPT_TIMEOUT] = ceil($timeout);
|
84 |
}
|
85 |
|
86 |
+
curl_setopt_array($curl, $opts);
|
87 |
|
88 |
+
return $curl;
|
89 |
}
|
90 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
91 |
private function execute($curl)
|
92 |
{
|
93 |
$body = curl_exec($curl);
|
103 |
|
104 |
$statusCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);
|
105 |
$contentType = curl_getinfo($curl, CURLINFO_CONTENT_TYPE);
|
106 |
+
curl_close($curl);
|
107 |
|
108 |
return [$statusCode, $contentType, $body];
|
109 |
}
|
vendor/maxmind/web-service-common/src/WebService/Http/Request.php
CHANGED
@@ -10,13 +10,13 @@ namespace MaxMind\WebService\Http;
|
|
10 |
interface Request
|
11 |
{
|
12 |
/**
|
13 |
-
* @param
|
14 |
-
* @param
|
15 |
*/
|
16 |
public function __construct($url, $options);
|
17 |
|
18 |
/**
|
19 |
-
* @param
|
20 |
*
|
21 |
* @return mixed
|
22 |
*/
|
10 |
interface Request
|
11 |
{
|
12 |
/**
|
13 |
+
* @param $url
|
14 |
+
* @param $options
|
15 |
*/
|
16 |
public function __construct($url, $options);
|
17 |
|
18 |
/**
|
19 |
+
* @param $body
|
20 |
*
|
21 |
* @return mixed
|
22 |
*/
|
vendor/maxmind/web-service-common/src/WebService/Http/RequestFactory.php
CHANGED
@@ -9,35 +9,18 @@ namespace MaxMind\WebService\Http;
|
|
9 |
*/
|
10 |
class RequestFactory
|
11 |
{
|
12 |
-
/**
|
13 |
-
* Keep the cURL resource here, so that if there are multiple API requests
|
14 |
-
* done the connection is kept alive, SSL resumption can be used
|
15 |
-
* etcetera.
|
16 |
-
*
|
17 |
-
* @var resource
|
18 |
-
*/
|
19 |
-
private $ch;
|
20 |
-
|
21 |
public function __construct()
|
22 |
{
|
23 |
-
$this->ch = curl_init();
|
24 |
-
}
|
25 |
-
|
26 |
-
public function __destruct()
|
27 |
-
{
|
28 |
-
curl_close($this->ch);
|
29 |
}
|
30 |
|
31 |
/**
|
32 |
-
* @param
|
33 |
-
* @param
|
34 |
*
|
35 |
-
* @return
|
36 |
*/
|
37 |
public function request($url, $options)
|
38 |
{
|
39 |
-
$options['curlHandle'] = $this->ch;
|
40 |
-
|
41 |
return new CurlRequest($url, $options);
|
42 |
}
|
43 |
}
|
9 |
*/
|
10 |
class RequestFactory
|
11 |
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
public function __construct()
|
13 |
{
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
}
|
15 |
|
16 |
/**
|
17 |
+
* @param $url
|
18 |
+
* @param $options
|
19 |
*
|
20 |
+
* @return CurlRequest
|
21 |
*/
|
22 |
public function request($url, $options)
|
23 |
{
|
|
|
|
|
24 |
return new CurlRequest($url, $options);
|
25 |
}
|
26 |
}
|