Version Description
Warning: This bugfix version of the plugin requires PHP 5.4.
Download this release
Release Info
Developer | benjamin4 |
Plugin | GeoIP Detection |
Version | 2.8.0 |
Comparing to | |
See all releases |
Code changes from version 2.7.0 to 2.8.0
- admin-ui.php +1 -1
- api.php +16 -17
- check_requirements.php +1 -1
- composer.lock +27 -23
- data-sources/auto.php +1 -1
- data-sources/header.php +1 -1
- data-sources/manual.php +3 -2
- data-sources/precision.php +3 -3
- data-sources/registry.php +1 -1
- filter.php +1 -1
- geoip-detect-lib.php +3 -3
- geoip-detect.php +5 -5
- legacy-api.php +1 -1
- lib/geonames/geonames-country-info.php +1 -1
- readme.txt +15 -2
- shortcode.php +2 -2
- upgrade-plugin.php +1 -1
- vendor/composer/autoload_psr4.php +2 -1
- vendor/composer/autoload_static.php +10 -5
- vendor/composer/ca-bundle/README.md +12 -5
- vendor/composer/ca-bundle/res/cacert.pem +27 -115
- vendor/composer/installed.json +66 -62
- vendor/geoip2/geoip2/.php_cs +33 -0
- vendor/geoip2/geoip2/CHANGELOG.md +13 -0
- vendor/geoip2/geoip2/README.md +26 -8
- vendor/geoip2/geoip2/composer.json +6 -4
- vendor/geoip2/geoip2/src/Database/Reader.php +77 -54
- vendor/geoip2/geoip2/src/Exception/HttpException.php +1 -2
- vendor/geoip2/geoip2/src/Exception/InvalidRequestException.php +1 -1
- vendor/geoip2/geoip2/src/Model/AbstractModel.php +16 -11
- vendor/geoip2/geoip2/src/Model/AnonymousIp.php +7 -11
- vendor/geoip2/geoip2/src/Model/Asn.php +35 -0
- vendor/geoip2/geoip2/src/Model/City.php +16 -19
- vendor/geoip2/geoip2/src/Model/ConnectionType.php +2 -2
- vendor/geoip2/geoip2/src/Model/Country.php +4 -6
- vendor/geoip2/geoip2/src/Model/Domain.php +2 -2
- vendor/geoip2/geoip2/src/Model/Enterprise.php +0 -9
- vendor/geoip2/geoip2/src/Model/Insights.php +0 -9
- vendor/geoip2/geoip2/src/Model/Isp.php +4 -7
- vendor/geoip2/geoip2/src/ProviderInterface.php +6 -6
- vendor/geoip2/geoip2/src/Record/AbstractPlaceRecord.php +17 -8
- vendor/geoip2/geoip2/src/Record/AbstractRecord.php +10 -9
- vendor/geoip2/geoip2/src/Record/City.php +1 -4
- vendor/geoip2/geoip2/src/Record/Continent.php +4 -7
- vendor/geoip2/geoip2/src/Record/Country.php +6 -10
- vendor/geoip2/geoip2/src/Record/Location.php +5 -12
- vendor/geoip2/geoip2/src/Record/MaxMind.php +1 -1
- vendor/geoip2/geoip2/src/Record/Postal.php +2 -3
- vendor/geoip2/geoip2/src/Record/RepresentedCountry.php +4 -9
- vendor/geoip2/geoip2/src/Record/Subdivision.php +6 -11
- vendor/geoip2/geoip2/src/Record/Traits.php +11 -23
- vendor/geoip2/geoip2/src/WebService/Client.php +76 -79
- vendor/maxmind/web-service-common/CHANGELOG.md +5 -0
- vendor/maxmind/web-service-common/README.md +3 -3
- vendor/maxmind/web-service-common/composer.json +6 -4
- vendor/maxmind/web-service-common/src/Exception/AuthenticationException.php +1 -1
- vendor/maxmind/web-service-common/src/Exception/HttpException.php +5 -5
- vendor/maxmind/web-service-common/src/Exception/InvalidRequestException.php +6 -6
- vendor/maxmind/web-service-common/src/WebService/Client.php +83 -70
- vendor/maxmind/web-service-common/src/WebService/Http/CurlRequest.php +4 -3
- vendor/maxmind/web-service-common/src/WebService/Http/Request.php +3 -2
- vendor/maxmind/web-service-common/src/WebService/Http/RequestFactory.php +3 -2
admin-ui.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
/*
|
3 |
-
Copyright 2013-
|
4 |
Author: Benjamin Pick (info@yellowtree.de)
|
5 |
|
6 |
This program is free software; you can redistribute it and/or modify
|
1 |
<?php
|
2 |
/*
|
3 |
+
Copyright 2013-2017 Yellow Tree, Siegen, Germany
|
4 |
Author: Benjamin Pick (info@yellowtree.de)
|
5 |
|
6 |
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 (info@yellowtree.de)
|
5 |
|
6 |
This program is free software; you can redistribute it and/or modify
|
@@ -184,29 +184,28 @@ function geoip_detect2_get_client_ip() {
|
|
184 |
|
185 |
// REMOTE_ADDR may contain multiple adresses? https://wordpress.org/support/topic/php-fatal-error-uncaught-exception-invalidargumentexception?replies=2#post-8128737
|
186 |
$ip_list = explode(',', $ip);
|
187 |
-
array_unshift($ip_list, '::1');
|
188 |
|
189 |
if (get_option('geoip-detect-has_reverse_proxy', 0) && isset($_SERVER["HTTP_X_FORWARDED_FOR"]))
|
190 |
{
|
191 |
$ip_list = explode(',', @$_SERVER["HTTP_X_FORWARDED_FOR"]);
|
192 |
$ip_list = array_map('geoip_detect_normalize_ip', $ip_list);
|
193 |
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
$ip_list = array_diff($ip_list, $trusted_proxies);
|
208 |
-
}
|
209 |
}
|
|
|
|
|
|
|
210 |
// Each Proxy server append their information at the end, so the last IP is most trustworthy.
|
211 |
$ip = end($ip_list);
|
212 |
$ip = geoip_detect_normalize_ip($ip);
|
1 |
<?php
|
2 |
/*
|
3 |
+
Copyright 2013-2017 Yellow Tree, Siegen, Germany
|
4 |
Author: Benjamin Pick (info@yellowtree.de)
|
5 |
|
6 |
This program is free software; you can redistribute it and/or modify
|
184 |
|
185 |
// REMOTE_ADDR may contain multiple adresses? https://wordpress.org/support/topic/php-fatal-error-uncaught-exception-invalidargumentexception?replies=2#post-8128737
|
186 |
$ip_list = explode(',', $ip);
|
|
|
187 |
|
188 |
if (get_option('geoip-detect-has_reverse_proxy', 0) && isset($_SERVER["HTTP_X_FORWARDED_FOR"]))
|
189 |
{
|
190 |
$ip_list = explode(',', @$_SERVER["HTTP_X_FORWARDED_FOR"]);
|
191 |
$ip_list = array_map('geoip_detect_normalize_ip', $ip_list);
|
192 |
|
193 |
+
// TODO: Expose option to UI. comma-seperated list of IPv4 and v6 adresses.
|
194 |
+
$trusted_proxies = explode(',', get_option('geoip-detect-trusted_proxy_ips'));
|
195 |
+
|
196 |
+
// Always trust localhost
|
197 |
+
$trusted_proxies[] = '';
|
198 |
+
$trusted_proxies[] = '::1';
|
199 |
+
$trusted_proxies[] = '127.0.0.1';
|
200 |
+
|
201 |
+
$trusted_proxies = array_map('geoip_detect_normalize_ip', $trusted_proxies);
|
202 |
+
$ip_list[] = $ip;
|
203 |
+
|
204 |
+
$ip_list = array_diff($ip_list, $trusted_proxies);
|
|
|
|
|
|
|
205 |
}
|
206 |
+
// Fallback IP
|
207 |
+
array_unshift($ip_list, '::1');
|
208 |
+
|
209 |
// Each Proxy server append their information at the end, so the last IP is most trustworthy.
|
210 |
$ip = end($ip_list);
|
211 |
$ip = geoip_detect_normalize_ip($ip);
|
check_requirements.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
/*
|
3 |
-
Copyright 2013-
|
4 |
Author: Benjamin Pick (info@yellowtree.de)
|
5 |
|
6 |
This program is free software; you can redistribute it and/or modify
|
1 |
<?php
|
2 |
/*
|
3 |
+
Copyright 2013-2017 Yellow Tree, Siegen, Germany
|
4 |
Author: Benjamin Pick (info@yellowtree.de)
|
5 |
|
6 |
This program is free software; you can redistribute it and/or modify
|
composer.lock
CHANGED
@@ -8,16 +8,16 @@
|
|
8 |
"packages": [
|
9 |
{
|
10 |
"name": "composer/ca-bundle",
|
11 |
-
"version": "1.0.
|
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": {
|
@@ -63,30 +63,32 @@
|
|
63 |
"ssl",
|
64 |
"tls"
|
65 |
],
|
66 |
-
"time": "2017-
|
67 |
},
|
68 |
{
|
69 |
"name": "geoip2/geoip2",
|
70 |
-
"version": "v2.
|
71 |
"source": {
|
72 |
"type": "git",
|
73 |
"url": "https://github.com/maxmind/GeoIP2-php.git",
|
74 |
-
"reference": "
|
75 |
},
|
76 |
"dist": {
|
77 |
"type": "zip",
|
78 |
-
"url": "https://api.github.com/repos/maxmind/GeoIP2-php/zipball/
|
79 |
-
"reference": "
|
80 |
"shasum": ""
|
81 |
},
|
82 |
"require": {
|
83 |
"maxmind-db/reader": "~1.0",
|
84 |
-
"maxmind/web-service-common": "~0.
|
85 |
-
"php": ">=5.
|
86 |
},
|
87 |
"require-dev": {
|
88 |
-
"
|
89 |
-
"
|
|
|
|
|
90 |
},
|
91 |
"type": "library",
|
92 |
"autoload": {
|
@@ -114,7 +116,7 @@
|
|
114 |
"geolocation",
|
115 |
"maxmind"
|
116 |
],
|
117 |
-
"time": "2017-
|
118 |
},
|
119 |
{
|
120 |
"name": "maxmind-db/reader",
|
@@ -173,32 +175,34 @@
|
|
173 |
},
|
174 |
{
|
175 |
"name": "maxmind/web-service-common",
|
176 |
-
"version": "v0.
|
177 |
"source": {
|
178 |
"type": "git",
|
179 |
"url": "https://github.com/maxmind/web-service-common-php.git",
|
180 |
-
"reference": "
|
181 |
},
|
182 |
"dist": {
|
183 |
"type": "zip",
|
184 |
-
"url": "https://api.github.com/repos/maxmind/web-service-common-php/zipball/
|
185 |
-
"reference": "
|
186 |
"shasum": ""
|
187 |
},
|
188 |
"require": {
|
189 |
"composer/ca-bundle": "^1.0.3",
|
190 |
"ext-curl": "*",
|
191 |
"ext-json": "*",
|
192 |
-
"php": ">=5.
|
193 |
},
|
194 |
"require-dev": {
|
|
|
195 |
"phpunit/phpunit": "4.*",
|
196 |
-
"squizlabs/php_codesniffer": "
|
197 |
},
|
198 |
"type": "library",
|
199 |
"autoload": {
|
200 |
"psr-4": {
|
201 |
-
"MaxMind\\": "src"
|
|
|
202 |
}
|
203 |
},
|
204 |
"notification-url": "https://packagist.org/downloads/",
|
@@ -212,8 +216,8 @@
|
|
212 |
}
|
213 |
],
|
214 |
"description": "Internal MaxMind Web Service API",
|
215 |
-
"homepage": "https://github.com/maxmind/
|
216 |
-
"time": "
|
217 |
}
|
218 |
],
|
219 |
"packages-dev": [],
|
8 |
"packages": [
|
9 |
{
|
10 |
"name": "composer/ca-bundle",
|
11 |
+
"version": "1.0.8",
|
12 |
"source": {
|
13 |
"type": "git",
|
14 |
"url": "https://github.com/composer/ca-bundle.git",
|
15 |
+
"reference": "9dd73a03951357922d8aee6cc084500de93e2343"
|
16 |
},
|
17 |
"dist": {
|
18 |
"type": "zip",
|
19 |
+
"url": "https://api.github.com/repos/composer/ca-bundle/zipball/9dd73a03951357922d8aee6cc084500de93e2343",
|
20 |
+
"reference": "9dd73a03951357922d8aee6cc084500de93e2343",
|
21 |
"shasum": ""
|
22 |
},
|
23 |
"require": {
|
63 |
"ssl",
|
64 |
"tls"
|
65 |
],
|
66 |
+
"time": "2017-09-11T07:24:36+00:00"
|
67 |
},
|
68 |
{
|
69 |
"name": "geoip2/geoip2",
|
70 |
+
"version": "v2.6.0",
|
71 |
"source": {
|
72 |
"type": "git",
|
73 |
"url": "https://github.com/maxmind/GeoIP2-php.git",
|
74 |
+
"reference": "9f6f1edf9901fed5cd692dd260333bf52091acd3"
|
75 |
},
|
76 |
"dist": {
|
77 |
"type": "zip",
|
78 |
+
"url": "https://api.github.com/repos/maxmind/GeoIP2-php/zipball/9f6f1edf9901fed5cd692dd260333bf52091acd3",
|
79 |
+
"reference": "9f6f1edf9901fed5cd692dd260333bf52091acd3",
|
80 |
"shasum": ""
|
81 |
},
|
82 |
"require": {
|
83 |
"maxmind-db/reader": "~1.0",
|
84 |
+
"maxmind/web-service-common": "~0.4",
|
85 |
+
"php": ">=5.4"
|
86 |
},
|
87 |
"require-dev": {
|
88 |
+
"apigen/apigen": "*",
|
89 |
+
"friendsofphp/php-cs-fixer": "2.*",
|
90 |
+
"phpunit/phpunit": "4.*",
|
91 |
+
"squizlabs/php_codesniffer": "3.*"
|
92 |
},
|
93 |
"type": "library",
|
94 |
"autoload": {
|
116 |
"geolocation",
|
117 |
"maxmind"
|
118 |
],
|
119 |
+
"time": "2017-07-10T17:59:43+00:00"
|
120 |
},
|
121 |
{
|
122 |
"name": "maxmind-db/reader",
|
175 |
},
|
176 |
{
|
177 |
"name": "maxmind/web-service-common",
|
178 |
+
"version": "v0.4.0",
|
179 |
"source": {
|
180 |
"type": "git",
|
181 |
"url": "https://github.com/maxmind/web-service-common-php.git",
|
182 |
+
"reference": "622f7c732a7f9c4c62497fc103939e042b6bdb88"
|
183 |
},
|
184 |
"dist": {
|
185 |
"type": "zip",
|
186 |
+
"url": "https://api.github.com/repos/maxmind/web-service-common-php/zipball/622f7c732a7f9c4c62497fc103939e042b6bdb88",
|
187 |
+
"reference": "622f7c732a7f9c4c62497fc103939e042b6bdb88",
|
188 |
"shasum": ""
|
189 |
},
|
190 |
"require": {
|
191 |
"composer/ca-bundle": "^1.0.3",
|
192 |
"ext-curl": "*",
|
193 |
"ext-json": "*",
|
194 |
+
"php": ">=5.4"
|
195 |
},
|
196 |
"require-dev": {
|
197 |
+
"friendsofphp/php-cs-fixer": "2.*",
|
198 |
"phpunit/phpunit": "4.*",
|
199 |
+
"squizlabs/php_codesniffer": "3.*"
|
200 |
},
|
201 |
"type": "library",
|
202 |
"autoload": {
|
203 |
"psr-4": {
|
204 |
+
"MaxMind\\Exception\\": "src/Exception",
|
205 |
+
"MaxMind\\WebService\\": "src/WebService"
|
206 |
}
|
207 |
},
|
208 |
"notification-url": "https://packagist.org/downloads/",
|
216 |
}
|
217 |
],
|
218 |
"description": "Internal MaxMind Web Service API",
|
219 |
+
"homepage": "https://github.com/maxmind/web-service-common-php",
|
220 |
+
"time": "2017-07-06T17:48:21+00:00"
|
221 |
}
|
222 |
],
|
223 |
"packages-dev": [],
|
data-sources/auto.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
/*
|
3 |
-
Copyright 2013-
|
4 |
Author: Benjamin Pick (info@yellowtree.de)
|
5 |
|
6 |
This program is free software; you can redistribute it and/or modify
|
1 |
<?php
|
2 |
/*
|
3 |
+
Copyright 2013-2017 Yellow Tree, Siegen, Germany
|
4 |
Author: Benjamin Pick (info@yellowtree.de)
|
5 |
|
6 |
This program is free software; you can redistribute it and/or modify
|
data-sources/header.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
/*
|
3 |
-
Copyright 2013-
|
4 |
Author: Benjamin Pick (info@yellowtree.de)
|
5 |
|
6 |
This program is free software; you can redistribute it and/or modify
|
1 |
<?php
|
2 |
/*
|
3 |
+
Copyright 2013-2017 Yellow Tree, Siegen, Germany
|
4 |
Author: Benjamin Pick (info@yellowtree.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 (info@yellowtree.de)
|
5 |
|
6 |
This program is free software; you can redistribute it and/or modify
|
@@ -132,7 +132,8 @@ HTML;
|
|
132 |
}
|
133 |
|
134 |
if (!file_exists($data_filename)) {
|
135 |
-
|
|
|
136 |
}
|
137 |
|
138 |
$data_filename = apply_filters('geoip_detect_get_abs_db_filename', $data_filename);
|
1 |
<?php
|
2 |
/*
|
3 |
+
Copyright 2013-2017 Yellow Tree, Siegen, Germany
|
4 |
Author: Benjamin Pick (info@yellowtree.de)
|
5 |
|
6 |
This program is free software; you can redistribute it and/or modify
|
132 |
}
|
133 |
|
134 |
if (!file_exists($data_filename)) {
|
135 |
+
// Maybe site root changed?
|
136 |
+
$data_filename = $this->maxmindValidateFilename(get_option('geoip-detect-manual_file'));
|
137 |
}
|
138 |
|
139 |
$data_filename = apply_filters('geoip_detect_get_abs_db_filename', $data_filename);
|
data-sources/precision.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
/*
|
3 |
-
Copyright 2013-
|
4 |
Author: Benjamin Pick (info@yellowtree.de)
|
5 |
|
6 |
This program is free software; you can redistribute it and/or modify
|
@@ -104,7 +104,7 @@ class PrecisionDataSource extends AbstractDataSource {
|
|
104 |
$current_api_type = get_option('geoip-detect-precision_api_type');
|
105 |
|
106 |
$label_user_id = __('User ID:', 'geoip-detect');
|
107 |
-
$label_user_secret = __('
|
108 |
$label_api_type = __('API Type:', 'geoip-detect');
|
109 |
|
110 |
$html = <<<HTML
|
@@ -131,7 +131,7 @@ HTML;
|
|
131 |
update_option('geoip-detect-precision-user_id', $user_id);
|
132 |
}
|
133 |
if (isset($post['options_precision']['user_secret'])) {
|
134 |
-
$user_secret = $post['options_precision']['user_secret'];
|
135 |
update_option('geoip-detect-precision-user_secret', $user_secret);
|
136 |
}
|
137 |
if (isset($post['options_precision']['api_type'])) {
|
1 |
<?php
|
2 |
/*
|
3 |
+
Copyright 2013-2017 Yellow Tree, Siegen, Germany
|
4 |
Author: Benjamin Pick (info@yellowtree.de)
|
5 |
|
6 |
This program is free software; you can redistribute it and/or modify
|
104 |
$current_api_type = get_option('geoip-detect-precision_api_type');
|
105 |
|
106 |
$label_user_id = __('User ID:', 'geoip-detect');
|
107 |
+
$label_user_secret = __('License key:', 'geoip-detect');
|
108 |
$label_api_type = __('API Type:', 'geoip-detect');
|
109 |
|
110 |
$html = <<<HTML
|
131 |
update_option('geoip-detect-precision-user_id', $user_id);
|
132 |
}
|
133 |
if (isset($post['options_precision']['user_secret'])) {
|
134 |
+
$user_secret = trim($post['options_precision']['user_secret']);
|
135 |
update_option('geoip-detect-precision-user_secret', $user_secret);
|
136 |
}
|
137 |
if (isset($post['options_precision']['api_type'])) {
|
data-sources/registry.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
/*
|
3 |
-
Copyright 2013-
|
4 |
Author: Benjamin Pick (info@yellowtree.de)
|
5 |
|
6 |
This program is free software; you can redistribute it and/or modify
|
1 |
<?php
|
2 |
/*
|
3 |
+
Copyright 2013-2017 Yellow Tree, Siegen, Germany
|
4 |
Author: Benjamin Pick (info@yellowtree.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 (info@yellowtree.de)
|
5 |
|
6 |
This program is free software; you can redistribute it and/or modify
|
1 |
<?php
|
2 |
/*
|
3 |
+
Copyright 2013-2017 Yellow Tree, Siegen, Germany
|
4 |
Author: Benjamin Pick (info@yellowtree.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 (info@yellowtree.de)
|
5 |
|
6 |
This program is free software; you can redistribute it and/or modify
|
@@ -213,7 +213,7 @@ function _geoip_detect2_record_enrich_data($record, $ip, $sourceId, $error) {
|
|
213 |
* @param array $record
|
214 |
*/
|
215 |
function _geoip_detect2_try_to_fix_timezone($data) {
|
216 |
-
if (!empty($data['location']['
|
217 |
return $data;
|
218 |
|
219 |
if (!function_exists('_geoip_detect_get_time_zone')) {
|
@@ -221,7 +221,7 @@ function _geoip_detect2_try_to_fix_timezone($data) {
|
|
221 |
}
|
222 |
|
223 |
if (!empty($data['country']['iso_code'])) {
|
224 |
-
$data['location']['time_zone'] = _geoip_detect_get_time_zone($data['country']['iso_code'],
|
225 |
} else {
|
226 |
$data['location']['time_zone'] = null;
|
227 |
}
|
1 |
<?php
|
2 |
/*
|
3 |
+
Copyright 2013-2017 Yellow Tree, Siegen, Germany
|
4 |
Author: Benjamin Pick (info@yellowtree.de)
|
5 |
|
6 |
This program is free software; you can redistribute it and/or modify
|
213 |
* @param array $record
|
214 |
*/
|
215 |
function _geoip_detect2_try_to_fix_timezone($data) {
|
216 |
+
if (!empty($data['location']['time_zone']))
|
217 |
return $data;
|
218 |
|
219 |
if (!function_exists('_geoip_detect_get_time_zone')) {
|
221 |
}
|
222 |
|
223 |
if (!empty($data['country']['iso_code'])) {
|
224 |
+
$data['location']['time_zone'] = _geoip_detect_get_time_zone($data['country']['iso_code'], isset($data['subdivisions'][0]['iso_code']) ? $data['subdivisions'][0]['iso_code'] : null);
|
225 |
} else {
|
226 |
$data['location']['time_zone'] = null;
|
227 |
}
|
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: 2.
|
9 |
License: GPLv3 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
11 |
Text Domain: geoip-detect
|
@@ -13,13 +13,13 @@ Domain Path: /languages
|
|
13 |
GitHub Plugin URI: https://github.com/yellowtree/wp-geoip-detect
|
14 |
GitHub Branch: geoipv2
|
15 |
Requires WP: 3.5
|
16 |
-
Requires PHP: 5.
|
17 |
*/
|
18 |
|
19 |
-
define('GEOIP_DETECT_VERSION', '2.
|
20 |
|
21 |
/*
|
22 |
-
Copyright 2013-
|
23 |
Author: Benjamin Pick (info@yellowtree.de)
|
24 |
|
25 |
This program is free software; you can redistribute it and/or modify
|
@@ -37,7 +37,7 @@ along with this program; if not, write to the Free Software
|
|
37 |
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
38 |
*/
|
39 |
|
40 |
-
define('GEOIP_REQUIRED_PHP_VERSION', '5.
|
41 |
define('GEOIP_REQUIRED_WP_VERSION', '3.5');
|
42 |
|
43 |
define('GEOIP_PLUGIN_FILE', __FILE__);
|
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: 2.8.0
|
9 |
License: GPLv3 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
11 |
Text Domain: geoip-detect
|
13 |
GitHub Plugin URI: https://github.com/yellowtree/wp-geoip-detect
|
14 |
GitHub Branch: geoipv2
|
15 |
Requires WP: 3.5
|
16 |
+
Requires PHP: 5.4
|
17 |
*/
|
18 |
|
19 |
+
define('GEOIP_DETECT_VERSION', '2.8.0');
|
20 |
|
21 |
/*
|
22 |
+
Copyright 2013-2017 Yellow Tree, Siegen, Germany
|
23 |
Author: Benjamin Pick (info@yellowtree.de)
|
24 |
|
25 |
This program is free software; you can redistribute it and/or modify
|
37 |
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
38 |
*/
|
39 |
|
40 |
+
define('GEOIP_REQUIRED_PHP_VERSION', '5.4');
|
41 |
define('GEOIP_REQUIRED_WP_VERSION', '3.5');
|
42 |
|
43 |
define('GEOIP_PLUGIN_FILE', __FILE__);
|
legacy-api.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
/*
|
3 |
-
Copyright 2013-
|
4 |
Author: Benjamin Pick (info@yellowtree.de)
|
5 |
|
6 |
This program is free software; you can redistribute it and/or modify
|
1 |
<?php
|
2 |
/*
|
3 |
+
Copyright 2013-2017 Yellow Tree, Siegen, Germany
|
4 |
Author: Benjamin Pick (info@yellowtree.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 (info@yellowtree.de)
|
5 |
|
6 |
This program is free software; you can redistribute it and/or modify
|
1 |
<?php
|
2 |
/*
|
3 |
+
Copyright 2013-2017 Yellow Tree, Siegen, Germany
|
4 |
Author: Benjamin Pick (info@yellowtree.de)
|
5 |
|
6 |
This program is free software; you can redistribute it and/or modify
|
readme.txt
CHANGED
@@ -2,7 +2,8 @@
|
|
2 |
Contributors: benjaminpick
|
3 |
Tags: geoip, maxmind, geolocation, locator
|
4 |
Requires at least: 3.5
|
5 |
-
Tested up to: 4.
|
|
|
6 |
Stable tag: trunk
|
7 |
License: GPLv3 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
@@ -47,7 +48,7 @@ See [API Documentation](https://github.com/yellowtree/wp-geoip-detect/wiki/API-D
|
|
47 |
* You show or hide content specific to a geographic target group
|
48 |
* Etc. ... You tell me! I'm rather curious what you'll do with this plugin!
|
49 |
|
50 |
-
**System Requirements**: You will need at least PHP 5.
|
51 |
|
52 |
*This extension is "charity-ware". If you are happy with it, please [leave a tip](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=BSYUZHS8FH3CL) for the benefit of [this charity](http://www.jmem-hainichen.de/homepage). (See [FAQ](https://github.com/yellowtree/wp-geoip-detect/wiki/FAQ#what-you-mean-by-this-plugin-is-charity-ware) for more infos.)*
|
53 |
|
@@ -96,6 +97,10 @@ Does `geoip_detect2_get_info_from_current_ip()` return the same country, regardl
|
|
96 |
|
97 |
== Upgrade Notice ==
|
98 |
|
|
|
|
|
|
|
|
|
99 |
= 2.6.0 =
|
100 |
|
101 |
Support for Cloudflare & AWS. 2 shortcodes for Contact Form 7.
|
@@ -167,6 +172,14 @@ Fixing automatic weekly updates.
|
|
167 |
|
168 |
== Changelog ==
|
169 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
170 |
= 2.7.0 =
|
171 |
|
172 |
* ADD: The options array of `geoip_detect2_get_info_from_ip` now has a new parameter for overriding the current source for a single lookup. See [API usage examples](https://github.com/yellowtree/wp-geoip-detect/wiki/API-Usage-Examples)
|
2 |
Contributors: benjaminpick
|
3 |
Tags: geoip, maxmind, geolocation, locator
|
4 |
Requires at least: 3.5
|
5 |
+
Tested up to: 4.8
|
6 |
+
Requires PHP: 5.4
|
7 |
Stable tag: trunk
|
8 |
License: GPLv3 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
48 |
* You show or hide content specific to a geographic target group
|
49 |
* Etc. ... You tell me! I'm rather curious what you'll do with this plugin!
|
50 |
|
51 |
+
**System Requirements**: You will need at least PHP 5.4.
|
52 |
|
53 |
*This extension is "charity-ware". If you are happy with it, please [leave a tip](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=BSYUZHS8FH3CL) for the benefit of [this charity](http://www.jmem-hainichen.de/homepage). (See [FAQ](https://github.com/yellowtree/wp-geoip-detect/wiki/FAQ#what-you-mean-by-this-plugin-is-charity-ware) for more infos.)*
|
54 |
|
97 |
|
98 |
== Upgrade Notice ==
|
99 |
|
100 |
+
= 2.8.0 =
|
101 |
+
|
102 |
+
Warning: This bugfix version of the plugin requires PHP 5.4.
|
103 |
+
|
104 |
= 2.6.0 =
|
105 |
|
106 |
Support for Cloudflare & AWS. 2 shortcodes for Contact Form 7.
|
172 |
|
173 |
== Changelog ==
|
174 |
|
175 |
+
= 2.8.0 =
|
176 |
+
|
177 |
+
* FIX: Localhost now always is a trusted proxy (for standard reverse proxy configurations, however the checkbox "uses a reverse proxy" still needs to be activated.)
|
178 |
+
* FIX: Timezone was overwritten by country data even though the maxmind data had already detected a timezone.
|
179 |
+
* ADD: If the manual datasource is used, the file will continue to be found if the site is moved to another host
|
180 |
+
* Maxmind vendor code was updated to the current version (2.6.0).
|
181 |
+
* PHP 5.4 is now required (due to the maxmind library).
|
182 |
+
|
183 |
= 2.7.0 =
|
184 |
|
185 |
* ADD: The options array of `geoip_detect2_get_info_from_ip` now has a new parameter for overriding the current source for a single lookup. See [API usage examples](https://github.com/yellowtree/wp-geoip-detect/wiki/API-Usage-Examples)
|
shortcode.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
/*
|
3 |
-
Copyright 2013-
|
4 |
Author: Benjamin Pick (info@yellowtree.de)
|
5 |
|
6 |
This program is free software; you can redistribute it and/or modify
|
@@ -248,7 +248,7 @@ add_shortcode('geoip_detect2_countries', 'geoip_detect2_shortcode_country_select
|
|
248 |
*
|
249 |
*/
|
250 |
function geoip_detect2_shortcode_country_select_wpcf7($tag) {
|
251 |
-
$tag = new
|
252 |
|
253 |
$default = (string) reset( $tag->values );
|
254 |
$default = $tag->get_default_option($default, array('multiple' => false));
|
1 |
<?php
|
2 |
/*
|
3 |
+
Copyright 2013-2017 Yellow Tree, Siegen, Germany
|
4 |
Author: Benjamin Pick (info@yellowtree.de)
|
5 |
|
6 |
This program is free software; you can redistribute it and/or modify
|
248 |
*
|
249 |
*/
|
250 |
function geoip_detect2_shortcode_country_select_wpcf7($tag) {
|
251 |
+
$tag = new WPCF7_FormTag( $tag );
|
252 |
|
253 |
$default = (string) reset( $tag->values );
|
254 |
$default = $tag->get_default_option($default, array('multiple' => false));
|
upgrade-plugin.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
/*
|
3 |
-
Copyright 2013-
|
4 |
Author: Benjamin Pick (info@yellowtree.de)
|
5 |
|
6 |
This program is free software; you can redistribute it and/or modify
|
1 |
<?php
|
2 |
/*
|
3 |
+
Copyright 2013-2017 Yellow Tree, Siegen, Germany
|
4 |
Author: Benjamin Pick (info@yellowtree.de)
|
5 |
|
6 |
This program is free software; you can redistribute it and/or modify
|
vendor/composer/autoload_psr4.php
CHANGED
@@ -6,8 +6,9 @@ $vendorDir = dirname(dirname(__FILE__));
|
|
6 |
$baseDir = dirname($vendorDir);
|
7 |
|
8 |
return array(
|
|
|
|
|
9 |
'MaxMind\\Db\\' => array($vendorDir . '/maxmind-db/reader/src/MaxMind/Db'),
|
10 |
-
'MaxMind\\' => array($vendorDir . '/maxmind/web-service-common/src'),
|
11 |
'GeoIp2\\' => array($vendorDir . '/geoip2/geoip2/src'),
|
12 |
'Composer\\CaBundle\\' => array($vendorDir . '/composer/ca-bundle/src'),
|
13 |
);
|
6 |
$baseDir = dirname($vendorDir);
|
7 |
|
8 |
return array(
|
9 |
+
'MaxMind\\WebService\\' => array($vendorDir . '/maxmind/web-service-common/src/WebService'),
|
10 |
+
'MaxMind\\Exception\\' => array($vendorDir . '/maxmind/web-service-common/src/Exception'),
|
11 |
'MaxMind\\Db\\' => array($vendorDir . '/maxmind-db/reader/src/MaxMind/Db'),
|
|
|
12 |
'GeoIp2\\' => array($vendorDir . '/geoip2/geoip2/src'),
|
13 |
'Composer\\CaBundle\\' => array($vendorDir . '/composer/ca-bundle/src'),
|
14 |
);
|
vendor/composer/autoload_static.php
CHANGED
@@ -9,8 +9,9 @@ class ComposerStaticInite354937679ffa734a3f63544e59103dd
|
|
9 |
public static $prefixLengthsPsr4 = array (
|
10 |
'M' =>
|
11 |
array (
|
|
|
|
|
12 |
'MaxMind\\Db\\' => 11,
|
13 |
-
'MaxMind\\' => 8,
|
14 |
),
|
15 |
'G' =>
|
16 |
array (
|
@@ -23,13 +24,17 @@ class ComposerStaticInite354937679ffa734a3f63544e59103dd
|
|
23 |
);
|
24 |
|
25 |
public static $prefixDirsPsr4 = array (
|
26 |
-
'MaxMind\\
|
27 |
array (
|
28 |
-
0 => __DIR__ . '/..' . '/maxmind-
|
|
|
|
|
|
|
|
|
29 |
),
|
30 |
-
'MaxMind\\' =>
|
31 |
array (
|
32 |
-
0 => __DIR__ . '/..' . '/maxmind
|
33 |
),
|
34 |
'GeoIp2\\' =>
|
35 |
array (
|
9 |
public static $prefixLengthsPsr4 = array (
|
10 |
'M' =>
|
11 |
array (
|
12 |
+
'MaxMind\\WebService\\' => 19,
|
13 |
+
'MaxMind\\Exception\\' => 18,
|
14 |
'MaxMind\\Db\\' => 11,
|
|
|
15 |
),
|
16 |
'G' =>
|
17 |
array (
|
24 |
);
|
25 |
|
26 |
public static $prefixDirsPsr4 = array (
|
27 |
+
'MaxMind\\WebService\\' =>
|
28 |
array (
|
29 |
+
0 => __DIR__ . '/..' . '/maxmind/web-service-common/src/WebService',
|
30 |
+
),
|
31 |
+
'MaxMind\\Exception\\' =>
|
32 |
+
array (
|
33 |
+
0 => __DIR__ . '/..' . '/maxmind/web-service-common/src/Exception',
|
34 |
),
|
35 |
+
'MaxMind\\Db\\' =>
|
36 |
array (
|
37 |
+
0 => __DIR__ . '/..' . '/maxmind-db/reader/src/MaxMind/Db',
|
38 |
),
|
39 |
'GeoIp2\\' =>
|
40 |
array (
|
vendor/composer/ca-bundle/README.md
CHANGED
@@ -40,7 +40,14 @@ Basic usage
|
|
40 |
|
41 |
```php
|
42 |
$curl = curl_init("https://example.org/");
|
43 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44 |
$result = curl_exec($curl);
|
45 |
```
|
46 |
|
@@ -53,11 +60,11 @@ $opts = array(
|
|
53 |
)
|
54 |
);
|
55 |
|
56 |
-
$
|
57 |
-
if (is_dir($
|
58 |
-
$opts['ssl']['capath'] = $
|
59 |
} else {
|
60 |
-
$opts['ssl']['cafile'] = $
|
61 |
}
|
62 |
|
63 |
$context = stream_context_create($opts);
|
40 |
|
41 |
```php
|
42 |
$curl = curl_init("https://example.org/");
|
43 |
+
|
44 |
+
$caPathOrFile = \Composer\CaBundle\CaBundle::getSystemCaRootBundlePath());
|
45 |
+
if (is_dir($caPathOrFile) || (is_link($caPathOrFile) && is_dir(readlink($caPathOrFile)))) {
|
46 |
+
curl_setopt($curl, CURLOPT_CAPATH, $caPathOrFile);
|
47 |
+
} else {
|
48 |
+
curl_setopt($curl, CURLOPT_CAINFO, $caPathOrFile);
|
49 |
+
}
|
50 |
+
|
51 |
$result = curl_exec($curl);
|
52 |
```
|
53 |
|
60 |
)
|
61 |
);
|
62 |
|
63 |
+
$caPathOrFile = \Composer\CaBundle\CaBundle::getSystemCaRootBundlePath());
|
64 |
+
if (is_dir($caPathOrFile) || (is_link($caPathOrFile) && is_dir(readlink($caPathOrFile)))) {
|
65 |
+
$opts['ssl']['capath'] = $caPathOrFile;
|
66 |
} else {
|
67 |
+
$opts['ssl']['cafile'] = $caPathOrFile;
|
68 |
}
|
69 |
|
70 |
$context = stream_context_create($opts);
|
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 |
|
@@ -1220,33 +1220,6 @@ wKeI8lN3s2Berq4o2jUsbzRF0ybh3uxbTydrFny9RAQYgrOJeRcQcT16ohZO9QHNpGxlaKFJdlxD
|
|
1220 |
ydi8NmdspZS11My5vWo1ViHe2MPr+8ukYEywVaCge1ey
|
1221 |
-----END CERTIFICATE-----
|
1222 |
|
1223 |
-
WellsSecure Public Root Certificate Authority
|
1224 |
-
=============================================
|
1225 |
-
-----BEGIN CERTIFICATE-----
|
1226 |
-
MIIEvTCCA6WgAwIBAgIBATANBgkqhkiG9w0BAQUFADCBhTELMAkGA1UEBhMCVVMxIDAeBgNVBAoM
|
1227 |
-
F1dlbGxzIEZhcmdvIFdlbGxzU2VjdXJlMRwwGgYDVQQLDBNXZWxscyBGYXJnbyBCYW5rIE5BMTYw
|
1228 |
-
NAYDVQQDDC1XZWxsc1NlY3VyZSBQdWJsaWMgUm9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwHhcN
|
1229 |
-
MDcxMjEzMTcwNzU0WhcNMjIxMjE0MDAwNzU0WjCBhTELMAkGA1UEBhMCVVMxIDAeBgNVBAoMF1dl
|
1230 |
-
bGxzIEZhcmdvIFdlbGxzU2VjdXJlMRwwGgYDVQQLDBNXZWxscyBGYXJnbyBCYW5rIE5BMTYwNAYD
|
1231 |
-
VQQDDC1XZWxsc1NlY3VyZSBQdWJsaWMgUm9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwggEiMA0G
|
1232 |
-
CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDub7S9eeKPCCGeOARBJe+rWxxTkqxtnt3CxC5FlAM1
|
1233 |
-
iGd0V+PfjLindo8796jE2yljDpFoNoqXjopxaAkH5OjUDk/41itMpBb570OYj7OeUt9tkTmPOL13
|
1234 |
-
i0Nj67eT/DBMHAGTthP796EfvyXhdDcsHqRePGj4S78NuR4uNuip5Kf4D8uCdXw1LSLWwr8L87T8
|
1235 |
-
bJVhHlfXBIEyg1J55oNjz7fLY4sR4r1e6/aN7ZVyKLSsEmLpSjPmgzKuBXWVvYSV2ypcm44uDLiB
|
1236 |
-
K0HmOFafSZtsdvqKXfcBeYF8wYNABf5x/Qw/zE5gCQ5lRxAvAcAFP4/4s0HvWkJ+We/SlwxlAgMB
|
1237 |
-
AAGjggE0MIIBMDAPBgNVHRMBAf8EBTADAQH/MDkGA1UdHwQyMDAwLqAsoCqGKGh0dHA6Ly9jcmwu
|
1238 |
-
cGtpLndlbGxzZmFyZ28uY29tL3dzcHJjYS5jcmwwDgYDVR0PAQH/BAQDAgHGMB0GA1UdDgQWBBQm
|
1239 |
-
lRkQ2eihl5H/3BnZtQQ+0nMKajCBsgYDVR0jBIGqMIGngBQmlRkQ2eihl5H/3BnZtQQ+0nMKaqGB
|
1240 |
-
i6SBiDCBhTELMAkGA1UEBhMCVVMxIDAeBgNVBAoMF1dlbGxzIEZhcmdvIFdlbGxzU2VjdXJlMRww
|
1241 |
-
GgYDVQQLDBNXZWxscyBGYXJnbyBCYW5rIE5BMTYwNAYDVQQDDC1XZWxsc1NlY3VyZSBQdWJsaWMg
|
1242 |
-
Um9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHmCAQEwDQYJKoZIhvcNAQEFBQADggEBALkVsUSRzCPI
|
1243 |
-
K0134/iaeycNzXK7mQDKfGYZUMbVmO2rvwNa5U3lHshPcZeG1eMd/ZDJPHV3V3p9+N701NX3leZ0
|
1244 |
-
bh08rnyd2wIDBSxxSyU+B+NemvVmFymIGjifz6pBA4SXa5M4esowRBskRDPQ5NHcKDj0E0M1NSlj
|
1245 |
-
qHyita04pO2t/caaH/+Xc/77szWnk4bGdpEA5qxRFsQnMlzbc9qlk1eOPm01JghZ1edE13YgY+es
|
1246 |
-
E2fDbbFwRnzVlhE9iW9dqKHrjQrawx0zbKPqZxmamX9LPYNRKh3KL4YMon4QLSvUFpULB6ouFJJJ
|
1247 |
-
tylv2G0xffX8oRAHh84vWdw+WNs=
|
1248 |
-
-----END CERTIFICATE-----
|
1249 |
-
|
1250 |
COMODO ECC Certification Authority
|
1251 |
==================================
|
1252 |
-----BEGIN CERTIFICATE-----
|
@@ -1308,46 +1281,6 @@ hNVQA7bihKOmNqoROgHhGEvWRGizPflTdISzRpFGlgC3gCy24eMQ4tui5yiPAZZiFj4A4xylNoEY
|
|
1308 |
okxSdsARo27mHbrjWr42U8U+dY+GaSlYU7Wcu2+fXMUY7N0v4ZjJ/L7fCg0=
|
1309 |
-----END CERTIFICATE-----
|
1310 |
|
1311 |
-
Microsec e-Szigno Root CA
|
1312 |
-
=========================
|
1313 |
-
-----BEGIN CERTIFICATE-----
|
1314 |
-
MIIHqDCCBpCgAwIBAgIRAMy4579OKRr9otxmpRwsDxEwDQYJKoZIhvcNAQEFBQAwcjELMAkGA1UE
|
1315 |
-
BhMCSFUxETAPBgNVBAcTCEJ1ZGFwZXN0MRYwFAYDVQQKEw1NaWNyb3NlYyBMdGQuMRQwEgYDVQQL
|
1316 |
-
EwtlLVN6aWdubyBDQTEiMCAGA1UEAxMZTWljcm9zZWMgZS1Temlnbm8gUm9vdCBDQTAeFw0wNTA0
|
1317 |
-
MDYxMjI4NDRaFw0xNzA0MDYxMjI4NDRaMHIxCzAJBgNVBAYTAkhVMREwDwYDVQQHEwhCdWRhcGVz
|
1318 |
-
dDEWMBQGA1UEChMNTWljcm9zZWMgTHRkLjEUMBIGA1UECxMLZS1Temlnbm8gQ0ExIjAgBgNVBAMT
|
1319 |
-
GU1pY3Jvc2VjIGUtU3ppZ25vIFJvb3QgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB
|
1320 |
-
AQDtyADVgXvNOABHzNuEwSFpLHSQDCHZU4ftPkNEU6+r+ICbPHiN1I2uuO/TEdyB5s87lozWbxXG
|
1321 |
-
d36hL+BfkrYn13aaHUM86tnsL+4582pnS4uCzyL4ZVX+LMsvfUh6PXX5qqAnu3jCBspRwn5mS6/N
|
1322 |
-
oqdNAoI/gqyFxuEPkEeZlApxcpMqyabAvjxWTHOSJ/FrtfX9/DAFYJLG65Z+AZHCabEeHXtTRbjc
|
1323 |
-
QR/Ji3HWVBTji1R4P770Yjtb9aPs1ZJ04nQw7wHb4dSrmZsqa/i9phyGI0Jf7Enemotb9HI6QMVJ
|
1324 |
-
PqW+jqpx62z69Rrkav17fVVA71hu5tnVvCSrwe+3AgMBAAGjggQ3MIIEMzBnBggrBgEFBQcBAQRb
|
1325 |
-
MFkwKAYIKwYBBQUHMAGGHGh0dHBzOi8vcmNhLmUtc3ppZ25vLmh1L29jc3AwLQYIKwYBBQUHMAKG
|
1326 |
-
IWh0dHA6Ly93d3cuZS1zemlnbm8uaHUvUm9vdENBLmNydDAPBgNVHRMBAf8EBTADAQH/MIIBcwYD
|
1327 |
-
VR0gBIIBajCCAWYwggFiBgwrBgEEAYGoGAIBAQEwggFQMCgGCCsGAQUFBwIBFhxodHRwOi8vd3d3
|
1328 |
-
LmUtc3ppZ25vLmh1L1NaU1ovMIIBIgYIKwYBBQUHAgIwggEUHoIBEABBACAAdABhAG4A+gBzAO0A
|
1329 |
-
dAB2AOEAbgB5ACAA6QByAHQAZQBsAG0AZQB6AOkAcwDpAGgAZQB6ACAA6QBzACAAZQBsAGYAbwBn
|
1330 |
-
AGEAZADhAHMA4QBoAG8AegAgAGEAIABTAHoAbwBsAGcA4QBsAHQAYQB0APMAIABTAHoAbwBsAGcA
|
1331 |
-
4QBsAHQAYQB0AOEAcwBpACAAUwB6AGEAYgDhAGwAeQB6AGEAdABhACAAcwB6AGUAcgBpAG4AdAAg
|
1332 |
-
AGsAZQBsAGwAIABlAGwAagDhAHIAbgBpADoAIABoAHQAdABwADoALwAvAHcAdwB3AC4AZQAtAHMA
|
1333 |
-
egBpAGcAbgBvAC4AaAB1AC8AUwBaAFMAWgAvMIHIBgNVHR8EgcAwgb0wgbqggbeggbSGIWh0dHA6
|
1334 |
-
Ly93d3cuZS1zemlnbm8uaHUvUm9vdENBLmNybIaBjmxkYXA6Ly9sZGFwLmUtc3ppZ25vLmh1L0NO
|
1335 |
-
PU1pY3Jvc2VjJTIwZS1Temlnbm8lMjBSb290JTIwQ0EsT1U9ZS1Temlnbm8lMjBDQSxPPU1pY3Jv
|
1336 |
-
c2VjJTIwTHRkLixMPUJ1ZGFwZXN0LEM9SFU/Y2VydGlmaWNhdGVSZXZvY2F0aW9uTGlzdDtiaW5h
|
1337 |
-
cnkwDgYDVR0PAQH/BAQDAgEGMIGWBgNVHREEgY4wgYuBEGluZm9AZS1zemlnbm8uaHWkdzB1MSMw
|
1338 |
-
IQYDVQQDDBpNaWNyb3NlYyBlLVN6aWduw7MgUm9vdCBDQTEWMBQGA1UECwwNZS1TemlnbsOzIEhT
|
1339 |
-
WjEWMBQGA1UEChMNTWljcm9zZWMgS2Z0LjERMA8GA1UEBxMIQnVkYXBlc3QxCzAJBgNVBAYTAkhV
|
1340 |
-
MIGsBgNVHSMEgaQwgaGAFMegSXUWYYTbMUuE0vE3QJDvTtz3oXakdDByMQswCQYDVQQGEwJIVTER
|
1341 |
-
MA8GA1UEBxMIQnVkYXBlc3QxFjAUBgNVBAoTDU1pY3Jvc2VjIEx0ZC4xFDASBgNVBAsTC2UtU3pp
|
1342 |
-
Z25vIENBMSIwIAYDVQQDExlNaWNyb3NlYyBlLVN6aWdubyBSb290IENBghEAzLjnv04pGv2i3Gal
|
1343 |
-
HCwPETAdBgNVHQ4EFgQUx6BJdRZhhNsxS4TS8TdAkO9O3PcwDQYJKoZIhvcNAQEFBQADggEBANMT
|
1344 |
-
nGZjWS7KXHAM/IO8VbH0jgdsZifOwTsgqRy7RlRw7lrMoHfqaEQn6/Ip3Xep1fvj1KcExJW4C+FE
|
1345 |
-
aGAHQzAxQmHl7tnlJNUb3+FKG6qfx1/4ehHqE5MAyopYse7tDk2016g2JnzgOsHVV4Lxdbb9iV/a
|
1346 |
-
86g4nzUGCM4ilb7N1fy+W955a9x6qWVmvrElWl/tftOsRm1M9DKHtCAE4Gx4sHfRhUZLphK3dehK
|
1347 |
-
yVZs15KrnfVJONJPU+NVkBHbmJbGSfI+9J8b4PeI3CVimUTYc78/MPMMNz7UwiiAc7EBt51alhQB
|
1348 |
-
S6kRnSlqLtBdgcDPsiBDxwPgN05dCtxZICU=
|
1349 |
-
-----END CERTIFICATE-----
|
1350 |
-
|
1351 |
Certigna
|
1352 |
========
|
1353 |
-----BEGIN CERTIFICATE-----
|
@@ -1514,28 +1447,6 @@ G8kS1sHNzYDzAgE8yGnLRUhj2JTQ7IUOO04RZfSCjKY9ri4ilAnIXOo8gV0WKgOXFlUJ24pBgp5m
|
|
1514 |
mxE=
|
1515 |
-----END CERTIFICATE-----
|
1516 |
|
1517 |
-
ApplicationCA - Japanese Government
|
1518 |
-
===================================
|
1519 |
-
-----BEGIN CERTIFICATE-----
|
1520 |
-
MIIDoDCCAoigAwIBAgIBMTANBgkqhkiG9w0BAQUFADBDMQswCQYDVQQGEwJKUDEcMBoGA1UEChMT
|
1521 |
-
SmFwYW5lc2UgR292ZXJubWVudDEWMBQGA1UECxMNQXBwbGljYXRpb25DQTAeFw0wNzEyMTIxNTAw
|
1522 |
-
MDBaFw0xNzEyMTIxNTAwMDBaMEMxCzAJBgNVBAYTAkpQMRwwGgYDVQQKExNKYXBhbmVzZSBHb3Zl
|
1523 |
-
cm5tZW50MRYwFAYDVQQLEw1BcHBsaWNhdGlvbkNBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB
|
1524 |
-
CgKCAQEAp23gdE6Hj6UG3mii24aZS2QNcfAKBZuOquHMLtJqO8F6tJdhjYq+xpqcBrSGUeQ3DnR4
|
1525 |
-
fl+Kf5Sk10cI/VBaVuRorChzoHvpfxiSQE8tnfWuREhzNgaeZCw7NCPbXCbkcXmP1G55IrmTwcrN
|
1526 |
-
wVbtiGrXoDkhBFcsovW8R0FPXjQilbUfKW1eSvNNcr5BViCH/OlQR9cwFO5cjFW6WY2H/CPek9AE
|
1527 |
-
jP3vbb3QesmlOmpyM8ZKDQUXKi17safY1vC+9D/qDihtQWEjdnjDuGWk81quzMKq2edY3rZ+nYVu
|
1528 |
-
nyoKb58DKTCXKB28t89UKU5RMfkntigm/qJj5kEW8DOYRwIDAQABo4GeMIGbMB0GA1UdDgQWBBRU
|
1529 |
-
WssmP3HMlEYNllPqa0jQk/5CdTAOBgNVHQ8BAf8EBAMCAQYwWQYDVR0RBFIwUKROMEwxCzAJBgNV
|
1530 |
-
BAYTAkpQMRgwFgYDVQQKDA/ml6XmnKzlm73mlL/lupwxIzAhBgNVBAsMGuOCouODl+ODquOCseOD
|
1531 |
-
vOOCt+ODp+ODs0NBMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEBADlqRHZ3ODrs
|
1532 |
-
o2dGD/mLBqj7apAxzn7s2tGJfHrrLgy9mTLnsCTWw//1sogJhyzjVOGjprIIC8CFqMjSnHH2HZ9g
|
1533 |
-
/DgzE+Ge3Atf2hZQKXsvcJEPmbo0NI2VdMV+eKlmXb3KIXdCEKxmJj3ekav9FfBv7WxfEPjzFvYD
|
1534 |
-
io+nEhEMy/0/ecGc/WLuo89UDNErXxc+4z6/wCs+CZv+iKZ+tJIX/COUgb1up8WMwusRRdv4QcmW
|
1535 |
-
dupwX3kSa+SjB1oF7ydJzyGfikwJcGapJsErEU4z0g781mzSDjJkaP+tBXhfAx2o45CsJOAPQKdL
|
1536 |
-
rosot4LKGAfmt1t06SAZf7IbiVQ=
|
1537 |
-
-----END CERTIFICATE-----
|
1538 |
-
|
1539 |
GeoTrust Primary Certification Authority - G3
|
1540 |
=============================================
|
1541 |
-----BEGIN CERTIFICATE-----
|
@@ -3538,30 +3449,6 @@ lpKQd/Ct9JDpEXjXk4nAPQu6KfTomZ1yju2dL+6SfaHx/126M2CFYv4HAqGEVka+lgqaE9chTLd8
|
|
3538 |
B59OTj+RdPsnnRHM3eaxynFNExc5JsUpISuTKWqW+qtB4Uu2NQvAmxU=
|
3539 |
-----END CERTIFICATE-----
|
3540 |
|
3541 |
-
TÜRKTRUST Elektronik Sertifika Hizmet Sağlayıcısı H6
|
3542 |
-
====================================================
|
3543 |
-
-----BEGIN CERTIFICATE-----
|
3544 |
-
MIIEJjCCAw6gAwIBAgIGfaHyZeyKMA0GCSqGSIb3DQEBCwUAMIGxMQswCQYDVQQGEwJUUjEPMA0G
|
3545 |
-
A1UEBwwGQW5rYXJhMU0wSwYDVQQKDERUw5xSS1RSVVNUIEJpbGdpIMSwbGV0acWfaW0gdmUgQmls
|
3546 |
-
acWfaW0gR8O8dmVubGnEn2kgSGl6bWV0bGVyaSBBLsWeLjFCMEAGA1UEAww5VMOcUktUUlVTVCBF
|
3547 |
-
bGVrdHJvbmlrIFNlcnRpZmlrYSBIaXptZXQgU2HEn2xhecSxY8Sxc8SxIEg2MB4XDTEzMTIxODA5
|
3548 |
-
MDQxMFoXDTIzMTIxNjA5MDQxMFowgbExCzAJBgNVBAYTAlRSMQ8wDQYDVQQHDAZBbmthcmExTTBL
|
3549 |
-
BgNVBAoMRFTDnFJLVFJVU1QgQmlsZ2kgxLBsZXRpxZ9pbSB2ZSBCaWxpxZ9pbSBHw7x2ZW5sacSf
|
3550 |
-
aSBIaXptZXRsZXJpIEEuxZ4uMUIwQAYDVQQDDDlUw5xSS1RSVVNUIEVsZWt0cm9uaWsgU2VydGlm
|
3551 |
-
aWthIEhpem1ldCBTYcSfbGF5xLFjxLFzxLEgSDYwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEK
|
3552 |
-
AoIBAQCdsGjW6L0UlqMACprx9MfMkU1xeHe59yEmFXNRFpQJRwXiM/VomjX/3EsvMsew7eKC5W/a
|
3553 |
-
2uqsxgbPJQ1BgfbBOCK9+bGlprMBvD9QFyv26WZV1DOzXPhDIHiTVRZwGTLmiddk671IUP320EED
|
3554 |
-
wnS3/faAz1vFq6TWlRKb55cTMgPp1KtDWxbtMyJkKbbSk60vbNg9tvYdDjTu0n2pVQ8g9P0pu5Fb
|
3555 |
-
HH3GQjhtQiht1AH7zYiXSX6484P4tZgvsycLSF5W506jM7NE1qXyGJTtHB6plVxiSvgNZ1GpryHV
|
3556 |
-
+DKdeboaX+UEVU0TRv/yz3THGmNtwx8XEsMeED5gCLMxAgMBAAGjQjBAMB0GA1UdDgQWBBTdVRcT
|
3557 |
-
9qzoSCHK77Wv0QAy7Z6MtTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG
|
3558 |
-
9w0BAQsFAAOCAQEAb1gNl0OqFlQ+v6nfkkU/hQu7VtMMUszIv3ZnXuaqs6fvuay0EBQNdH49ba3R
|
3559 |
-
fdCaqaXKGDsCQC4qnFAUi/5XfldcEQlLNkVS9z2sFP1E34uXI9TDwe7UU5X+LEr+DXCqu4svLcsy
|
3560 |
-
o4LyVN/Y8t3XSHLuSqMplsNEzm61kod2pLv0kmzOLBQJZo6NrRa1xxsJYTvjIKIDgI6tflEATseW
|
3561 |
-
hvtDmHd9KMeP2Cpu54Rvl0EpABZeTeIT6lnAY2c6RPuY/ATTMHKm9ocJV612ph1jmv3XZch4gyt1
|
3562 |
-
O6VbuA1df74jrlZVlFjvH4GMKrLN5ptjnhi85WsGtAuYSyher4hYyw==
|
3563 |
-
-----END CERTIFICATE-----
|
3564 |
-
|
3565 |
Certinomis - Root CA
|
3566 |
====================
|
3567 |
-----BEGIN CERTIFICATE-----
|
@@ -4041,3 +3928,28 @@ TxgKqpAd60Ae36EeRJIQmvKN4dFLRp7oRUKX6kWZ8+xm1QL68qZKJKrezrnK+T+Tb/mjuuqlPpmt
|
|
4041 |
7kGUnF4ZLvhFSZl0kbAEb+MEWrGrKqv+x9CWttrhSmQGbmBNvUJO/3jaJMobtNeWOWyu8Q6qp31I
|
4042 |
iyBMz2TWuJdGsE7RKlY6oJO9r4Ak4Ap+58rVyuiFVdw2KuGUaJPHZnJED4AhMmwlxyOAgwrr
|
4043 |
-----END CERTIFICATE-----
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
##
|
2 |
## Bundle of CA Root Certificates
|
3 |
##
|
4 |
+
## Certificate data from Mozilla as of: Wed Jun 7 03:12:05 2017 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: 93753268e1c596aee21893fb1c6975338389132f15c942ed65fc394a904371d7
|
18 |
##
|
19 |
|
20 |
|
1220 |
ydi8NmdspZS11My5vWo1ViHe2MPr+8ukYEywVaCge1ey
|
1221 |
-----END CERTIFICATE-----
|
1222 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1223 |
COMODO ECC Certification Authority
|
1224 |
==================================
|
1225 |
-----BEGIN CERTIFICATE-----
|
1281 |
okxSdsARo27mHbrjWr42U8U+dY+GaSlYU7Wcu2+fXMUY7N0v4ZjJ/L7fCg0=
|
1282 |
-----END CERTIFICATE-----
|
1283 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1284 |
Certigna
|
1285 |
========
|
1286 |
-----BEGIN CERTIFICATE-----
|
1447 |
mxE=
|
1448 |
-----END CERTIFICATE-----
|
1449 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1450 |
GeoTrust Primary Certification Authority - G3
|
1451 |
=============================================
|
1452 |
-----BEGIN CERTIFICATE-----
|
3449 |
B59OTj+RdPsnnRHM3eaxynFNExc5JsUpISuTKWqW+qtB4Uu2NQvAmxU=
|
3450 |
-----END CERTIFICATE-----
|
3451 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3452 |
Certinomis - Root CA
|
3453 |
====================
|
3454 |
-----BEGIN CERTIFICATE-----
|
3928 |
7kGUnF4ZLvhFSZl0kbAEb+MEWrGrKqv+x9CWttrhSmQGbmBNvUJO/3jaJMobtNeWOWyu8Q6qp31I
|
3929 |
iyBMz2TWuJdGsE7RKlY6oJO9r4Ak4Ap+58rVyuiFVdw2KuGUaJPHZnJED4AhMmwlxyOAgwrr
|
3930 |
-----END CERTIFICATE-----
|
3931 |
+
|
3932 |
+
TUBITAK Kamu SM SSL Kok Sertifikasi - Surum 1
|
3933 |
+
=============================================
|
3934 |
+
-----BEGIN CERTIFICATE-----
|
3935 |
+
MIIEYzCCA0ugAwIBAgIBATANBgkqhkiG9w0BAQsFADCB0jELMAkGA1UEBhMCVFIxGDAWBgNVBAcT
|
3936 |
+
D0dlYnplIC0gS29jYWVsaTFCMEAGA1UEChM5VHVya2l5ZSBCaWxpbXNlbCB2ZSBUZWtub2xvamlr
|
3937 |
+
IEFyYXN0aXJtYSBLdXJ1bXUgLSBUVUJJVEFLMS0wKwYDVQQLEyRLYW11IFNlcnRpZmlrYXN5b24g
|
3938 |
+
TWVya2V6aSAtIEthbXUgU00xNjA0BgNVBAMTLVRVQklUQUsgS2FtdSBTTSBTU0wgS29rIFNlcnRp
|
3939 |
+
ZmlrYXNpIC0gU3VydW0gMTAeFw0xMzExMjUwODI1NTVaFw00MzEwMjUwODI1NTVaMIHSMQswCQYD
|
3940 |
+
VQQGEwJUUjEYMBYGA1UEBxMPR2ViemUgLSBLb2NhZWxpMUIwQAYDVQQKEzlUdXJraXllIEJpbGlt
|
3941 |
+
c2VsIHZlIFRla25vbG9qaWsgQXJhc3Rpcm1hIEt1cnVtdSAtIFRVQklUQUsxLTArBgNVBAsTJEth
|
3942 |
+
bXUgU2VydGlmaWthc3lvbiBNZXJrZXppIC0gS2FtdSBTTTE2MDQGA1UEAxMtVFVCSVRBSyBLYW11
|
3943 |
+
IFNNIFNTTCBLb2sgU2VydGlmaWthc2kgLSBTdXJ1bSAxMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A
|
3944 |
+
MIIBCgKCAQEAr3UwM6q7a9OZLBI3hNmNe5eA027n/5tQlT6QlVZC1xl8JoSNkvoBHToP4mQ4t4y8
|
3945 |
+
6Ij5iySrLqP1N+RAjhgleYN1Hzv/bKjFxlb4tO2KRKOrbEz8HdDc72i9z+SqzvBV96I01INrN3wc
|
3946 |
+
wv61A+xXzry0tcXtAA9TNypN9E8Mg/uGz8v+jE69h/mniyFXnHrfA2eJLJ2XYacQuFWQfw4tJzh0
|
3947 |
+
3+f92k4S400VIgLI4OD8D62K18lUUMw7D8oWgITQUVbDjlZ/iSIzL+aFCr2lqBs23tPcLG07xxO9
|
3948 |
+
WSMs5uWk99gL7eqQQESolbuT1dCANLZGeA4fAJNG4e7p+exPFwIDAQABo0IwQDAdBgNVHQ4EFgQU
|
3949 |
+
ZT/HiobGPN08VFw1+DrtUgxHV8gwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wDQYJ
|
3950 |
+
KoZIhvcNAQELBQADggEBACo/4fEyjq7hmFxLXs9rHmoJ0iKpEsdeV31zVmSAhHqT5Am5EM2fKifh
|
3951 |
+
AHe+SMg1qIGf5LgsyX8OsNJLN13qudULXjS99HMpw+0mFZx+CFOKWI3QSyjfwbPfIPP54+M638yc
|
3952 |
+
lNhOT8NrF7f3cuitZjO1JVOr4PhMqZ398g26rrnZqsZr+ZO7rqu4lzwDGrpDxpa5RXI4s6ehlj2R
|
3953 |
+
e37AIVNMh+3yC1SVUZPVIqUNivGTDj5UDrDYyU7c8jEyVupk+eq1nRZmQnLzf9OxMUP8pI4X8W0j
|
3954 |
+
q5Rm+K37DwhuJi1/FwcJsoz7UMCflo3Ptv0AnVoUmr8CRPXBwp8iXqIPoeM=
|
3955 |
+
-----END CERTIFICATE-----
|
vendor/composer/installed.json
CHANGED
@@ -1,50 +1,4 @@
|
|
1 |
[
|
2 |
-
{
|
3 |
-
"name": "maxmind/web-service-common",
|
4 |
-
"version": "v0.3.1",
|
5 |
-
"version_normalized": "0.3.1.0",
|
6 |
-
"source": {
|
7 |
-
"type": "git",
|
8 |
-
"url": "https://github.com/maxmind/web-service-common-php.git",
|
9 |
-
"reference": "1fe780bcd6a9038b7e36b13fa0aeeeeca4cdb0a4"
|
10 |
-
},
|
11 |
-
"dist": {
|
12 |
-
"type": "zip",
|
13 |
-
"url": "https://api.github.com/repos/maxmind/web-service-common-php/zipball/1fe780bcd6a9038b7e36b13fa0aeeeeca4cdb0a4",
|
14 |
-
"reference": "1fe780bcd6a9038b7e36b13fa0aeeeeca4cdb0a4",
|
15 |
-
"shasum": ""
|
16 |
-
},
|
17 |
-
"require": {
|
18 |
-
"composer/ca-bundle": "^1.0.3",
|
19 |
-
"ext-curl": "*",
|
20 |
-
"ext-json": "*",
|
21 |
-
"php": ">=5.3"
|
22 |
-
},
|
23 |
-
"require-dev": {
|
24 |
-
"phpunit/phpunit": "4.*",
|
25 |
-
"squizlabs/php_codesniffer": "2.*"
|
26 |
-
},
|
27 |
-
"time": "2016-08-18T16:36:52+00:00",
|
28 |
-
"type": "library",
|
29 |
-
"installation-source": "dist",
|
30 |
-
"autoload": {
|
31 |
-
"psr-4": {
|
32 |
-
"MaxMind\\": "src"
|
33 |
-
}
|
34 |
-
},
|
35 |
-
"notification-url": "https://packagist.org/downloads/",
|
36 |
-
"license": [
|
37 |
-
"Apache-2.0"
|
38 |
-
],
|
39 |
-
"authors": [
|
40 |
-
{
|
41 |
-
"name": "Gregory Oschwald",
|
42 |
-
"email": "goschwald@maxmind.com"
|
43 |
-
}
|
44 |
-
],
|
45 |
-
"description": "Internal MaxMind Web Service API",
|
46 |
-
"homepage": "https://github.com/maxmind/mm-web-service-api-php"
|
47 |
-
},
|
48 |
{
|
49 |
"name": "maxmind-db/reader",
|
50 |
"version": "v1.1.3",
|
@@ -102,31 +56,81 @@
|
|
102 |
"maxmind"
|
103 |
]
|
104 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
105 |
{
|
106 |
"name": "geoip2/geoip2",
|
107 |
-
"version": "v2.
|
108 |
-
"version_normalized": "2.
|
109 |
"source": {
|
110 |
"type": "git",
|
111 |
"url": "https://github.com/maxmind/GeoIP2-php.git",
|
112 |
-
"reference": "
|
113 |
},
|
114 |
"dist": {
|
115 |
"type": "zip",
|
116 |
-
"url": "https://api.github.com/repos/maxmind/GeoIP2-php/zipball/
|
117 |
-
"reference": "
|
118 |
"shasum": ""
|
119 |
},
|
120 |
"require": {
|
121 |
"maxmind-db/reader": "~1.0",
|
122 |
-
"maxmind/web-service-common": "~0.
|
123 |
-
"php": ">=5.
|
124 |
},
|
125 |
"require-dev": {
|
126 |
-
"
|
127 |
-
"
|
|
|
|
|
128 |
},
|
129 |
-
"time": "2017-
|
130 |
"type": "library",
|
131 |
"installation-source": "dist",
|
132 |
"autoload": {
|
@@ -157,17 +161,17 @@
|
|
157 |
},
|
158 |
{
|
159 |
"name": "composer/ca-bundle",
|
160 |
-
"version": "1.0.
|
161 |
-
"version_normalized": "1.0.
|
162 |
"source": {
|
163 |
"type": "git",
|
164 |
"url": "https://github.com/composer/ca-bundle.git",
|
165 |
-
"reference": "
|
166 |
},
|
167 |
"dist": {
|
168 |
"type": "zip",
|
169 |
-
"url": "https://api.github.com/repos/composer/ca-bundle/zipball/
|
170 |
-
"reference": "
|
171 |
"shasum": ""
|
172 |
},
|
173 |
"require": {
|
@@ -183,7 +187,7 @@
|
|
183 |
"suggest": {
|
184 |
"symfony/process": "This is necessary to reliably check whether openssl_x509_parse is vulnerable on older php versions, but can be ignored on PHP 5.5.6+"
|
185 |
},
|
186 |
-
"time": "2017-
|
187 |
"type": "library",
|
188 |
"extra": {
|
189 |
"branch-alias": {
|
1 |
[
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
{
|
3 |
"name": "maxmind-db/reader",
|
4 |
"version": "v1.1.3",
|
56 |
"maxmind"
|
57 |
]
|
58 |
},
|
59 |
+
{
|
60 |
+
"name": "maxmind/web-service-common",
|
61 |
+
"version": "v0.4.0",
|
62 |
+
"version_normalized": "0.4.0.0",
|
63 |
+
"source": {
|
64 |
+
"type": "git",
|
65 |
+
"url": "https://github.com/maxmind/web-service-common-php.git",
|
66 |
+
"reference": "622f7c732a7f9c4c62497fc103939e042b6bdb88"
|
67 |
+
},
|
68 |
+
"dist": {
|
69 |
+
"type": "zip",
|
70 |
+
"url": "https://api.github.com/repos/maxmind/web-service-common-php/zipball/622f7c732a7f9c4c62497fc103939e042b6bdb88",
|
71 |
+
"reference": "622f7c732a7f9c4c62497fc103939e042b6bdb88",
|
72 |
+
"shasum": ""
|
73 |
+
},
|
74 |
+
"require": {
|
75 |
+
"composer/ca-bundle": "^1.0.3",
|
76 |
+
"ext-curl": "*",
|
77 |
+
"ext-json": "*",
|
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": "2017-07-06T17:48:21+00:00",
|
86 |
+
"type": "library",
|
87 |
+
"installation-source": "dist",
|
88 |
+
"autoload": {
|
89 |
+
"psr-4": {
|
90 |
+
"MaxMind\\Exception\\": "src/Exception",
|
91 |
+
"MaxMind\\WebService\\": "src/WebService"
|
92 |
+
}
|
93 |
+
},
|
94 |
+
"notification-url": "https://packagist.org/downloads/",
|
95 |
+
"license": [
|
96 |
+
"Apache-2.0"
|
97 |
+
],
|
98 |
+
"authors": [
|
99 |
+
{
|
100 |
+
"name": "Gregory Oschwald",
|
101 |
+
"email": "goschwald@maxmind.com"
|
102 |
+
}
|
103 |
+
],
|
104 |
+
"description": "Internal MaxMind Web Service API",
|
105 |
+
"homepage": "https://github.com/maxmind/web-service-common-php"
|
106 |
+
},
|
107 |
{
|
108 |
"name": "geoip2/geoip2",
|
109 |
+
"version": "v2.6.0",
|
110 |
+
"version_normalized": "2.6.0.0",
|
111 |
"source": {
|
112 |
"type": "git",
|
113 |
"url": "https://github.com/maxmind/GeoIP2-php.git",
|
114 |
+
"reference": "9f6f1edf9901fed5cd692dd260333bf52091acd3"
|
115 |
},
|
116 |
"dist": {
|
117 |
"type": "zip",
|
118 |
+
"url": "https://api.github.com/repos/maxmind/GeoIP2-php/zipball/9f6f1edf9901fed5cd692dd260333bf52091acd3",
|
119 |
+
"reference": "9f6f1edf9901fed5cd692dd260333bf52091acd3",
|
120 |
"shasum": ""
|
121 |
},
|
122 |
"require": {
|
123 |
"maxmind-db/reader": "~1.0",
|
124 |
+
"maxmind/web-service-common": "~0.4",
|
125 |
+
"php": ">=5.4"
|
126 |
},
|
127 |
"require-dev": {
|
128 |
+
"apigen/apigen": "*",
|
129 |
+
"friendsofphp/php-cs-fixer": "2.*",
|
130 |
+
"phpunit/phpunit": "4.*",
|
131 |
+
"squizlabs/php_codesniffer": "3.*"
|
132 |
},
|
133 |
+
"time": "2017-07-10T17:59:43+00:00",
|
134 |
"type": "library",
|
135 |
"installation-source": "dist",
|
136 |
"autoload": {
|
161 |
},
|
162 |
{
|
163 |
"name": "composer/ca-bundle",
|
164 |
+
"version": "1.0.8",
|
165 |
+
"version_normalized": "1.0.8.0",
|
166 |
"source": {
|
167 |
"type": "git",
|
168 |
"url": "https://github.com/composer/ca-bundle.git",
|
169 |
+
"reference": "9dd73a03951357922d8aee6cc084500de93e2343"
|
170 |
},
|
171 |
"dist": {
|
172 |
"type": "zip",
|
173 |
+
"url": "https://api.github.com/repos/composer/ca-bundle/zipball/9dd73a03951357922d8aee6cc084500de93e2343",
|
174 |
+
"reference": "9dd73a03951357922d8aee6cc084500de93e2343",
|
175 |
"shasum": ""
|
176 |
},
|
177 |
"require": {
|
187 |
"suggest": {
|
188 |
"symfony/process": "This is necessary to reliably check whether openssl_x509_parse is vulnerable on older php versions, but can be ignored on PHP 5.5.6+"
|
189 |
},
|
190 |
+
"time": "2017-09-11T07:24:36+00:00",
|
191 |
"type": "library",
|
192 |
"extra": {
|
193 |
"branch-alias": {
|
vendor/geoip2/geoip2/.php_cs
ADDED
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
return PhpCsFixer\Config::create()
|
4 |
+
->setRiskyAllowed(true)
|
5 |
+
->setRules([
|
6 |
+
'@Symfony' => true,
|
7 |
+
'@Symfony:risky' => true,
|
8 |
+
'array_syntax' => ['syntax' => 'short'],
|
9 |
+
'combine_consecutive_unsets' => true,
|
10 |
+
'concat_space' => [ 'spacing' => 'one'],
|
11 |
+
'heredoc_to_nowdoc' => true,
|
12 |
+
'list_syntax' => ['syntax' => 'long'],
|
13 |
+
'no_extra_consecutive_blank_lines' => ['break', 'continue', 'extra', 'return', 'throw', 'use', 'parenthesis_brace_block', 'square_brace_block', 'curly_brace_block'],
|
14 |
+
'no_short_echo_tag' => true,
|
15 |
+
'no_unreachable_default_argument_value' => true,
|
16 |
+
'no_useless_else' => true,
|
17 |
+
'no_useless_return' => true,
|
18 |
+
'ordered_imports' => true,
|
19 |
+
'pre_increment' => false,
|
20 |
+
'php_unit_strict' => true,
|
21 |
+
'php_unit_test_class_requires_covers' => true,
|
22 |
+
'phpdoc_add_missing_param_annotation' => true,
|
23 |
+
'phpdoc_no_alias_tag' => false,
|
24 |
+
'phpdoc_order' => true,
|
25 |
+
'semicolon_after_instruction' => true,
|
26 |
+
'strict_comparison' => true,
|
27 |
+
'strict_param' => true,
|
28 |
+
])
|
29 |
+
->setFinder(
|
30 |
+
PhpCsFixer\Finder::create()
|
31 |
+
->in(__DIR__)
|
32 |
+
)
|
33 |
+
;
|
vendor/geoip2/geoip2/CHANGELOG.md
CHANGED
@@ -1,6 +1,19 @@
|
|
1 |
CHANGELOG
|
2 |
=========
|
3 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
2.4.5 (2017-01-31)
|
5 |
------------------
|
6 |
|
1 |
CHANGELOG
|
2 |
=========
|
3 |
|
4 |
+
2.6.0 (2017-07-10)
|
5 |
+
-----------------
|
6 |
+
|
7 |
+
* Code clean-up and tidying.
|
8 |
+
* Set minimum required PHP version to 5.4 in `composer.json`. Previously,
|
9 |
+
5.3 would work but was not tested. Now 5.4 is hard minimum version.
|
10 |
+
|
11 |
+
2.5.0 (2017-05-08)
|
12 |
+
------------------
|
13 |
+
|
14 |
+
* Support for PHP 5.3 was dropped.
|
15 |
+
* Added support for GeoLite2 ASN database.
|
16 |
+
|
17 |
2.4.5 (2017-01-31)
|
18 |
------------------
|
19 |
|
vendor/geoip2/geoip2/README.md
CHANGED
@@ -46,10 +46,31 @@ require 'vendor/autoload.php';
|
|
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
|
50 |
dependencies for GeoIP2. Our latest phar archive is available on
|
51 |
[our releases page](https://github.com/maxmind/GeoIP2-php/releases).
|
52 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
53 |
To use the archive, just require it from your script:
|
54 |
|
55 |
```php
|
@@ -203,7 +224,7 @@ print($record->city->name . "\n"); // 'Minneapolis'
|
|
203 |
|
204 |
print($record->postal->code . "\n"); // '55455'
|
205 |
|
206 |
-
print($record->location->
|
207 |
print($record->location->latitude . "\n"); // 44.9733
|
208 |
print($record->location->longitude . "\n"); // -93.2323
|
209 |
|
@@ -355,14 +376,11 @@ to the client API, please see
|
|
355 |
|
356 |
## Requirements ##
|
357 |
|
358 |
-
This
|
359 |
-
|
360 |
|
361 |
This library also relies on the [MaxMind DB Reader](https://github.com/maxmind/MaxMind-DB-Reader-php).
|
362 |
|
363 |
-
If you are using PHP 5.3 with an autoloader besides Composer, you must load
|
364 |
-
`JsonSerializable.php` in the `compat` directory.
|
365 |
-
|
366 |
## Contributing ##
|
367 |
|
368 |
Patches and pull requests are encouraged. All code should follow the PSR-2
|
@@ -377,7 +395,7 @@ The GeoIP2 PHP API uses [Semantic Versioning](http://semver.org/).
|
|
377 |
|
378 |
## Copyright and License ##
|
379 |
|
380 |
-
This software is Copyright (c) 2013-
|
381 |
|
382 |
This is free software, licensed under the Apache License, Version 2.0.
|
383 |
|
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
|
64 |
+
extension you may need to restart your web server.
|
65 |
+
|
66 |
+
If you are missing this extension, you will see errors like the following:
|
67 |
+
|
68 |
+
```
|
69 |
+
PHP Fatal error: Uncaught Error: Call to undefined function MaxMind\WebService\curl_version()
|
70 |
+
```
|
71 |
+
|
72 |
+
### Require Package ###
|
73 |
+
|
74 |
To use the archive, just require it from your script:
|
75 |
|
76 |
```php
|
224 |
|
225 |
print($record->postal->code . "\n"); // '55455'
|
226 |
|
227 |
+
print($record->location->accuracyRadius . "\n"); // 50
|
228 |
print($record->location->latitude . "\n"); // 44.9733
|
229 |
print($record->location->longitude . "\n"); // -93.2323
|
230 |
|
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 |
|
|
|
|
|
|
|
384 |
## Contributing ##
|
385 |
|
386 |
Patches and pull requests are encouraged. All code should follow the PSR-2
|
395 |
|
396 |
## Copyright and License ##
|
397 |
|
398 |
+
This software is Copyright (c) 2013-2017 by MaxMind, Inc.
|
399 |
|
400 |
This is free software, licensed under the Apache License, Version 2.0.
|
401 |
|
vendor/geoip2/geoip2/composer.json
CHANGED
@@ -14,12 +14,14 @@
|
|
14 |
],
|
15 |
"require": {
|
16 |
"maxmind-db/reader": "~1.0",
|
17 |
-
"maxmind/web-service-common": "~0.
|
18 |
-
"php": ">=5.
|
19 |
},
|
20 |
"require-dev": {
|
21 |
-
"
|
22 |
-
"
|
|
|
|
|
23 |
},
|
24 |
"autoload": {
|
25 |
"psr-4": {
|
14 |
],
|
15 |
"require": {
|
16 |
"maxmind-db/reader": "~1.0",
|
17 |
+
"maxmind/web-service-common": "~0.4",
|
18 |
+
"php": ">=5.4"
|
19 |
},
|
20 |
"require-dev": {
|
21 |
+
"friendsofphp/php-cs-fixer": "2.*",
|
22 |
+
"phpunit/phpunit": "4.*",
|
23 |
+
"squizlabs/php_codesniffer": "3.*",
|
24 |
+
"apigen/apigen": "*"
|
25 |
},
|
26 |
"autoload": {
|
27 |
"psr-4": {
|
vendor/geoip2/geoip2/src/Database/Reader.php
CHANGED
@@ -30,7 +30,6 @@ use MaxMind\Db\Reader\InvalidDatabaseException;
|
|
30 |
* SPL {@link \InvalidArgumentException} will be thrown. If the database is
|
31 |
* corrupt or invalid, a {@link \MaxMind\Db\Reader\InvalidDatabaseException}
|
32 |
* will be thrown.
|
33 |
-
*
|
34 |
*/
|
35 |
class Reader implements ProviderInterface
|
36 |
{
|
@@ -40,15 +39,16 @@ class Reader implements ProviderInterface
|
|
40 |
/**
|
41 |
* Constructor.
|
42 |
*
|
43 |
-
* @param string $filename
|
44 |
-
* @param array
|
45 |
-
*
|
|
|
46 |
* @throws \MaxMind\Db\Reader\InvalidDatabaseException if the database
|
47 |
-
*
|
48 |
*/
|
49 |
public function __construct(
|
50 |
$filename,
|
51 |
-
$locales =
|
52 |
) {
|
53 |
$this->dbReader = new DbReader($filename);
|
54 |
$this->locales = $locales;
|
@@ -57,14 +57,14 @@ class Reader implements ProviderInterface
|
|
57 |
/**
|
58 |
* This method returns a GeoIP2 City model.
|
59 |
*
|
60 |
-
* @param string $ipAddress IPv4 or IPv6 address as a string
|
61 |
-
*
|
62 |
-
* @return \GeoIp2\Model\City
|
63 |
*
|
64 |
-
* @throws \GeoIp2\Exception\AddressNotFoundException
|
65 |
-
*
|
66 |
* @throws \MaxMind\Db\Reader\InvalidDatabaseException if the database
|
67 |
-
*
|
|
|
|
|
68 |
*/
|
69 |
public function city($ipAddress)
|
70 |
{
|
@@ -74,14 +74,14 @@ class Reader implements ProviderInterface
|
|
74 |
/**
|
75 |
* This method returns a GeoIP2 Country model.
|
76 |
*
|
77 |
-
* @param string $ipAddress IPv4 or IPv6 address as a string
|
78 |
*
|
79 |
-
* @
|
80 |
-
*
|
81 |
-
* @throws \GeoIp2\Exception\AddressNotFoundException if the address is
|
82 |
-
* not in the database.
|
83 |
* @throws \MaxMind\Db\Reader\InvalidDatabaseException if the database
|
84 |
-
*
|
|
|
|
|
85 |
*/
|
86 |
public function country($ipAddress)
|
87 |
{
|
@@ -91,14 +91,14 @@ class Reader implements ProviderInterface
|
|
91 |
/**
|
92 |
* This method returns a GeoIP2 Anonymous IP model.
|
93 |
*
|
94 |
-
* @param string $ipAddress IPv4 or IPv6 address as a string
|
95 |
-
*
|
96 |
-
* @return \GeoIp2\Model\AnonymousIp
|
97 |
*
|
98 |
-
* @throws \GeoIp2\Exception\AddressNotFoundException
|
99 |
-
*
|
100 |
* @throws \MaxMind\Db\Reader\InvalidDatabaseException if the database
|
101 |
-
*
|
|
|
|
|
102 |
*/
|
103 |
public function anonymousIp($ipAddress)
|
104 |
{
|
@@ -110,16 +110,37 @@ class Reader implements ProviderInterface
|
|
110 |
}
|
111 |
|
112 |
/**
|
113 |
-
* This method returns a
|
114 |
*
|
115 |
-
* @param string $ipAddress IPv4 or IPv6 address as a string
|
116 |
*
|
117 |
-
* @
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
118 |
*
|
119 |
-
* @throws \GeoIp2\Exception\AddressNotFoundException
|
120 |
-
*
|
121 |
* @throws \MaxMind\Db\Reader\InvalidDatabaseException if the database
|
122 |
-
*
|
|
|
|
|
123 |
*/
|
124 |
public function connectionType($ipAddress)
|
125 |
{
|
@@ -133,14 +154,14 @@ class Reader implements ProviderInterface
|
|
133 |
/**
|
134 |
* This method returns a GeoIP2 Domain model.
|
135 |
*
|
136 |
-
* @param string $ipAddress IPv4 or IPv6 address as a string
|
137 |
*
|
138 |
-
* @
|
139 |
-
*
|
140 |
-
* @throws \GeoIp2\Exception\AddressNotFoundException if the address is
|
141 |
-
* not in the database.
|
142 |
* @throws \MaxMind\Db\Reader\InvalidDatabaseException if the database
|
143 |
-
*
|
|
|
|
|
144 |
*/
|
145 |
public function domain($ipAddress)
|
146 |
{
|
@@ -154,14 +175,14 @@ class Reader implements ProviderInterface
|
|
154 |
/**
|
155 |
* This method returns a GeoIP2 Enterprise model.
|
156 |
*
|
157 |
-
* @param string $ipAddress IPv4 or IPv6 address as a string
|
158 |
-
*
|
159 |
-
* @return \GeoIp2\Model\Enterprise
|
160 |
*
|
161 |
-
* @throws \GeoIp2\Exception\AddressNotFoundException
|
162 |
-
*
|
163 |
* @throws \MaxMind\Db\Reader\InvalidDatabaseException if the database
|
164 |
-
*
|
|
|
|
|
165 |
*/
|
166 |
public function enterprise($ipAddress)
|
167 |
{
|
@@ -171,14 +192,14 @@ class Reader implements ProviderInterface
|
|
171 |
/**
|
172 |
* This method returns a GeoIP2 ISP model.
|
173 |
*
|
174 |
-
* @param string $ipAddress IPv4 or IPv6 address as a string
|
175 |
*
|
176 |
-
* @
|
177 |
-
*
|
178 |
-
* @throws \GeoIp2\Exception\AddressNotFoundException if the address is
|
179 |
-
* not in the database.
|
180 |
* @throws \MaxMind\Db\Reader\InvalidDatabaseException if the database
|
181 |
-
*
|
|
|
|
|
182 |
*/
|
183 |
public function isp($ipAddress)
|
184 |
{
|
@@ -194,7 +215,7 @@ class Reader implements ProviderInterface
|
|
194 |
$record = $this->getRecord($class, $type, $ipAddress);
|
195 |
|
196 |
$record['traits']['ip_address'] = $ipAddress;
|
197 |
-
$class =
|
198 |
|
199 |
return new $class($record, $this->locales);
|
200 |
}
|
@@ -204,7 +225,7 @@ class Reader implements ProviderInterface
|
|
204 |
$record = $this->getRecord($class, $type, $ipAddress);
|
205 |
|
206 |
$record['ip_address'] = $ipAddress;
|
207 |
-
$class =
|
208 |
|
209 |
return new $class($record);
|
210 |
}
|
@@ -215,7 +236,7 @@ class Reader implements ProviderInterface
|
|
215 |
$method = lcfirst($class);
|
216 |
throw new \BadMethodCallException(
|
217 |
"The $method method cannot be used to open a "
|
218 |
-
. $this->metadata()->databaseType .
|
219 |
);
|
220 |
}
|
221 |
$record = $this->dbReader->get($ipAddress);
|
@@ -237,13 +258,15 @@ class Reader implements ProviderInterface
|
|
237 |
. gettype($record)
|
238 |
);
|
239 |
}
|
|
|
240 |
return $record;
|
241 |
}
|
242 |
|
243 |
/**
|
244 |
-
* @throws \InvalidArgumentException if arguments are passed to the method
|
245 |
-
* @throws \BadMethodCallException
|
246 |
-
*
|
|
|
247 |
*/
|
248 |
public function metadata()
|
249 |
{
|
30 |
* SPL {@link \InvalidArgumentException} will be thrown. If the database is
|
31 |
* corrupt or invalid, a {@link \MaxMind\Db\Reader\InvalidDatabaseException}
|
32 |
* will be thrown.
|
|
|
33 |
*/
|
34 |
class Reader implements ProviderInterface
|
35 |
{
|
39 |
/**
|
40 |
* Constructor.
|
41 |
*
|
42 |
+
* @param string $filename the path to the GeoIP2 database file
|
43 |
+
* @param array $locales list of locale codes to use in name property
|
44 |
+
* from most preferred to least preferred
|
45 |
+
*
|
46 |
* @throws \MaxMind\Db\Reader\InvalidDatabaseException if the database
|
47 |
+
* is corrupt or invalid
|
48 |
*/
|
49 |
public function __construct(
|
50 |
$filename,
|
51 |
+
$locales = ['en']
|
52 |
) {
|
53 |
$this->dbReader = new DbReader($filename);
|
54 |
$this->locales = $locales;
|
57 |
/**
|
58 |
* This method returns a GeoIP2 City model.
|
59 |
*
|
60 |
+
* @param string $ipAddress an IPv4 or IPv6 address as a string
|
|
|
|
|
61 |
*
|
62 |
+
* @throws \GeoIp2\Exception\AddressNotFoundException if the address is
|
63 |
+
* not in the database
|
64 |
* @throws \MaxMind\Db\Reader\InvalidDatabaseException if the database
|
65 |
+
* is corrupt or invalid
|
66 |
+
*
|
67 |
+
* @return \GeoIp2\Model\City
|
68 |
*/
|
69 |
public function city($ipAddress)
|
70 |
{
|
74 |
/**
|
75 |
* This method returns a GeoIP2 Country model.
|
76 |
*
|
77 |
+
* @param string $ipAddress an IPv4 or IPv6 address as a string
|
78 |
*
|
79 |
+
* @throws \GeoIp2\Exception\AddressNotFoundException if the address is
|
80 |
+
* not in the database
|
|
|
|
|
81 |
* @throws \MaxMind\Db\Reader\InvalidDatabaseException if the database
|
82 |
+
* is corrupt or invalid
|
83 |
+
*
|
84 |
+
* @return \GeoIp2\Model\Country
|
85 |
*/
|
86 |
public function country($ipAddress)
|
87 |
{
|
91 |
/**
|
92 |
* This method returns a GeoIP2 Anonymous IP model.
|
93 |
*
|
94 |
+
* @param string $ipAddress an IPv4 or IPv6 address as a string
|
|
|
|
|
95 |
*
|
96 |
+
* @throws \GeoIp2\Exception\AddressNotFoundException if the address is
|
97 |
+
* not in the database
|
98 |
* @throws \MaxMind\Db\Reader\InvalidDatabaseException if the database
|
99 |
+
* is corrupt or invalid
|
100 |
+
*
|
101 |
+
* @return \GeoIp2\Model\AnonymousIp
|
102 |
*/
|
103 |
public function anonymousIp($ipAddress)
|
104 |
{
|
110 |
}
|
111 |
|
112 |
/**
|
113 |
+
* This method returns a GeoLite2 ASN model.
|
114 |
*
|
115 |
+
* @param string $ipAddress an IPv4 or IPv6 address as a string
|
116 |
*
|
117 |
+
* @throws \GeoIp2\Exception\AddressNotFoundException if the address is
|
118 |
+
* not in the database
|
119 |
+
* @throws \MaxMind\Db\Reader\InvalidDatabaseException if the database
|
120 |
+
* is corrupt or invalid
|
121 |
+
*
|
122 |
+
* @return \GeoIp2\Model\Asn
|
123 |
+
*/
|
124 |
+
public function asn($ipAddress)
|
125 |
+
{
|
126 |
+
return $this->flatModelFor(
|
127 |
+
'Asn',
|
128 |
+
'GeoLite2-ASN',
|
129 |
+
$ipAddress
|
130 |
+
);
|
131 |
+
}
|
132 |
+
|
133 |
+
/**
|
134 |
+
* This method returns a GeoIP2 Connection Type model.
|
135 |
+
*
|
136 |
+
* @param string $ipAddress an IPv4 or IPv6 address as a string
|
137 |
*
|
138 |
+
* @throws \GeoIp2\Exception\AddressNotFoundException if the address is
|
139 |
+
* not in the database
|
140 |
* @throws \MaxMind\Db\Reader\InvalidDatabaseException if the database
|
141 |
+
* is corrupt or invalid
|
142 |
+
*
|
143 |
+
* @return \GeoIp2\Model\ConnectionType
|
144 |
*/
|
145 |
public function connectionType($ipAddress)
|
146 |
{
|
154 |
/**
|
155 |
* This method returns a GeoIP2 Domain model.
|
156 |
*
|
157 |
+
* @param string $ipAddress an IPv4 or IPv6 address as a string
|
158 |
*
|
159 |
+
* @throws \GeoIp2\Exception\AddressNotFoundException if the address is
|
160 |
+
* not in the database
|
|
|
|
|
161 |
* @throws \MaxMind\Db\Reader\InvalidDatabaseException if the database
|
162 |
+
* is corrupt or invalid
|
163 |
+
*
|
164 |
+
* @return \GeoIp2\Model\Domain
|
165 |
*/
|
166 |
public function domain($ipAddress)
|
167 |
{
|
175 |
/**
|
176 |
* This method returns a GeoIP2 Enterprise model.
|
177 |
*
|
178 |
+
* @param string $ipAddress an IPv4 or IPv6 address as a string
|
|
|
|
|
179 |
*
|
180 |
+
* @throws \GeoIp2\Exception\AddressNotFoundException if the address is
|
181 |
+
* not in the database
|
182 |
* @throws \MaxMind\Db\Reader\InvalidDatabaseException if the database
|
183 |
+
* is corrupt or invalid
|
184 |
+
*
|
185 |
+
* @return \GeoIp2\Model\Enterprise
|
186 |
*/
|
187 |
public function enterprise($ipAddress)
|
188 |
{
|
192 |
/**
|
193 |
* This method returns a GeoIP2 ISP model.
|
194 |
*
|
195 |
+
* @param string $ipAddress an IPv4 or IPv6 address as a string
|
196 |
*
|
197 |
+
* @throws \GeoIp2\Exception\AddressNotFoundException if the address is
|
198 |
+
* not in the database
|
|
|
|
|
199 |
* @throws \MaxMind\Db\Reader\InvalidDatabaseException if the database
|
200 |
+
* is corrupt or invalid
|
201 |
+
*
|
202 |
+
* @return \GeoIp2\Model\Isp
|
203 |
*/
|
204 |
public function isp($ipAddress)
|
205 |
{
|
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);
|
221 |
}
|
225 |
$record = $this->getRecord($class, $type, $ipAddress);
|
226 |
|
227 |
$record['ip_address'] = $ipAddress;
|
228 |
+
$class = 'GeoIp2\\Model\\' . $class;
|
229 |
|
230 |
return new $class($record);
|
231 |
}
|
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);
|
258 |
. gettype($record)
|
259 |
);
|
260 |
}
|
261 |
+
|
262 |
return $record;
|
263 |
}
|
264 |
|
265 |
/**
|
266 |
+
* @throws \InvalidArgumentException if arguments are passed to the method
|
267 |
+
* @throws \BadMethodCallException if the database has been closed
|
268 |
+
*
|
269 |
+
* @return \MaxMind\Db\Reader\Metadata object for the database
|
270 |
*/
|
271 |
public function metadata()
|
272 |
{
|
vendor/geoip2/geoip2/src/Exception/HttpException.php
CHANGED
@@ -5,11 +5,10 @@ namespace GeoIp2\Exception;
|
|
5 |
/**
|
6 |
* This class represents an HTTP transport error.
|
7 |
*/
|
8 |
-
|
9 |
class HttpException extends GeoIp2Exception
|
10 |
{
|
11 |
/**
|
12 |
-
* The URI queried
|
13 |
*/
|
14 |
public $uri;
|
15 |
|
5 |
/**
|
6 |
* This class represents an HTTP transport error.
|
7 |
*/
|
|
|
8 |
class HttpException extends GeoIp2Exception
|
9 |
{
|
10 |
/**
|
11 |
+
* The URI queried.
|
12 |
*/
|
13 |
public $uri;
|
14 |
|
vendor/geoip2/geoip2/src/Exception/InvalidRequestException.php
CHANGED
@@ -9,7 +9,7 @@ namespace GeoIp2\Exception;
|
|
9 |
class InvalidRequestException extends HttpException
|
10 |
{
|
11 |
/**
|
12 |
-
* The code returned by the MaxMind web service
|
13 |
*/
|
14 |
public $error;
|
15 |
|
9 |
class InvalidRequestException extends HttpException
|
10 |
{
|
11 |
/**
|
12 |
+
* The code returned by the MaxMind web service.
|
13 |
*/
|
14 |
public $error;
|
15 |
|
vendor/geoip2/geoip2/src/Model/AbstractModel.php
CHANGED
@@ -2,17 +2,17 @@
|
|
2 |
|
3 |
namespace GeoIp2\Model;
|
4 |
|
5 |
-
use GeoIp2\Compat\JsonSerializable;
|
6 |
-
|
7 |
/**
|
8 |
* @ignore
|
9 |
*/
|
10 |
-
abstract class AbstractModel implements JsonSerializable
|
11 |
{
|
12 |
protected $raw;
|
13 |
|
14 |
/**
|
15 |
* @ignore
|
|
|
|
|
16 |
*/
|
17 |
public function __construct($raw)
|
18 |
{
|
@@ -21,26 +21,29 @@ abstract class AbstractModel implements JsonSerializable
|
|
21 |
|
22 |
/**
|
23 |
* @ignore
|
|
|
|
|
24 |
*/
|
25 |
protected function get($field)
|
26 |
{
|
27 |
if (isset($this->raw[$field])) {
|
28 |
return $this->raw[$field];
|
29 |
-
} else {
|
30 |
-
if (preg_match('/^is_/', $field)) {
|
31 |
-
return false;
|
32 |
-
} else {
|
33 |
-
return null;
|
34 |
-
}
|
35 |
}
|
|
|
|
|
|
|
|
|
|
|
36 |
}
|
37 |
|
38 |
/**
|
39 |
* @ignore
|
|
|
|
|
40 |
*/
|
41 |
public function __get($attr)
|
42 |
{
|
43 |
-
if ($attr
|
44 |
return $this->$attr;
|
45 |
}
|
46 |
|
@@ -49,10 +52,12 @@ abstract class AbstractModel implements JsonSerializable
|
|
49 |
|
50 |
/**
|
51 |
* @ignore
|
|
|
|
|
52 |
*/
|
53 |
public function __isset($attr)
|
54 |
{
|
55 |
-
return $attr
|
56 |
}
|
57 |
|
58 |
public function jsonSerialize()
|
2 |
|
3 |
namespace GeoIp2\Model;
|
4 |
|
|
|
|
|
5 |
/**
|
6 |
* @ignore
|
7 |
*/
|
8 |
+
abstract class AbstractModel implements \JsonSerializable
|
9 |
{
|
10 |
protected $raw;
|
11 |
|
12 |
/**
|
13 |
* @ignore
|
14 |
+
*
|
15 |
+
* @param mixed $raw
|
16 |
*/
|
17 |
public function __construct($raw)
|
18 |
{
|
21 |
|
22 |
/**
|
23 |
* @ignore
|
24 |
+
*
|
25 |
+
* @param mixed $field
|
26 |
*/
|
27 |
protected function get($field)
|
28 |
{
|
29 |
if (isset($this->raw[$field])) {
|
30 |
return $this->raw[$field];
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
}
|
32 |
+
if (preg_match('/^is_/', $field)) {
|
33 |
+
return false;
|
34 |
+
}
|
35 |
+
|
36 |
+
return null;
|
37 |
}
|
38 |
|
39 |
/**
|
40 |
* @ignore
|
41 |
+
*
|
42 |
+
* @param mixed $attr
|
43 |
*/
|
44 |
public function __get($attr)
|
45 |
{
|
46 |
+
if ($attr !== 'instance' && property_exists($this, $attr)) {
|
47 |
return $this->$attr;
|
48 |
}
|
49 |
|
52 |
|
53 |
/**
|
54 |
* @ignore
|
55 |
+
*
|
56 |
+
* @param mixed $attr
|
57 |
*/
|
58 |
public function __isset($attr)
|
59 |
{
|
60 |
+
return $attr !== 'instance' && isset($this->$attr);
|
61 |
}
|
62 |
|
63 |
public function jsonSerialize()
|
vendor/geoip2/geoip2/src/Model/AnonymousIp.php
CHANGED
@@ -5,24 +5,18 @@ namespace GeoIp2\Model;
|
|
5 |
/**
|
6 |
* This class provides the GeoIP2 Anonymous IP model.
|
7 |
*
|
8 |
-
* @property-read
|
9 |
* any sort of anonymous network.
|
10 |
-
*
|
11 |
-
* @property-read boolean $isAnonymousVpn This is true if the IP address belongs to
|
12 |
* an anonymous VPN system.
|
13 |
-
*
|
14 |
-
* @property-read boolean $isHostingProvider This is true if the IP address belongs
|
15 |
* to a hosting provider.
|
16 |
-
*
|
17 |
-
* @property-read boolean $isPublicProxy This is true if the IP address belongs to
|
18 |
* a public proxy.
|
19 |
-
*
|
20 |
-
* @property-read boolean $isTorExitNode This is true if the IP address is a Tor
|
21 |
* exit node.
|
22 |
-
*
|
23 |
* @property-read string $ipAddress The IP address that the data in the model is
|
24 |
* for.
|
25 |
-
*
|
26 |
*/
|
27 |
class AnonymousIp extends AbstractModel
|
28 |
{
|
@@ -35,6 +29,8 @@ class AnonymousIp extends AbstractModel
|
|
35 |
|
36 |
/**
|
37 |
* @ignore
|
|
|
|
|
38 |
*/
|
39 |
public function __construct($raw)
|
40 |
{
|
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 |
{
|
29 |
|
30 |
/**
|
31 |
* @ignore
|
32 |
+
*
|
33 |
+
* @param mixed $raw
|
34 |
*/
|
35 |
public function __construct($raw)
|
36 |
{
|
vendor/geoip2/geoip2/src/Model/Asn.php
ADDED
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace GeoIp2\Model;
|
4 |
+
|
5 |
+
/**
|
6 |
+
* This class provides the GeoLite2 ASN model.
|
7 |
+
*
|
8 |
+
* @property-read int|null $autonomousSystemNumber The autonomous system number
|
9 |
+
* associated with the IP address.
|
10 |
+
* @property-read string|null $autonomousSystemOrganization The organization
|
11 |
+
* associated with the registered autonomous system number for the IP
|
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
|
24 |
+
*
|
25 |
+
* @param mixed $raw
|
26 |
+
*/
|
27 |
+
public function __construct($raw)
|
28 |
+
{
|
29 |
+
parent::__construct($raw);
|
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
@@ -11,33 +11,25 @@ namespace GeoIp2\Model;
|
|
11 |
*
|
12 |
* @property-read \GeoIp2\Record\City $city City data for the requested IP
|
13 |
* address.
|
14 |
-
*
|
15 |
* @property-read \GeoIp2\Record\Continent $continent Continent data for the
|
16 |
* requested IP address.
|
17 |
-
*
|
18 |
* @property-read \GeoIp2\Record\Country $country Country data for the requested
|
19 |
* IP address. This object represents the country where MaxMind believes the
|
20 |
* end user is located.
|
21 |
-
*
|
22 |
* @property-read \GeoIp2\Record\Location $location Location data for the
|
23 |
* requested IP address.
|
24 |
-
*
|
25 |
* @property-read \GeoIp2\Record\Postal $postal Postal data for the
|
26 |
* requested IP address.
|
27 |
-
*
|
28 |
* @property-read \GeoIp2\Record\MaxMind $maxmind Data related to your MaxMind
|
29 |
* account.
|
30 |
-
*
|
31 |
* @property-read \GeoIp2\Record\Country $registeredCountry Registered country
|
32 |
* data for the requested IP address. This record represents the country
|
33 |
* where the ISP has registered a given IP block and may differ from the
|
34 |
* user's country.
|
35 |
-
*
|
36 |
* @property-read \GeoIp2\Record\RepresentedCountry $representedCountry
|
37 |
* Represented country data for the requested IP address. The represented
|
38 |
* country is used for things like military bases. It is only present when
|
39 |
* the represented country differs from the country.
|
40 |
-
*
|
41 |
* @property-read array $subdivisions An array of {@link \GeoIp2\Record\Subdivision}
|
42 |
* objects representing the country subdivisions for the requested IP
|
43 |
* address. The number and type of subdivisions varies by country, but a
|
@@ -45,12 +37,10 @@ namespace GeoIp2\Model;
|
|
45 |
* are ordered from most general (largest) to most specific (smallest).
|
46 |
* If the response did not contain any subdivisions, this method returns
|
47 |
* an empty array.
|
48 |
-
*
|
49 |
* @property-read \GeoIp2\Record\Subdivision $mostSpecificSubdivision An object
|
50 |
* representing the most specific subdivision returned. If the response
|
51 |
* did not contain any subdivisions, this method returns an empty
|
52 |
* {@link \GeoIp2\Record\Subdivision} object.
|
53 |
-
*
|
54 |
* @property-read \GeoIp2\Record\Traits $traits Data for the traits of the
|
55 |
* requested IP address.
|
56 |
*/
|
@@ -71,12 +61,15 @@ class City extends Country
|
|
71 |
/**
|
72 |
* @ignore
|
73 |
*/
|
74 |
-
protected $subdivisions =
|
75 |
|
76 |
/**
|
77 |
* @ignore
|
|
|
|
|
|
|
78 |
*/
|
79 |
-
public function __construct($raw, $locales =
|
80 |
{
|
81 |
parent::__construct($raw, $locales);
|
82 |
|
@@ -103,34 +96,38 @@ class City extends Country
|
|
103 |
|
104 |
/**
|
105 |
* @ignore
|
|
|
|
|
106 |
*/
|
107 |
public function __get($attr)
|
108 |
{
|
109 |
-
if ($attr
|
110 |
return $this->$attr();
|
111 |
-
} else {
|
112 |
-
return parent::__get($attr);
|
113 |
}
|
|
|
|
|
114 |
}
|
115 |
|
116 |
/**
|
117 |
* @ignore
|
|
|
|
|
118 |
*/
|
119 |
public function __isset($attr)
|
120 |
{
|
121 |
-
if ($attr
|
122 |
// We always return a mostSpecificSubdivision, even if it is the
|
123 |
// empty subdivision
|
124 |
return true;
|
125 |
-
} else {
|
126 |
-
return parent::__isset($attr);
|
127 |
}
|
|
|
|
|
128 |
}
|
129 |
|
130 |
private function mostSpecificSubdivision()
|
131 |
{
|
132 |
return empty($this->subdivisions) ?
|
133 |
-
new \GeoIp2\Record\Subdivision(
|
134 |
end($this->subdivisions);
|
135 |
}
|
136 |
}
|
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
|
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 |
*/
|
61 |
/**
|
62 |
* @ignore
|
63 |
*/
|
64 |
+
protected $subdivisions = [];
|
65 |
|
66 |
/**
|
67 |
* @ignore
|
68 |
+
*
|
69 |
+
* @param mixed $raw
|
70 |
+
* @param mixed $locales
|
71 |
*/
|
72 |
+
public function __construct($raw, $locales = ['en'])
|
73 |
{
|
74 |
parent::__construct($raw, $locales);
|
75 |
|
96 |
|
97 |
/**
|
98 |
* @ignore
|
99 |
+
*
|
100 |
+
* @param mixed $attr
|
101 |
*/
|
102 |
public function __get($attr)
|
103 |
{
|
104 |
+
if ($attr === 'mostSpecificSubdivision') {
|
105 |
return $this->$attr();
|
|
|
|
|
106 |
}
|
107 |
+
|
108 |
+
return parent::__get($attr);
|
109 |
}
|
110 |
|
111 |
/**
|
112 |
* @ignore
|
113 |
+
*
|
114 |
+
* @param mixed $attr
|
115 |
*/
|
116 |
public function __isset($attr)
|
117 |
{
|
118 |
+
if ($attr === 'mostSpecificSubdivision') {
|
119 |
// We always return a mostSpecificSubdivision, even if it is the
|
120 |
// empty subdivision
|
121 |
return true;
|
|
|
|
|
122 |
}
|
123 |
+
|
124 |
+
return parent::__isset($attr);
|
125 |
}
|
126 |
|
127 |
private function mostSpecificSubdivision()
|
128 |
{
|
129 |
return empty($this->subdivisions) ?
|
130 |
+
new \GeoIp2\Record\Subdivision([], $this->locales) :
|
131 |
end($this->subdivisions);
|
132 |
}
|
133 |
}
|
vendor/geoip2/geoip2/src/Model/ConnectionType.php
CHANGED
@@ -8,10 +8,8 @@ namespace GeoIp2\Model;
|
|
8 |
* @property-read string|null $connectionType The connection type may take the
|
9 |
* following values: "Dialup", "Cable/DSL", "Corporate", "Cellular".
|
10 |
* Additional values may be added in the future.
|
11 |
-
*
|
12 |
* @property-read string $ipAddress The IP address that the data in the model is
|
13 |
* for.
|
14 |
-
*
|
15 |
*/
|
16 |
class ConnectionType extends AbstractModel
|
17 |
{
|
@@ -20,6 +18,8 @@ class ConnectionType extends AbstractModel
|
|
20 |
|
21 |
/**
|
22 |
* @ignore
|
|
|
|
|
23 |
*/
|
24 |
public function __construct($raw)
|
25 |
{
|
8 |
* @property-read string|null $connectionType The connection type may take the
|
9 |
* following values: "Dialup", "Cable/DSL", "Corporate", "Cellular".
|
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 |
{
|
18 |
|
19 |
/**
|
20 |
* @ignore
|
21 |
+
*
|
22 |
+
* @param mixed $raw
|
23 |
*/
|
24 |
public function __construct($raw)
|
25 |
{
|
vendor/geoip2/geoip2/src/Model/Country.php
CHANGED
@@ -11,24 +11,19 @@ namespace GeoIp2\Model;
|
|
11 |
*
|
12 |
* @property-read \GeoIp2\Record\Continent $continent Continent data for the
|
13 |
* requested IP address.
|
14 |
-
*
|
15 |
* @property-read \GeoIp2\Record\Country $country Country data for the requested
|
16 |
* IP address. This object represents the country where MaxMind believes the
|
17 |
* end user is located.
|
18 |
-
*
|
19 |
* @property-read \GeoIp2\Record\MaxMind $maxmind Data related to your MaxMind
|
20 |
* account.
|
21 |
-
*
|
22 |
* @property-read \GeoIp2\Record\Country $registeredCountry Registered country
|
23 |
* data for the requested IP address. This record represents the country
|
24 |
* where the ISP has registered a given IP block and may differ from the
|
25 |
* user's country.
|
26 |
-
*
|
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 |
-
*
|
32 |
* @property-read \GeoIp2\Record\Traits $traits Data for the traits of the
|
33 |
* requested IP address.
|
34 |
*/
|
@@ -44,8 +39,11 @@ class Country extends AbstractModel
|
|
44 |
|
45 |
/**
|
46 |
* @ignore
|
|
|
|
|
|
|
47 |
*/
|
48 |
-
public function __construct($raw, $locales =
|
49 |
{
|
50 |
parent::__construct($raw);
|
51 |
|
11 |
*
|
12 |
* @property-read \GeoIp2\Record\Continent $continent Continent data for the
|
13 |
* requested IP address.
|
|
|
14 |
* @property-read \GeoIp2\Record\Country $country Country data for the requested
|
15 |
* IP address. This object represents the country where MaxMind believes the
|
16 |
* end user is located.
|
|
|
17 |
* @property-read \GeoIp2\Record\MaxMind $maxmind Data related to your MaxMind
|
18 |
* account.
|
|
|
19 |
* @property-read \GeoIp2\Record\Country $registeredCountry Registered country
|
20 |
* data for the requested IP address. This record represents the country
|
21 |
* where the ISP has registered a given IP block and may differ from the
|
22 |
* user's country.
|
|
|
23 |
* @property-read \GeoIp2\Record\RepresentedCountry $representedCountry
|
24 |
* Represented country data for the requested IP address. The represented
|
25 |
* country is used for things like military bases. It is only present when
|
26 |
* the represented country differs from the country.
|
|
|
27 |
* @property-read \GeoIp2\Record\Traits $traits Data for the traits of the
|
28 |
* requested IP address.
|
29 |
*/
|
39 |
|
40 |
/**
|
41 |
* @ignore
|
42 |
+
*
|
43 |
+
* @param mixed $raw
|
44 |
+
* @param mixed $locales
|
45 |
*/
|
46 |
+
public function __construct($raw, $locales = ['en'])
|
47 |
{
|
48 |
parent::__construct($raw);
|
49 |
|
vendor/geoip2/geoip2/src/Model/Domain.php
CHANGED
@@ -8,10 +8,8 @@ namespace GeoIp2\Model;
|
|
8 |
* @property-read string|null $domain The second level domain associated with the
|
9 |
* IP address. This will be something like "example.com" or
|
10 |
* "example.co.uk", not "foo.example.com".
|
11 |
-
*
|
12 |
* @property-read string $ipAddress The IP address that the data in the model is
|
13 |
* for.
|
14 |
-
*
|
15 |
*/
|
16 |
class Domain extends AbstractModel
|
17 |
{
|
@@ -20,6 +18,8 @@ class Domain extends AbstractModel
|
|
20 |
|
21 |
/**
|
22 |
* @ignore
|
|
|
|
|
23 |
*/
|
24 |
public function __construct($raw)
|
25 |
{
|
8 |
* @property-read string|null $domain The second level domain associated with the
|
9 |
* IP address. This will be something like "example.com" or
|
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 |
{
|
18 |
|
19 |
/**
|
20 |
* @ignore
|
21 |
+
*
|
22 |
+
* @param mixed $raw
|
23 |
*/
|
24 |
public function __construct($raw)
|
25 |
{
|
vendor/geoip2/geoip2/src/Model/Enterprise.php
CHANGED
@@ -11,30 +11,23 @@ namespace GeoIp2\Model;
|
|
11 |
*
|
12 |
* @property-read \GeoIp2\Record\City $city City data for the requested IP
|
13 |
* address.
|
14 |
-
*
|
15 |
* @property-read \GeoIp2\Record\Continent $continent Continent data for the
|
16 |
* requested IP address.
|
17 |
-
*
|
18 |
* @property-read \GeoIp2\Record\Country $country Country data for the requested
|
19 |
* IP address. This object represents the country where MaxMind believes the
|
20 |
* end user is located.
|
21 |
-
*
|
22 |
* @property-read \GeoIp2\Record\Location $location Location data for the
|
23 |
* requested IP address.
|
24 |
-
*
|
25 |
* @property-read \GeoIp2\Record\MaxMind $maxmind Data related to your MaxMind
|
26 |
* account.
|
27 |
-
*
|
28 |
* @property-read \GeoIp2\Record\Country $registeredCountry Registered country
|
29 |
* data for the requested IP address. This record represents the country
|
30 |
* where the ISP has registered a given IP block and may differ from the
|
31 |
* user's country.
|
32 |
-
*
|
33 |
* @property-read \GeoIp2\Record\RepresentedCountry $representedCountry
|
34 |
* Represented country data for the requested IP address. The represented
|
35 |
* country is used for things like military bases. It is only present when
|
36 |
* the represented country differs from the country.
|
37 |
-
*
|
38 |
* @property-read array $subdivisions An array of {@link \GeoIp2\Record\Subdivision}
|
39 |
* objects representing the country subdivisions for the requested IP
|
40 |
* address. The number and type of subdivisions varies by country, but a
|
@@ -42,12 +35,10 @@ namespace GeoIp2\Model;
|
|
42 |
* are ordered from most general (largest) to most specific (smallest).
|
43 |
* If the response did not contain any subdivisions, this method returns
|
44 |
* an empty array.
|
45 |
-
*
|
46 |
* @property-read \GeoIp2\Record\Subdivision $mostSpecificSubdivision An object
|
47 |
* representing the most specific subdivision returned. If the response
|
48 |
* did not contain any subdivisions, this method returns an empty
|
49 |
* {@link \GeoIp2\Record\Subdivision} object.
|
50 |
-
*
|
51 |
* @property-read \GeoIp2\Record\Traits $traits Data for the traits of the
|
52 |
* requested IP address.
|
53 |
*/
|
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
|
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 |
*/
|
vendor/geoip2/geoip2/src/Model/Insights.php
CHANGED
@@ -11,30 +11,23 @@ namespace GeoIp2\Model;
|
|
11 |
*
|
12 |
* @property-read \GeoIp2\Record\City $city City data for the requested IP
|
13 |
* address.
|
14 |
-
*
|
15 |
* @property-read \GeoIp2\Record\Continent $continent Continent data for the
|
16 |
* requested IP address.
|
17 |
-
*
|
18 |
* @property-read \GeoIp2\Record\Country $country Country data for the requested
|
19 |
* IP address. This object represents the country where MaxMind believes the
|
20 |
* end user is located.
|
21 |
-
*
|
22 |
* @property-read \GeoIp2\Record\Location $location Location data for the
|
23 |
* requested IP address.
|
24 |
-
*
|
25 |
* @property-read \GeoIp2\Record\MaxMind $maxmind Data related to your MaxMind
|
26 |
* account.
|
27 |
-
*
|
28 |
* @property-read \GeoIp2\Record\Country $registeredCountry Registered country
|
29 |
* data for the requested IP address. This record represents the country
|
30 |
* where the ISP has registered a given IP block and may differ from the
|
31 |
* user's country.
|
32 |
-
*
|
33 |
* @property-read \GeoIp2\Record\RepresentedCountry $representedCountry
|
34 |
* Represented country data for the requested IP address. The represented
|
35 |
* country is used for things like military bases. It is only present when
|
36 |
* the represented country differs from the country.
|
37 |
-
*
|
38 |
* @property-read array $subdivisions An array of {@link \GeoIp2\Record\Subdivision}
|
39 |
* objects representing the country subdivisions for the requested IP
|
40 |
* address. The number and type of subdivisions varies by country, but a
|
@@ -42,12 +35,10 @@ namespace GeoIp2\Model;
|
|
42 |
* are ordered from most general (largest) to most specific (smallest).
|
43 |
* If the response did not contain any subdivisions, this method returns
|
44 |
* an empty array.
|
45 |
-
*
|
46 |
* @property-read \GeoIp2\Record\Subdivision $mostSpecificSubdivision An object
|
47 |
* representing the most specific subdivision returned. If the response
|
48 |
* did not contain any subdivisions, this method returns an empty
|
49 |
* {@link \GeoIp2\Record\Subdivision} object.
|
50 |
-
*
|
51 |
* @property-read \GeoIp2\Record\Traits $traits Data for the traits of the
|
52 |
* requested IP address.
|
53 |
*/
|
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
|
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 |
*/
|
vendor/geoip2/geoip2/src/Model/Isp.php
CHANGED
@@ -3,24 +3,19 @@
|
|
3 |
namespace GeoIp2\Model;
|
4 |
|
5 |
/**
|
6 |
-
* This class provides the GeoIP2
|
7 |
*
|
8 |
-
* @property-read
|
9 |
* associated with the IP address.
|
10 |
-
*
|
11 |
* @property-read string|null $autonomousSystemOrganization The organization
|
12 |
* associated with the registered autonomous system number for the IP
|
13 |
* address.
|
14 |
-
*
|
15 |
* @property-read string|null $isp The name of the ISP associated with the IP
|
16 |
* address.
|
17 |
-
*
|
18 |
* @property-read string|null $organization The name of the organization associated
|
19 |
* with the IP address.
|
20 |
-
*
|
21 |
* @property-read string $ipAddress The IP address that the data in the model is
|
22 |
* for.
|
23 |
-
*
|
24 |
*/
|
25 |
class Isp extends AbstractModel
|
26 |
{
|
@@ -32,6 +27,8 @@ class Isp extends AbstractModel
|
|
32 |
|
33 |
/**
|
34 |
* @ignore
|
|
|
|
|
35 |
*/
|
36 |
public function __construct($raw)
|
37 |
{
|
3 |
namespace GeoIp2\Model;
|
4 |
|
5 |
/**
|
6 |
+
* This class provides the GeoIP2 ISP model.
|
7 |
*
|
8 |
+
* @property-read int|null $autonomousSystemNumber The autonomous system number
|
9 |
* associated with the IP address.
|
|
|
10 |
* @property-read string|null $autonomousSystemOrganization The organization
|
11 |
* associated with the registered autonomous system number for the IP
|
12 |
* address.
|
|
|
13 |
* @property-read string|null $isp The name of the ISP associated with the IP
|
14 |
* address.
|
|
|
15 |
* @property-read string|null $organization The name of the organization associated
|
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 |
{
|
27 |
|
28 |
/**
|
29 |
* @ignore
|
30 |
+
*
|
31 |
+
* @param mixed $raw
|
32 |
*/
|
33 |
public function __construct($raw)
|
34 |
{
|
vendor/geoip2/geoip2/src/ProviderInterface.php
CHANGED
@@ -5,16 +5,16 @@ namespace GeoIp2;
|
|
5 |
interface ProviderInterface
|
6 |
{
|
7 |
/**
|
8 |
-
* @param ipAddress
|
9 |
-
*
|
10 |
-
* @return \GeoIp2\Model\Country
|
11 |
*/
|
12 |
public function country($ipAddress);
|
13 |
|
14 |
/**
|
15 |
-
* @param ipAddress
|
16 |
-
*
|
17 |
-
* @return \GeoIp2\Model\City
|
18 |
*/
|
19 |
public function city($ipAddress);
|
20 |
}
|
5 |
interface ProviderInterface
|
6 |
{
|
7 |
/**
|
8 |
+
* @param string $ipAddress an IPv4 or IPv6 address to lookup
|
9 |
+
*
|
10 |
+
* @return \GeoIp2\Model\Country a Country model for the requested IP address
|
11 |
*/
|
12 |
public function country($ipAddress);
|
13 |
|
14 |
/**
|
15 |
+
* @param string $ipAddress an IPv4 or IPv6 address to lookup
|
16 |
+
*
|
17 |
+
* @return \GeoIp2\Model\City a City model for the requested IP address
|
18 |
*/
|
19 |
public function city($ipAddress);
|
20 |
}
|
vendor/geoip2/geoip2/src/Record/AbstractPlaceRecord.php
CHANGED
@@ -8,8 +8,11 @@ abstract class AbstractPlaceRecord extends AbstractRecord
|
|
8 |
|
9 |
/**
|
10 |
* @ignore
|
|
|
|
|
|
|
11 |
*/
|
12 |
-
public function __construct($record, $locales =
|
13 |
{
|
14 |
$this->locales = $locales;
|
15 |
parent::__construct($record);
|
@@ -17,31 +20,36 @@ abstract class AbstractPlaceRecord extends AbstractRecord
|
|
17 |
|
18 |
/**
|
19 |
* @ignore
|
|
|
|
|
20 |
*/
|
21 |
public function __get($attr)
|
22 |
{
|
23 |
-
if ($attr
|
24 |
return $this->name();
|
25 |
-
} else {
|
26 |
-
return parent::__get($attr);
|
27 |
}
|
|
|
|
|
28 |
}
|
29 |
|
30 |
/**
|
31 |
* @ignore
|
|
|
|
|
32 |
*/
|
33 |
public function __isset($attr)
|
34 |
{
|
35 |
-
if ($attr
|
36 |
-
return $this->firstSetNameLocale()
|
37 |
-
} else {
|
38 |
-
return parent::__isset($attr);
|
39 |
}
|
|
|
|
|
40 |
}
|
41 |
|
42 |
private function name()
|
43 |
{
|
44 |
$locale = $this->firstSetNameLocale();
|
|
|
45 |
return $locale === null ? null : $this->names[$locale];
|
46 |
}
|
47 |
|
@@ -52,6 +60,7 @@ abstract class AbstractPlaceRecord extends AbstractRecord
|
|
52 |
return $locale;
|
53 |
}
|
54 |
}
|
|
|
55 |
return null;
|
56 |
}
|
57 |
}
|
8 |
|
9 |
/**
|
10 |
* @ignore
|
11 |
+
*
|
12 |
+
* @param mixed $record
|
13 |
+
* @param mixed $locales
|
14 |
*/
|
15 |
+
public function __construct($record, $locales = ['en'])
|
16 |
{
|
17 |
$this->locales = $locales;
|
18 |
parent::__construct($record);
|
20 |
|
21 |
/**
|
22 |
* @ignore
|
23 |
+
*
|
24 |
+
* @param mixed $attr
|
25 |
*/
|
26 |
public function __get($attr)
|
27 |
{
|
28 |
+
if ($attr === 'name') {
|
29 |
return $this->name();
|
|
|
|
|
30 |
}
|
31 |
+
|
32 |
+
return parent::__get($attr);
|
33 |
}
|
34 |
|
35 |
/**
|
36 |
* @ignore
|
37 |
+
*
|
38 |
+
* @param mixed $attr
|
39 |
*/
|
40 |
public function __isset($attr)
|
41 |
{
|
42 |
+
if ($attr === 'name') {
|
43 |
+
return $this->firstSetNameLocale() === null ? false : true;
|
|
|
|
|
44 |
}
|
45 |
+
|
46 |
+
return parent::__isset($attr);
|
47 |
}
|
48 |
|
49 |
private function name()
|
50 |
{
|
51 |
$locale = $this->firstSetNameLocale();
|
52 |
+
|
53 |
return $locale === null ? null : $this->names[$locale];
|
54 |
}
|
55 |
|
60 |
return $locale;
|
61 |
}
|
62 |
}
|
63 |
+
|
64 |
return null;
|
65 |
}
|
66 |
}
|
vendor/geoip2/geoip2/src/Record/AbstractRecord.php
CHANGED
@@ -2,22 +2,24 @@
|
|
2 |
|
3 |
namespace GeoIp2\Record;
|
4 |
|
5 |
-
|
6 |
-
|
7 |
-
abstract class AbstractRecord implements JsonSerializable
|
8 |
{
|
9 |
private $record;
|
10 |
|
11 |
/**
|
12 |
* @ignore
|
|
|
|
|
13 |
*/
|
14 |
public function __construct($record)
|
15 |
{
|
16 |
-
$this->record = isset($record) ? $record :
|
17 |
}
|
18 |
|
19 |
/**
|
20 |
* @ignore
|
|
|
|
|
21 |
*/
|
22 |
public function __get($attr)
|
23 |
{
|
@@ -29,12 +31,11 @@ abstract class AbstractRecord implements JsonSerializable
|
|
29 |
} elseif ($this->validAttribute($attr)) {
|
30 |
if (preg_match('/^is_/', $key)) {
|
31 |
return false;
|
32 |
-
} else {
|
33 |
-
return null;
|
34 |
}
|
35 |
-
|
36 |
-
|
37 |
}
|
|
|
38 |
}
|
39 |
|
40 |
public function __isset($attr)
|
@@ -50,7 +51,7 @@ abstract class AbstractRecord implements JsonSerializable
|
|
50 |
|
51 |
private function validAttribute($attr)
|
52 |
{
|
53 |
-
return in_array($attr, $this->validAttributes);
|
54 |
}
|
55 |
|
56 |
public function jsonSerialize()
|
2 |
|
3 |
namespace GeoIp2\Record;
|
4 |
|
5 |
+
abstract class AbstractRecord implements \JsonSerializable
|
|
|
|
|
6 |
{
|
7 |
private $record;
|
8 |
|
9 |
/**
|
10 |
* @ignore
|
11 |
+
*
|
12 |
+
* @param mixed $record
|
13 |
*/
|
14 |
public function __construct($record)
|
15 |
{
|
16 |
+
$this->record = isset($record) ? $record : [];
|
17 |
}
|
18 |
|
19 |
/**
|
20 |
* @ignore
|
21 |
+
*
|
22 |
+
* @param mixed $attr
|
23 |
*/
|
24 |
public function __get($attr)
|
25 |
{
|
31 |
} elseif ($this->validAttribute($attr)) {
|
32 |
if (preg_match('/^is_/', $key)) {
|
33 |
return false;
|
|
|
|
|
34 |
}
|
35 |
+
|
36 |
+
return null;
|
37 |
}
|
38 |
+
throw new \RuntimeException("Unknown attribute: $attr");
|
39 |
}
|
40 |
|
41 |
public function __isset($attr)
|
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/City.php
CHANGED
@@ -11,14 +11,11 @@ namespace GeoIp2\Record;
|
|
11 |
* @property-read int|null $confidence A value from 0-100 indicating MaxMind's
|
12 |
* confidence that the city is correct. This attribute is only available
|
13 |
* from the Insights service and the GeoIP2 Enterprise database.
|
14 |
-
*
|
15 |
* @property-read int|null $geonameId The GeoName ID for the city. This attribute
|
16 |
* is returned by all location services and databases.
|
17 |
-
*
|
18 |
* @property-read string|null $name The name of the city based on the locales list
|
19 |
* passed to the constructor. This attribute is returned by all location
|
20 |
* services and databases.
|
21 |
-
*
|
22 |
* @property-read array|null $names A array map where the keys are locale codes
|
23 |
* and the values are names. This attribute is returned by all location
|
24 |
* services and databases.
|
@@ -28,5 +25,5 @@ class City extends AbstractPlaceRecord
|
|
28 |
/**
|
29 |
* @ignore
|
30 |
*/
|
31 |
-
protected $validAttributes =
|
32 |
}
|
11 |
* @property-read int|null $confidence A value from 0-100 indicating MaxMind's
|
12 |
* confidence that the city is correct. This attribute is only available
|
13 |
* from the Insights service and the GeoIP2 Enterprise database.
|
|
|
14 |
* @property-read int|null $geonameId The GeoName ID for the city. This attribute
|
15 |
* is returned by all location services and databases.
|
|
|
16 |
* @property-read string|null $name The name of the city based on the locales list
|
17 |
* passed to the constructor. This attribute is returned by all location
|
18 |
* services and databases.
|
|
|
19 |
* @property-read array|null $names A array map where the keys are locale codes
|
20 |
* and the values are names. This attribute is returned by all location
|
21 |
* services and databases.
|
25 |
/**
|
26 |
* @ignore
|
27 |
*/
|
28 |
+
protected $validAttributes = ['confidence', 'geonameId', 'names'];
|
29 |
}
|
vendor/geoip2/geoip2/src/Record/Continent.php
CHANGED
@@ -3,21 +3,18 @@
|
|
3 |
namespace GeoIp2\Record;
|
4 |
|
5 |
/**
|
6 |
-
* Contains data for the continent record associated with an IP address
|
7 |
*
|
8 |
* This record is returned by all location services and databases.
|
9 |
*
|
10 |
* @property-read string|null $code A two character continent code like "NA" (North
|
11 |
* America) or "OC" (Oceania). This attribute is returned by all location
|
12 |
* services and databases.
|
13 |
-
*
|
14 |
* @property-read int|null $geonameId The GeoName ID for the continent. This
|
15 |
* attribute is returned by all location services and databases.
|
16 |
-
*
|
17 |
* @property-read string|null $name Returns the name of the continent based on the
|
18 |
* locales list passed to the constructor. This attribute is returned by all location
|
19 |
* services and databases.
|
20 |
-
*
|
21 |
* @property-read array|null $names An array map where the keys are locale codes
|
22 |
* and the values are names. This attribute is returned by all location
|
23 |
* services and databases.
|
@@ -27,9 +24,9 @@ class Continent extends AbstractPlaceRecord
|
|
27 |
/**
|
28 |
* @ignore
|
29 |
*/
|
30 |
-
protected $validAttributes =
|
31 |
'code',
|
32 |
'geonameId',
|
33 |
-
'names'
|
34 |
-
|
35 |
}
|
3 |
namespace GeoIp2\Record;
|
4 |
|
5 |
/**
|
6 |
+
* Contains data for the continent record associated with an IP address.
|
7 |
*
|
8 |
* This record is returned by all location services and databases.
|
9 |
*
|
10 |
* @property-read string|null $code A two character continent code like "NA" (North
|
11 |
* America) or "OC" (Oceania). This attribute is returned by all location
|
12 |
* services and databases.
|
|
|
13 |
* @property-read int|null $geonameId The GeoName ID for the continent. This
|
14 |
* attribute is returned by all location services and databases.
|
|
|
15 |
* @property-read string|null $name Returns the name of the continent based on the
|
16 |
* locales list passed to the constructor. This attribute is returned by all location
|
17 |
* services and databases.
|
|
|
18 |
* @property-read array|null $names An array map where the keys are locale codes
|
19 |
* and the values are names. This attribute is returned by all location
|
20 |
* services and databases.
|
24 |
/**
|
25 |
* @ignore
|
26 |
*/
|
27 |
+
protected $validAttributes = [
|
28 |
'code',
|
29 |
'geonameId',
|
30 |
+
'names',
|
31 |
+
];
|
32 |
}
|
vendor/geoip2/geoip2/src/Record/Country.php
CHANGED
@@ -3,26 +3,22 @@
|
|
3 |
namespace GeoIp2\Record;
|
4 |
|
5 |
/**
|
6 |
-
* Contains data for the country record associated with an IP address
|
7 |
*
|
8 |
* This record is returned by all location services and databases.
|
9 |
*
|
10 |
* @property-read int|null $confidence A value from 0-100 indicating MaxMind's
|
11 |
* confidence that the country is correct. This attribute is only available
|
12 |
* from the Insights service and the GeoIP2 Enterprise database.
|
13 |
-
*
|
14 |
* @property-read int|null $geonameId The GeoName ID for the country. This
|
15 |
* attribute is returned by location services and databases.
|
16 |
-
*
|
17 |
-
* @
|
18 |
-
* http://en.wikipedia.org/wiki/ISO_3166-1 two-character ISO 3166-1 alpha
|
19 |
* code} for the country. This attribute is returned by all location services
|
20 |
* and databases.
|
21 |
-
*
|
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.
|
25 |
-
*
|
26 |
* @property-read array|null $names An array map where the keys are locale codes
|
27 |
* and the values are names. This attribute is returned by all location
|
28 |
* services and databases.
|
@@ -32,10 +28,10 @@ class Country extends AbstractPlaceRecord
|
|
32 |
/**
|
33 |
* @ignore
|
34 |
*/
|
35 |
-
protected $validAttributes =
|
36 |
'confidence',
|
37 |
'geonameId',
|
38 |
'isoCode',
|
39 |
-
'names'
|
40 |
-
|
41 |
}
|
3 |
namespace GeoIp2\Record;
|
4 |
|
5 |
/**
|
6 |
+
* Contains data for the country record associated with an IP address.
|
7 |
*
|
8 |
* This record is returned by all location services and databases.
|
9 |
*
|
10 |
* @property-read int|null $confidence A value from 0-100 indicating MaxMind's
|
11 |
* confidence that the country is correct. This attribute is only available
|
12 |
* from the Insights service and the GeoIP2 Enterprise database.
|
|
|
13 |
* @property-read int|null $geonameId The GeoName ID for the country. This
|
14 |
* attribute is returned by location services and databases.
|
15 |
+
* @property-read string|null $isoCode The
|
16 |
+
* {@link * http://en.wikipedia.org/wiki/ISO_3166-1 two-character ISO 3166-1 alpha
|
|
|
17 |
* code} for the country. This attribute is returned by all location services
|
18 |
* and databases.
|
|
|
19 |
* @property-read string|null $name The name of the country based on the locales
|
20 |
* list passed to the constructor. This attribute is returned by all location
|
21 |
* services and databases.
|
|
|
22 |
* @property-read array|null $names An array map where the keys are locale codes
|
23 |
* and the values are names. This attribute is returned by all location
|
24 |
* services and databases.
|
28 |
/**
|
29 |
* @ignore
|
30 |
*/
|
31 |
+
protected $validAttributes = [
|
32 |
'confidence',
|
33 |
'geonameId',
|
34 |
'isoCode',
|
35 |
+
'names',
|
36 |
+
];
|
37 |
}
|
vendor/geoip2/geoip2/src/Record/Location.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
namespace GeoIp2\Record;
|
4 |
|
5 |
/**
|
6 |
-
* Contains data for the location record associated with an IP address
|
7 |
*
|
8 |
* This record is returned by all location services and databases besides
|
9 |
* Country.
|
@@ -11,31 +11,24 @@ namespace GeoIp2\Record;
|
|
11 |
* @property-read int|null $averageIncome The average income in US dollars
|
12 |
* associated with the requested IP address. This attribute is only available
|
13 |
* from the Insights service.
|
14 |
-
*
|
15 |
* @property-read int|null $accuracyRadius The approximate accuracy radius in
|
16 |
* kilometers around the latitude and longitude for the IP address. This is
|
17 |
* the radius where we have a 67% confidence that the device using the IP
|
18 |
* address resides within the circle centered at the latitude and longitude
|
19 |
* with the provided radius.
|
20 |
-
*
|
21 |
* @property-read float|null $latitude The approximate latitude of the location
|
22 |
* associated with the IP address. This value is not precise and should not be
|
23 |
* used to identify a particular address or household.
|
24 |
-
*
|
25 |
* @property-read float|null $longitude The approximate longitude of the location
|
26 |
* associated with the IP address. This value is not precise and should not be
|
27 |
* used to identify a particular address or household.
|
28 |
-
*
|
29 |
* @property-read int|null $populationDensity The estimated population per square
|
30 |
* kilometer associated with the IP address. This attribute is only available
|
31 |
* from the Insights service.
|
32 |
-
*
|
33 |
* @property-read int|null $metroCode The metro code of the location if the location
|
34 |
* is in the US. MaxMind returns the same metro codes as the
|
35 |
-
* {@link
|
36 |
-
* https://developers.google.com/adwords/api/docs/appendix/cities-DMAregions
|
37 |
* Google AdWords API}.
|
38 |
-
*
|
39 |
* @property-read string|null $timeZone The time zone associated with location, as
|
40 |
* specified by the {@link http://www.iana.org/time-zones IANA Time Zone
|
41 |
* Database}, e.g., "America/New_York".
|
@@ -45,7 +38,7 @@ class Location extends AbstractRecord
|
|
45 |
/**
|
46 |
* @ignore
|
47 |
*/
|
48 |
-
protected $validAttributes =
|
49 |
'averageIncome',
|
50 |
'accuracyRadius',
|
51 |
'latitude',
|
@@ -54,6 +47,6 @@ class Location extends AbstractRecord
|
|
54 |
'populationDensity',
|
55 |
'postalCode',
|
56 |
'postalConfidence',
|
57 |
-
'timeZone'
|
58 |
-
|
59 |
}
|
3 |
namespace GeoIp2\Record;
|
4 |
|
5 |
/**
|
6 |
+
* Contains data for the location record associated with an IP address.
|
7 |
*
|
8 |
* This record is returned by all location services and databases besides
|
9 |
* Country.
|
11 |
* @property-read int|null $averageIncome The average income in US dollars
|
12 |
* associated with the requested IP address. This attribute is only available
|
13 |
* from the Insights service.
|
|
|
14 |
* @property-read int|null $accuracyRadius The approximate accuracy radius in
|
15 |
* kilometers around the latitude and longitude for the IP address. This is
|
16 |
* the radius where we have a 67% confidence that the device using the IP
|
17 |
* address resides within the circle centered at the latitude and longitude
|
18 |
* with the provided radius.
|
|
|
19 |
* @property-read float|null $latitude The approximate latitude of the location
|
20 |
* associated with the IP address. This value is not precise and should not be
|
21 |
* used to identify a particular address or household.
|
|
|
22 |
* @property-read float|null $longitude The approximate longitude of the location
|
23 |
* associated with the IP address. This value is not precise and should not be
|
24 |
* used to identify a particular address or household.
|
|
|
25 |
* @property-read int|null $populationDensity The estimated population per square
|
26 |
* kilometer associated with the IP address. This attribute is only available
|
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".
|
38 |
/**
|
39 |
* @ignore
|
40 |
*/
|
41 |
+
protected $validAttributes = [
|
42 |
'averageIncome',
|
43 |
'accuracyRadius',
|
44 |
'latitude',
|
47 |
'populationDensity',
|
48 |
'postalCode',
|
49 |
'postalConfidence',
|
50 |
+
'timeZone',
|
51 |
+
];
|
52 |
}
|
vendor/geoip2/geoip2/src/Record/MaxMind.php
CHANGED
@@ -15,5 +15,5 @@ class MaxMind extends AbstractRecord
|
|
15 |
/**
|
16 |
* @ignore
|
17 |
*/
|
18 |
-
protected $validAttributes =
|
19 |
}
|
15 |
/**
|
16 |
* @ignore
|
17 |
*/
|
18 |
+
protected $validAttributes = ['queriesRemaining'];
|
19 |
}
|
vendor/geoip2/geoip2/src/Record/Postal.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
namespace GeoIp2\Record;
|
4 |
|
5 |
/**
|
6 |
-
* Contains data for the postal record associated with an IP address
|
7 |
*
|
8 |
* This record is returned by all location databases and services besides
|
9 |
* Country.
|
@@ -12,7 +12,6 @@ namespace GeoIp2\Record;
|
|
12 |
* are not available for all countries. In some countries, this will only
|
13 |
* contain part of the postal code. This attribute is returned by all location
|
14 |
* databases and services besides Country.
|
15 |
-
*
|
16 |
* @property-read int|null $confidence A value from 0-100 indicating MaxMind's
|
17 |
* confidence that the postal code is correct. This attribute is only
|
18 |
* available from the Insights service and the GeoIP2 Enterprise
|
@@ -23,5 +22,5 @@ class Postal extends AbstractRecord
|
|
23 |
/**
|
24 |
* @ignore
|
25 |
*/
|
26 |
-
protected $validAttributes =
|
27 |
}
|
3 |
namespace GeoIp2\Record;
|
4 |
|
5 |
/**
|
6 |
+
* Contains data for the postal record associated with an IP address.
|
7 |
*
|
8 |
* This record is returned by all location databases and services besides
|
9 |
* Country.
|
12 |
* are not available for all countries. In some countries, this will only
|
13 |
* contain part of the postal code. This attribute is returned by all location
|
14 |
* databases and services besides Country.
|
|
|
15 |
* @property-read int|null $confidence A value from 0-100 indicating MaxMind's
|
16 |
* confidence that the postal code is correct. This attribute is only
|
17 |
* available from the Insights service and the GeoIP2 Enterprise
|
22 |
/**
|
23 |
* @ignore
|
24 |
*/
|
25 |
+
protected $validAttributes = ['code', 'confidence'];
|
26 |
}
|
vendor/geoip2/geoip2/src/Record/RepresentedCountry.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
namespace GeoIp2\Record;
|
4 |
|
5 |
/**
|
6 |
-
* Contains data for the represented country associated with an IP address
|
7 |
*
|
8 |
* This class contains the country-level data associated with an IP address
|
9 |
* for the IP's represented country. The represented country is the country
|
@@ -12,29 +12,24 @@ namespace GeoIp2\Record;
|
|
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 |
-
*
|
16 |
* @property-read int|null $geonameId The GeoName ID for the country.
|
17 |
-
*
|
18 |
* @property-read string|null $isoCode The {@link http://en.wikipedia.org/wiki/ISO_3166-1
|
19 |
* two-character ISO 3166-1 alpha code} for the country.
|
20 |
-
*
|
21 |
* @property-read string|null $name The name of the country based on the locales list
|
22 |
* passed to the constructor.
|
23 |
-
*
|
24 |
* @property-read array|null $names An array map where the keys are locale codes and
|
25 |
* the values are names.
|
26 |
-
*
|
27 |
* @property-read string|null $type A string indicating the type of entity that is
|
28 |
* representing the country. Currently we only return <code>military</code>
|
29 |
* but this could expand to include other types in the future.
|
30 |
*/
|
31 |
class RepresentedCountry extends Country
|
32 |
{
|
33 |
-
protected $validAttributes =
|
34 |
'confidence',
|
35 |
'geonameId',
|
36 |
'isoCode',
|
37 |
'names',
|
38 |
-
'type'
|
39 |
-
|
40 |
}
|
3 |
namespace GeoIp2\Record;
|
4 |
|
5 |
/**
|
6 |
+
* Contains data for the represented country associated with an IP address.
|
7 |
*
|
8 |
* This class contains the country-level data associated with an IP address
|
9 |
* for the IP's represented country. The represented country is the country
|
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 string|null $isoCode The {@link http://en.wikipedia.org/wiki/ISO_3166-1
|
17 |
* two-character ISO 3166-1 alpha code} for the country.
|
|
|
18 |
* @property-read string|null $name The name of the country based on the locales list
|
19 |
* passed to the constructor.
|
|
|
20 |
* @property-read array|null $names An array map where the keys are locale codes and
|
21 |
* the values are names.
|
|
|
22 |
* @property-read string|null $type A string indicating the type of entity that is
|
23 |
* representing the country. Currently we only return <code>military</code>
|
24 |
* but this could expand to include other types in the future.
|
25 |
*/
|
26 |
class RepresentedCountry extends Country
|
27 |
{
|
28 |
+
protected $validAttributes = [
|
29 |
'confidence',
|
30 |
'geonameId',
|
31 |
'isoCode',
|
32 |
'names',
|
33 |
+
'type',
|
34 |
+
];
|
35 |
}
|
vendor/geoip2/geoip2/src/Record/Subdivision.php
CHANGED
@@ -3,8 +3,7 @@
|
|
3 |
namespace GeoIp2\Record;
|
4 |
|
5 |
/**
|
6 |
-
*
|
7 |
-
* Contains data for the subdivisions associated with an IP address
|
8 |
*
|
9 |
* This record is returned by all location databases and services besides
|
10 |
* Country.
|
@@ -13,20 +12,16 @@ namespace GeoIp2\Record;
|
|
13 |
* MaxMind's confidence that the subdivision is correct. This attribute is
|
14 |
* only available from the Insights service and the GeoIP2 Enterprise
|
15 |
* database.
|
16 |
-
*
|
17 |
* @property-read int|null $geonameId This is a GeoName ID for the subdivision.
|
18 |
* This attribute is returned by all location databases and services besides
|
19 |
* Country.
|
20 |
-
*
|
21 |
* @property-read string|null $isoCode This is a string up to three characters long
|
22 |
-
* contain the subdivision portion of the
|
23 |
-
* http://en.wikipedia.org/wiki/ISO_3166-2 ISO 3166-2 code}. This attribute
|
24 |
* is returned by all location databases and services except Country.
|
25 |
-
*
|
26 |
* @property-read string|null $name The name of the subdivision based on the
|
27 |
* locales list passed to the constructor. This attribute is returned by all
|
28 |
* location databases and services besides Country.
|
29 |
-
*
|
30 |
* @property-read array|null $names An array map where the keys are locale codes
|
31 |
* and the values are names. This attribute is returned by all location
|
32 |
* databases and services besides Country.
|
@@ -36,10 +31,10 @@ class Subdivision extends AbstractPlaceRecord
|
|
36 |
/**
|
37 |
* @ignore
|
38 |
*/
|
39 |
-
protected $validAttributes =
|
40 |
'confidence',
|
41 |
'geonameId',
|
42 |
'isoCode',
|
43 |
-
'names'
|
44 |
-
|
45 |
}
|
3 |
namespace GeoIp2\Record;
|
4 |
|
5 |
/**
|
6 |
+
* Contains data for the subdivisions associated with an IP address.
|
|
|
7 |
*
|
8 |
* This record is returned by all location databases and services besides
|
9 |
* Country.
|
12 |
* MaxMind's confidence that the subdivision is correct. This attribute is
|
13 |
* only available from the Insights service and the GeoIP2 Enterprise
|
14 |
* database.
|
|
|
15 |
* @property-read int|null $geonameId This is a GeoName ID for the subdivision.
|
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.
|
|
|
25 |
* @property-read array|null $names An array map where the keys are locale codes
|
26 |
* and the values are names. This attribute is returned by all location
|
27 |
* databases and services besides Country.
|
31 |
/**
|
32 |
* @ignore
|
33 |
*/
|
34 |
+
protected $validAttributes = [
|
35 |
'confidence',
|
36 |
'geonameId',
|
37 |
'isoCode',
|
38 |
+
'names',
|
39 |
+
];
|
40 |
}
|
vendor/geoip2/geoip2/src/Record/Traits.php
CHANGED
@@ -3,65 +3,53 @@
|
|
3 |
namespace GeoIp2\Record;
|
4 |
|
5 |
/**
|
6 |
-
*
|
7 |
-
* Contains data for the traits record associated with an IP address
|
8 |
*
|
9 |
* This record is returned by all location services and databases.
|
10 |
*
|
11 |
-
* @property-read int|null $autonomousSystemNumber The
|
12 |
-
* http://en.wikipedia.org/wiki/Autonomous_system_(Internet) autonomous
|
13 |
* system number} associated with the IP address. This attribute is only
|
14 |
* available from the City and Insights web service and the GeoIP2
|
15 |
* Enterprise database.
|
16 |
-
*
|
17 |
* @property-read string|null $autonomousSystemOrganization The organization
|
18 |
-
* associated with the registered {@link
|
19 |
-
* http://en.wikipedia.org/wiki/Autonomous_system_(Internet) autonomous
|
20 |
* system number} for the IP address. This attribute is only available from
|
21 |
* the City and Insights web service and the GeoIP2 Enterprise
|
22 |
* database.
|
23 |
-
*
|
24 |
* @property-read string|null $connectionType The connection type may take the
|
25 |
* following values: "Dialup", "Cable/DSL", "Corporate", "Cellular".
|
26 |
* Additional values may be added in the future. This attribute is only
|
27 |
* available in the GeoIP2 Enterprise database.
|
28 |
-
*
|
29 |
* @property-read string|null $domain The second level domain associated with the
|
30 |
* IP address. This will be something like "example.com" or "example.co.uk",
|
31 |
* not "foo.example.com". This attribute is only available from the
|
32 |
* City and Insights web service and the GeoIP2 Enterprise
|
33 |
* database.
|
34 |
-
*
|
35 |
* @property-read string $ipAddress The IP address that the data in the model
|
36 |
* is for. If you performed a "me" lookup against the web service, this
|
37 |
* will be the externally routable IP address for the system the code is
|
38 |
* running on. If the system is behind a NAT, this may differ from the IP
|
39 |
* address locally assigned to it. This attribute is returned by all end
|
40 |
* points.
|
41 |
-
*
|
42 |
-
* @
|
43 |
-
* https://www.maxmind.com/en/geoip2-anonymous-ip-database GeoIP2
|
44 |
* Anonymous IP database} to determine whether the IP address is used by an
|
45 |
* anonymizing service.
|
46 |
-
*
|
47 |
-
* @property-read boolean $isLegitimateProxy This attribute is true if MaxMind
|
48 |
* believes this IP address to be a legitimate proxy, such as an internal
|
49 |
* VPN used by a corporation. This attribute is only available in the GeoIP2
|
50 |
* Enterprise database.
|
51 |
-
*
|
52 |
-
* @property-read boolean $isSatelliteProvider *Deprecated.* Due to the
|
53 |
* increased coverage by mobile carriers, very few satellite providers now
|
54 |
* serve multiple countries. As a result, the output does not provide
|
55 |
* sufficiently relevant data for us to maintain it.
|
56 |
-
*
|
57 |
* @property-read string|null $isp The name of the ISP associated with the IP
|
58 |
* address. This attribute is only available from the City and Insights web
|
59 |
* services and the GeoIP2 Enterprise database.
|
60 |
-
*
|
61 |
* @property-read string|null $organization The name of the organization associated
|
62 |
* with the IP address. This attribute is only available from the City and
|
63 |
* Insights web services and the GeoIP2 Enterprise database.
|
64 |
-
*
|
65 |
* @property-read string|null $userType <p>The user type associated with the IP
|
66 |
* address. This can be one of the following values:</p>
|
67 |
* <ul>
|
@@ -91,7 +79,7 @@ class Traits extends AbstractRecord
|
|
91 |
/**
|
92 |
* @ignore
|
93 |
*/
|
94 |
-
protected $validAttributes =
|
95 |
'autonomousSystemNumber',
|
96 |
'autonomousSystemOrganization',
|
97 |
'connectionType',
|
@@ -102,6 +90,6 @@ class Traits extends AbstractRecord
|
|
102 |
'isp',
|
103 |
'ipAddress',
|
104 |
'organization',
|
105 |
-
'userType'
|
106 |
-
|
107 |
}
|
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
|
23 |
* available in the GeoIP2 Enterprise database.
|
|
|
24 |
* @property-read string|null $domain The second level domain associated with the
|
25 |
* IP address. This will be something like "example.com" or "example.co.uk",
|
26 |
* not "foo.example.com". This attribute is only available from the
|
27 |
* City and Insights web service and the GeoIP2 Enterprise
|
28 |
* database.
|
|
|
29 |
* @property-read string $ipAddress The IP address that the data in the model
|
30 |
* is for. If you performed a "me" lookup against the web service, this
|
31 |
* will be the externally routable IP address for the system the code is
|
32 |
* running on. If the system is behind a NAT, this may differ from the IP
|
33 |
* address locally assigned to it. This attribute is returned by all end
|
34 |
* points.
|
35 |
+
* @property-read bool $isAnonymousProxy *Deprecated.* Please see our
|
36 |
+
* {@link * https://www.maxmind.com/en/geoip2-anonymous-ip-database GeoIP2
|
|
|
37 |
* Anonymous IP database} to determine whether the IP address is used by an
|
38 |
* anonymizing service.
|
39 |
+
* @property-read bool $isLegitimateProxy This attribute is true if MaxMind
|
|
|
40 |
* believes this IP address to be a legitimate proxy, such as an internal
|
41 |
* VPN used by a corporation. This attribute is only available in the GeoIP2
|
42 |
* Enterprise database.
|
43 |
+
* @property-read bool $isSatelliteProvider *Deprecated.* Due to the
|
|
|
44 |
* increased coverage by mobile carriers, very few satellite providers now
|
45 |
* serve multiple countries. As a result, the output does not provide
|
46 |
* sufficiently relevant data for us to maintain it.
|
|
|
47 |
* @property-read string|null $isp The name of the ISP associated with the IP
|
48 |
* address. This attribute is only available from the City and Insights web
|
49 |
* services and the GeoIP2 Enterprise database.
|
|
|
50 |
* @property-read string|null $organization The name of the organization associated
|
51 |
* with the IP address. This attribute is only available from the City and
|
52 |
* Insights web services and the GeoIP2 Enterprise database.
|
|
|
53 |
* @property-read string|null $userType <p>The user type associated with the IP
|
54 |
* address. This can be one of the following values:</p>
|
55 |
* <ul>
|
79 |
/**
|
80 |
* @ignore
|
81 |
*/
|
82 |
+
protected $validAttributes = [
|
83 |
'autonomousSystemNumber',
|
84 |
'autonomousSystemOrganization',
|
85 |
'connectionType',
|
90 |
'isp',
|
91 |
'ipAddress',
|
92 |
'organization',
|
93 |
+
'userType',
|
94 |
+
];
|
95 |
}
|
vendor/geoip2/geoip2/src/WebService/Client.php
CHANGED
@@ -9,7 +9,6 @@ use GeoIp2\Exception\HttpException;
|
|
9 |
use GeoIp2\Exception\InvalidRequestException;
|
10 |
use GeoIp2\Exception\OutOfQueriesException;
|
11 |
use GeoIp2\ProviderInterface;
|
12 |
-
use MaxMind\Exception\InvalidInputException;
|
13 |
use MaxMind\WebService\Client as WsClient;
|
14 |
|
15 |
/**
|
@@ -48,35 +47,35 @@ class Client implements ProviderInterface
|
|
48 |
private $client;
|
49 |
private static $basePath = '/geoip/v2.1';
|
50 |
|
51 |
-
const VERSION = 'v2.
|
52 |
|
53 |
/**
|
54 |
* Constructor.
|
55 |
*
|
56 |
-
* @param int
|
57 |
-
* @param string $licenseKey
|
58 |
-
* @param array
|
59 |
-
*
|
60 |
-
* @param array
|
61 |
-
*
|
62 |
-
*
|
63 |
-
*
|
64 |
-
*
|
65 |
-
*
|
66 |
-
*
|
67 |
*/
|
68 |
public function __construct(
|
69 |
$userId,
|
70 |
$licenseKey,
|
71 |
-
$locales =
|
72 |
-
$options =
|
73 |
) {
|
74 |
$this->locales = $locales;
|
75 |
|
76 |
// This is for backwards compatibility. Do not remove except for a
|
77 |
// major version bump.
|
78 |
if (is_string($options)) {
|
79 |
-
$options =
|
80 |
}
|
81 |
|
82 |
if (!isset($options['host'])) {
|
@@ -90,35 +89,34 @@ class Client implements ProviderInterface
|
|
90 |
|
91 |
private function userAgent()
|
92 |
{
|
93 |
-
return 'GeoIP2-API/' .
|
94 |
}
|
95 |
|
96 |
/**
|
97 |
* This method calls the GeoIP2 Precision: City service.
|
98 |
*
|
99 |
* @param string $ipAddress IPv4 or IPv6 address as a string. If no
|
100 |
-
*
|
101 |
-
*
|
102 |
-
*
|
103 |
-
* @return \GeoIp2\Model\City
|
104 |
*
|
105 |
* @throws \GeoIp2\Exception\AddressNotFoundException if the address you
|
106 |
-
*
|
107 |
-
* @throws \GeoIp2\Exception\AuthenticationException
|
108 |
-
*
|
109 |
-
* @throws \GeoIp2\Exception\OutOfQueriesException
|
110 |
-
*
|
111 |
-
* @throws \GeoIp2\Exception\InvalidRequestException} if your request was
|
112 |
-
*
|
113 |
-
*
|
114 |
-
*
|
115 |
-
*
|
116 |
-
*
|
117 |
-
*
|
118 |
-
*
|
119 |
-
*
|
120 |
-
*
|
121 |
-
*
|
|
|
122 |
*/
|
123 |
public function city($ipAddress = 'me')
|
124 |
{
|
@@ -129,28 +127,27 @@ class Client implements ProviderInterface
|
|
129 |
* This method calls the GeoIP2 Precision: Country service.
|
130 |
*
|
131 |
* @param string $ipAddress IPv4 or IPv6 address as a string. If no
|
132 |
-
*
|
133 |
-
*
|
134 |
*
|
135 |
-
* @
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
136 |
*
|
137 |
-
* @
|
138 |
-
* provided is not in our database (e.g., a private address).
|
139 |
-
* @throws \GeoIp2\Exception\AuthenticationException if there is a problem
|
140 |
-
* with the user ID or license key that you provided.
|
141 |
-
* @throws \GeoIp2\Exception\OutOfQueriesException if your account is out
|
142 |
-
* of queries.
|
143 |
-
* @throws \GeoIp2\Exception\InvalidRequestException} if your request was
|
144 |
-
* received by the web service but is invalid for some other reason.
|
145 |
-
* This may indicate an issue with this API. Please report the error to
|
146 |
-
* MaxMind.
|
147 |
-
* @throws \GeoIp2\Exception\HttpException if an unexpected HTTP error
|
148 |
-
* code or message was returned. This could indicate a problem with the
|
149 |
-
* connection between your server and the web service or that the web
|
150 |
-
* service returned an invalid document or 500 error code.
|
151 |
-
* @throws \GeoIp2\Exception\GeoIp2Exception This serves as the parent
|
152 |
-
* class to the above exceptions. It will be thrown directly if a 200
|
153 |
-
* status code is returned but the body is invalid.
|
154 |
*/
|
155 |
public function country($ipAddress = 'me')
|
156 |
{
|
@@ -161,28 +158,27 @@ class Client implements ProviderInterface
|
|
161 |
* This method calls the GeoIP2 Precision: Insights service.
|
162 |
*
|
163 |
* @param string $ipAddress IPv4 or IPv6 address as a string. If no
|
164 |
-
*
|
165 |
-
*
|
166 |
-
*
|
167 |
-
* @return \GeoIp2\Model\Insights
|
168 |
*
|
169 |
* @throws \GeoIp2\Exception\AddressNotFoundException if the address you
|
170 |
-
*
|
171 |
-
* @throws \GeoIp2\Exception\AuthenticationException
|
172 |
-
*
|
173 |
-
* @throws \GeoIp2\Exception\OutOfQueriesException
|
174 |
-
*
|
175 |
-
* @throws \GeoIp2\Exception\InvalidRequestException} if your request was
|
176 |
-
*
|
177 |
-
*
|
178 |
-
*
|
179 |
-
*
|
180 |
-
*
|
181 |
-
*
|
182 |
-
*
|
183 |
-
*
|
184 |
-
*
|
185 |
-
*
|
|
|
186 |
*/
|
187 |
public function insights($ipAddress = 'me')
|
188 |
{
|
@@ -191,7 +187,7 @@ class Client implements ProviderInterface
|
|
191 |
|
192 |
private function responseFor($endpoint, $class, $ipAddress)
|
193 |
{
|
194 |
-
$path = implode('/',
|
195 |
|
196 |
try {
|
197 |
$body = $this->client->get('GeoIP2 ' . $class, $path);
|
@@ -236,7 +232,8 @@ class Client implements ProviderInterface
|
|
236 |
);
|
237 |
}
|
238 |
|
239 |
-
$class =
|
|
|
240 |
return new $class($body, $this->locales);
|
241 |
}
|
242 |
}
|
9 |
use GeoIp2\Exception\InvalidRequestException;
|
10 |
use GeoIp2\Exception\OutOfQueriesException;
|
11 |
use GeoIp2\ProviderInterface;
|
|
|
12 |
use MaxMind\WebService\Client as WsClient;
|
13 |
|
14 |
/**
|
47 |
private $client;
|
48 |
private static $basePath = '/geoip/v2.1';
|
49 |
|
50 |
+
const VERSION = 'v2.6.0';
|
51 |
|
52 |
/**
|
53 |
* Constructor.
|
54 |
*
|
55 |
+
* @param int $userId your MaxMind user ID
|
56 |
+
* @param string $licenseKey your MaxMind license key
|
57 |
+
* @param array $locales list of locale codes to use in name property
|
58 |
+
* from most preferred to least preferred
|
59 |
+
* @param array $options array of options. Valid options include:
|
60 |
+
* * `host` - The host to use when querying the web service.
|
61 |
+
* * `timeout` - Timeout in seconds.
|
62 |
+
* * `connectTimeout` - Initial connection timeout in seconds.
|
63 |
+
* * `proxy` - The HTTP proxy to use. May include a schema, port,
|
64 |
+
* username, and password, e.g.,
|
65 |
+
* `http://username:password@127.0.0.1:10`.
|
66 |
*/
|
67 |
public function __construct(
|
68 |
$userId,
|
69 |
$licenseKey,
|
70 |
+
$locales = ['en'],
|
71 |
+
$options = []
|
72 |
) {
|
73 |
$this->locales = $locales;
|
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 |
|
81 |
if (!isset($options['host'])) {
|
89 |
|
90 |
private function userAgent()
|
91 |
{
|
92 |
+
return 'GeoIP2-API/' . self::VERSION;
|
93 |
}
|
94 |
|
95 |
/**
|
96 |
* This method calls the GeoIP2 Precision: City service.
|
97 |
*
|
98 |
* @param string $ipAddress IPv4 or IPv6 address as a string. If no
|
99 |
+
* address is provided, the address that the web service is called
|
100 |
+
* from will be used.
|
|
|
|
|
101 |
*
|
102 |
* @throws \GeoIp2\Exception\AddressNotFoundException if the address you
|
103 |
+
* provided is not in our database (e.g., a private address).
|
104 |
+
* @throws \GeoIp2\Exception\AuthenticationException if there is a problem
|
105 |
+
* with the user ID or license key that you provided
|
106 |
+
* @throws \GeoIp2\Exception\OutOfQueriesException if your account is out
|
107 |
+
* of queries
|
108 |
+
* @throws \GeoIp2\Exception\InvalidRequestException} if your request was received by the web service but is
|
109 |
+
* invalid for some other reason. This may indicate an issue
|
110 |
+
* with this API. Please report the error to MaxMind.
|
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.
|
118 |
+
*
|
119 |
+
* @return \GeoIp2\Model\City
|
120 |
*/
|
121 |
public function city($ipAddress = 'me')
|
122 |
{
|
127 |
* This method calls the GeoIP2 Precision: Country service.
|
128 |
*
|
129 |
* @param string $ipAddress IPv4 or IPv6 address as a string. If no
|
130 |
+
* address is provided, the address that the web service is called
|
131 |
+
* from will be used.
|
132 |
*
|
133 |
+
* @throws \GeoIp2\Exception\AddressNotFoundException if the address you provided is not in our database (e.g.,
|
134 |
+
* a private address).
|
135 |
+
* @throws \GeoIp2\Exception\AuthenticationException if there is a problem
|
136 |
+
* with the user ID or license key that you provided
|
137 |
+
* @throws \GeoIp2\Exception\OutOfQueriesException if your account is out of queries
|
138 |
+
* @throws \GeoIp2\Exception\InvalidRequestException} if your request was received by the web service but is
|
139 |
+
* invalid for some other reason. This may indicate an
|
140 |
+
* issue with this API. Please report the error to MaxMind.
|
141 |
+
* @throws \GeoIp2\Exception\HttpException if an unexpected HTTP error
|
142 |
+
* code or message was returned. This could indicate a problem
|
143 |
+
* with the connection between your server and the web service
|
144 |
+
* or that the web service returned an invalid document or 500
|
145 |
+
* error code.
|
146 |
+
* @throws \GeoIp2\Exception\GeoIp2Exception This serves as the parent class to the above exceptions. It
|
147 |
+
* will be thrown directly if a 200 status code is returned but
|
148 |
+
* the body is invalid.
|
149 |
*
|
150 |
+
* @return \GeoIp2\Model\Country
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
151 |
*/
|
152 |
public function country($ipAddress = 'me')
|
153 |
{
|
158 |
* This method calls the GeoIP2 Precision: Insights service.
|
159 |
*
|
160 |
* @param string $ipAddress IPv4 or IPv6 address as a string. If no
|
161 |
+
* address is provided, the address that the web service is called
|
162 |
+
* from will be used.
|
|
|
|
|
163 |
*
|
164 |
* @throws \GeoIp2\Exception\AddressNotFoundException if the address you
|
165 |
+
* provided is not in our database (e.g., a private address).
|
166 |
+
* @throws \GeoIp2\Exception\AuthenticationException if there is a problem
|
167 |
+
* with the user ID or license key that you provided
|
168 |
+
* @throws \GeoIp2\Exception\OutOfQueriesException if your account is out
|
169 |
+
* of queries
|
170 |
+
* @throws \GeoIp2\Exception\InvalidRequestException} if your request was received by the web service but is
|
171 |
+
* invalid for some other reason. This may indicate an
|
172 |
+
* issue with this API. Please report the error to MaxMind.
|
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.
|
180 |
+
*
|
181 |
+
* @return \GeoIp2\Model\Insights
|
182 |
*/
|
183 |
public function insights($ipAddress = 'me')
|
184 |
{
|
187 |
|
188 |
private function responseFor($endpoint, $class, $ipAddress)
|
189 |
{
|
190 |
+
$path = implode('/', [self::$basePath, $endpoint, $ipAddress]);
|
191 |
|
192 |
try {
|
193 |
$body = $this->client->get('GeoIP2 ' . $class, $path);
|
232 |
);
|
233 |
}
|
234 |
|
235 |
+
$class = 'GeoIp2\\Model\\' . $class;
|
236 |
+
|
237 |
return new $class($body, $this->locales);
|
238 |
}
|
239 |
}
|
vendor/maxmind/web-service-common/CHANGELOG.md
CHANGED
@@ -1,6 +1,11 @@
|
|
1 |
CHANGELOG
|
2 |
=========
|
3 |
|
|
|
|
|
|
|
|
|
|
|
4 |
0.3.1 (2016-08-10)
|
5 |
------------------
|
6 |
|
1 |
CHANGELOG
|
2 |
=========
|
3 |
|
4 |
+
0.4.0 (2017-XX-XX)
|
5 |
+
------------------
|
6 |
+
|
7 |
+
* PHP 5.4 is now required.
|
8 |
+
|
9 |
0.3.1 (2016-08-10)
|
10 |
------------------
|
11 |
|
vendor/maxmind/web-service-common/README.md
CHANGED
@@ -5,8 +5,8 @@ shared code between MaxMind's various web service APIs.
|
|
5 |
|
6 |
## Requirements ##
|
7 |
|
8 |
-
|
9 |
-
|
10 |
|
11 |
There are several other dependencies as defined in the `composer.json` file.
|
12 |
|
@@ -21,6 +21,6 @@ This API uses [Semantic Versioning](http://semver.org/).
|
|
21 |
|
22 |
## Copyright and License ##
|
23 |
|
24 |
-
This software is Copyright (c) 2015 by MaxMind, Inc.
|
25 |
|
26 |
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-2017 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
@@ -2,7 +2,7 @@
|
|
2 |
"name": "maxmind/web-service-common",
|
3 |
"description": "Internal MaxMind Web Service API",
|
4 |
"minimum-stability": "stable",
|
5 |
-
"homepage": "https://github.com/maxmind/
|
6 |
"type": "library",
|
7 |
"license": "Apache-2.0",
|
8 |
"authors": [
|
@@ -12,18 +12,20 @@
|
|
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 |
"phpunit/phpunit": "4.*",
|
22 |
-
"squizlabs/php_codesniffer": "
|
23 |
},
|
24 |
"autoload": {
|
25 |
"psr-4": {
|
26 |
-
"MaxMind\\": "src"
|
|
|
27 |
}
|
28 |
}
|
29 |
}
|
2 |
"name": "maxmind/web-service-common",
|
3 |
"description": "Internal MaxMind Web Service API",
|
4 |
"minimum-stability": "stable",
|
5 |
+
"homepage": "https://github.com/maxmind/web-service-common-php",
|
6 |
"type": "library",
|
7 |
"license": "Apache-2.0",
|
8 |
"authors": [
|
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": {
|
26 |
"psr-4": {
|
27 |
+
"MaxMind\\Exception\\": "src/Exception",
|
28 |
+
"MaxMind\\WebService\\": "src/WebService"
|
29 |
}
|
30 |
}
|
31 |
}
|
vendor/maxmind/web-service-common/src/Exception/AuthenticationException.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
namespace MaxMind\Exception;
|
4 |
|
5 |
/**
|
6 |
-
* This class represents an error authenticating
|
7 |
*/
|
8 |
class AuthenticationException extends InvalidRequestException
|
9 |
{
|
3 |
namespace MaxMind\Exception;
|
4 |
|
5 |
/**
|
6 |
+
* This class represents an error authenticating.
|
7 |
*/
|
8 |
class AuthenticationException extends InvalidRequestException
|
9 |
{
|
vendor/maxmind/web-service-common/src/Exception/HttpException.php
CHANGED
@@ -8,15 +8,15 @@ namespace MaxMind\Exception;
|
|
8 |
class HttpException extends WebServiceException
|
9 |
{
|
10 |
/**
|
11 |
-
* The URI queried
|
12 |
*/
|
13 |
private $uri;
|
14 |
|
15 |
/**
|
16 |
-
* @param string
|
17 |
-
* @param int
|
18 |
-
* @param string
|
19 |
-
* @param \Exception $previous
|
20 |
*/
|
21 |
public function __construct(
|
22 |
$message,
|
8 |
class HttpException extends WebServiceException
|
9 |
{
|
10 |
/**
|
11 |
+
* The URI queried.
|
12 |
*/
|
13 |
private $uri;
|
14 |
|
15 |
/**
|
16 |
+
* @param string $message a message describing the error
|
17 |
+
* @param int $httpStatus the HTTP status code of the response
|
18 |
+
* @param string $uri the URI used in the request
|
19 |
+
* @param \Exception $previous the previous exception, if any
|
20 |
*/
|
21 |
public function __construct(
|
22 |
$message,
|
vendor/maxmind/web-service-common/src/Exception/InvalidRequestException.php
CHANGED
@@ -8,16 +8,16 @@ namespace MaxMind\Exception;
|
|
8 |
class InvalidRequestException extends HttpException
|
9 |
{
|
10 |
/**
|
11 |
-
* The code returned by the MaxMind web service
|
12 |
*/
|
13 |
private $error;
|
14 |
|
15 |
/**
|
16 |
-
* @param string
|
17 |
-
* @param int
|
18 |
-
* @param int
|
19 |
-
* @param string
|
20 |
-
* @param \Exception $previous
|
21 |
*/
|
22 |
public function __construct(
|
23 |
$message,
|
8 |
class InvalidRequestException extends HttpException
|
9 |
{
|
10 |
/**
|
11 |
+
* The code returned by the MaxMind web service.
|
12 |
*/
|
13 |
private $error;
|
14 |
|
15 |
/**
|
16 |
+
* @param string $message the exception message
|
17 |
+
* @param int $error the error code returned by the MaxMind web service
|
18 |
+
* @param int $httpStatus the HTTP status code of the response
|
19 |
+
* @param string $uri the URI queries
|
20 |
+
* @param \Exception $previous the previous exception, if any
|
21 |
*/
|
22 |
public function __construct(
|
23 |
$message,
|
vendor/maxmind/web-service-common/src/WebService/Client.php
CHANGED
@@ -17,7 +17,7 @@ use MaxMind\WebService\Http\RequestFactory;
|
|
17 |
* This class is not intended to be used directly by an end-user of a
|
18 |
* MaxMind web service. Please use the appropriate client API for the service
|
19 |
* that you are using.
|
20 |
-
*
|
21 |
* @internal
|
22 |
*/
|
23 |
class Client
|
@@ -35,22 +35,21 @@ class Client
|
|
35 |
private $userId;
|
36 |
|
37 |
/**
|
38 |
-
* @param int
|
39 |
-
* @param string $licenseKey
|
40 |
-
* @param array
|
41 |
-
*
|
42 |
-
*
|
43 |
-
*
|
44 |
-
*
|
45 |
-
*
|
46 |
-
*
|
47 |
-
*
|
48 |
-
* username, and password, e.g., `http://username:password@127.0.0.1:10`.
|
49 |
*/
|
50 |
public function __construct(
|
51 |
$userId,
|
52 |
$licenseKey,
|
53 |
-
$options =
|
54 |
) {
|
55 |
$this->userId = $userId;
|
56 |
$this->licenseKey = $licenseKey;
|
@@ -83,19 +82,21 @@ class Client
|
|
83 |
|
84 |
/**
|
85 |
* @param string $service name of the service querying
|
86 |
-
* @param string $path
|
87 |
-
* @param array
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
88 |
* @return array The decoded content of a successful response
|
89 |
-
* @throws InvalidInputException when the request has missing or invalid
|
90 |
-
* data.
|
91 |
-
* @throws AuthenticationException when there is an issue authenticating the
|
92 |
-
* request.
|
93 |
-
* @throws InsufficientFundsException when your account is out of funds.
|
94 |
-
* @throws InvalidRequestException when the request is invalid for some
|
95 |
-
* other reason, e.g., invalid JSON in the POST.
|
96 |
-
* @throws HttpException when an unexpected HTTP error occurs.
|
97 |
-
* @throws WebServiceException when some other error occurs. This also
|
98 |
-
* serves as the base class for the above exceptions.
|
99 |
*/
|
100 |
public function post($service, $path, $input)
|
101 |
{
|
@@ -109,10 +110,11 @@ class Client
|
|
109 |
|
110 |
$request = $this->createRequest(
|
111 |
$path,
|
112 |
-
|
113 |
);
|
114 |
|
115 |
list($statusCode, $contentType, $body) = $request->post($body);
|
|
|
116 |
return $this->handleResponse(
|
117 |
$statusCode,
|
118 |
$contentType,
|
@@ -137,15 +139,15 @@ class Client
|
|
137 |
);
|
138 |
}
|
139 |
|
140 |
-
|
141 |
private function userAgent()
|
142 |
{
|
143 |
$curlVersion = curl_version();
|
144 |
-
|
|
|
145 |
' curl/' . $curlVersion['version'];
|
146 |
}
|
147 |
|
148 |
-
private function createRequest($path, $headers =
|
149 |
{
|
150 |
array_push(
|
151 |
$headers,
|
@@ -156,32 +158,34 @@ class Client
|
|
156 |
|
157 |
return $this->httpRequestFactory->request(
|
158 |
$this->urlFor($path),
|
159 |
-
|
160 |
'caBundle' => $this->caBundle,
|
161 |
'connectTimeout' => $this->connectTimeout,
|
162 |
'headers' => $headers,
|
163 |
'proxy' => $this->proxy,
|
164 |
'timeout' => $this->timeout,
|
165 |
'userAgent' => $this->userAgent(),
|
166 |
-
|
167 |
);
|
168 |
}
|
169 |
|
170 |
/**
|
171 |
-
* @param
|
172 |
* @param string $contentType the Content-Type of the response
|
173 |
-
* @param string $body
|
174 |
-
* @param string $service
|
175 |
-
* @param string $path
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
176 |
* @return array The decoded content of a successful response
|
177 |
-
* @throws AuthenticationException when there is an issue authenticating the
|
178 |
-
* request.
|
179 |
-
* @throws InsufficientFundsException when your account is out of funds.
|
180 |
-
* @throws InvalidRequestException when the request is invalid for some
|
181 |
-
* other reason, e.g., invalid JSON in the POST.
|
182 |
-
* @throws HttpException when an unexpected HTTP error occurs.
|
183 |
-
* @throws WebServiceException when some other error occurs. This also
|
184 |
-
* serves as the base class for the above exceptions
|
185 |
*/
|
186 |
private function handleResponse(
|
187 |
$statusCode,
|
@@ -194,9 +198,10 @@ class Client
|
|
194 |
$this->handle4xx($statusCode, $contentType, $body, $service, $path);
|
195 |
} elseif ($statusCode >= 500) {
|
196 |
$this->handle5xx($statusCode, $service, $path);
|
197 |
-
} elseif ($statusCode
|
198 |
$this->handleUnexpectedStatus($statusCode, $service, $path);
|
199 |
}
|
|
|
200 |
return $this->handleSuccess($body, $service);
|
201 |
}
|
202 |
|
@@ -223,8 +228,9 @@ class Client
|
|
223 |
}
|
224 |
|
225 |
/**
|
226 |
-
* @param string $path
|
227 |
-
*
|
|
|
228 |
*/
|
229 |
private function urlFor($path)
|
230 |
{
|
@@ -232,11 +238,12 @@ class Client
|
|
232 |
}
|
233 |
|
234 |
/**
|
235 |
-
* @param int
|
236 |
-
* @param string $contentType
|
237 |
-
* @param string $body
|
238 |
-
* @param string $service
|
239 |
-
* @param string $path
|
|
|
240 |
* @throws AuthenticationException
|
241 |
* @throws HttpException
|
242 |
* @throws InsufficientFundsException
|
@@ -259,7 +266,7 @@ class Client
|
|
259 |
if (!strstr($contentType, 'json')) {
|
260 |
throw new HttpException(
|
261 |
"Received a $statusCode error for $service with " .
|
262 |
-
|
263 |
$statusCode,
|
264 |
$this->urlFor($path)
|
265 |
);
|
@@ -294,10 +301,11 @@ class Client
|
|
294 |
}
|
295 |
|
296 |
/**
|
297 |
-
* @param string $message
|
298 |
-
* @param string $code
|
299 |
-
* @param int
|
300 |
-
* @param string $path
|
|
|
301 |
* @throws AuthenticationException
|
302 |
* @throws InvalidRequestException
|
303 |
* @throws InsufficientFundsException
|
@@ -353,9 +361,10 @@ class Client
|
|
353 |
}
|
354 |
|
355 |
/**
|
356 |
-
* @param int
|
357 |
-
* @param string $service
|
358 |
-
* @param string $path
|
|
|
359 |
* @throws HttpException
|
360 |
*/
|
361 |
private function handle5xx($statusCode, $service, $path)
|
@@ -368,9 +377,10 @@ class Client
|
|
368 |
}
|
369 |
|
370 |
/**
|
371 |
-
* @param int
|
372 |
-
* @param string $service
|
373 |
-
* @param string $path
|
|
|
374 |
* @throws HttpException
|
375 |
*/
|
376 |
private function handleUnexpectedStatus($statusCode, $service, $path)
|
@@ -384,18 +394,20 @@ class Client
|
|
384 |
}
|
385 |
|
386 |
/**
|
387 |
-
* @param string $body
|
388 |
-
* @param string $service
|
389 |
-
*
|
390 |
* @throws WebServiceException if the request body cannot be decoded as
|
391 |
-
*
|
|
|
|
|
392 |
*/
|
393 |
private function handleSuccess($body, $service)
|
394 |
{
|
395 |
-
if (strlen($body)
|
396 |
throw new WebServiceException(
|
397 |
"Received a 200 response for $service but did not " .
|
398 |
-
|
399 |
);
|
400 |
}
|
401 |
|
@@ -417,14 +429,14 @@ class Client
|
|
417 |
|
418 |
// On OS X, when the SSL version is "SecureTransport", the system's
|
419 |
// keychain will be used.
|
420 |
-
if ($curlVersion['ssl_version'] ==='SecureTransport') {
|
421 |
return;
|
422 |
}
|
423 |
$cert = CaBundle::getSystemCaRootBundlePath();
|
424 |
|
425 |
// Check if the cert is inside a phar. If so, we need to copy the cert
|
426 |
// to a temp file so that curl can see it.
|
427 |
-
if (substr($cert, 0, 7)
|
428 |
$tempDir = sys_get_temp_dir();
|
429 |
$newCert = tempnam($tempDir, 'geoip2-');
|
430 |
if ($newCert === false) {
|
@@ -452,6 +464,7 @@ class Client
|
|
452 |
if (!file_exists($cert)) {
|
453 |
throw new \RuntimeException("CA cert does not exist at $cert");
|
454 |
}
|
|
|
455 |
return $cert;
|
456 |
}
|
457 |
}
|
17 |
* This class is not intended to be used directly by an end-user of a
|
18 |
* MaxMind web service. Please use the appropriate client API for the service
|
19 |
* that you are using.
|
20 |
+
*
|
21 |
* @internal
|
22 |
*/
|
23 |
class Client
|
35 |
private $userId;
|
36 |
|
37 |
/**
|
38 |
+
* @param int $userId your MaxMind user ID
|
39 |
+
* @param string $licenseKey your MaxMind license key
|
40 |
+
* @param array $options an array of options. Possible keys:
|
41 |
+
* * `host` - The host to use when connecting to the web service.
|
42 |
+
* * `userAgent` - The prefix of the User-Agent to use in the request.
|
43 |
+
* * `caBundle` - The bundle of CA root certificates to use in the request.
|
44 |
+
* * `connectTimeout` - The connect timeout to use for the request.
|
45 |
+
* * `timeout` - The timeout to use for the request.
|
46 |
+
* * `proxy` - The HTTP proxy to use. May include a schema, port,
|
47 |
+
* username, and password, e.g., `http://username:password@127.0.0.1:10`.
|
|
|
48 |
*/
|
49 |
public function __construct(
|
50 |
$userId,
|
51 |
$licenseKey,
|
52 |
+
$options = []
|
53 |
) {
|
54 |
$this->userId = $userId;
|
55 |
$this->licenseKey = $licenseKey;
|
82 |
|
83 |
/**
|
84 |
* @param string $service name of the service querying
|
85 |
+
* @param string $path the URI path to use
|
86 |
+
* @param array $input the data to be posted as JSON
|
87 |
+
*
|
88 |
+
* @throws InvalidInputException when the request has missing or invalid
|
89 |
+
* data
|
90 |
+
* @throws AuthenticationException when there is an issue authenticating the
|
91 |
+
* request
|
92 |
+
* @throws InsufficientFundsException when your account is out of funds
|
93 |
+
* @throws InvalidRequestException when the request is invalid for some
|
94 |
+
* other reason, e.g., invalid JSON in the POST.
|
95 |
+
* @throws HttpException when an unexpected HTTP error occurs
|
96 |
+
* @throws WebServiceException when some other error occurs. This also
|
97 |
+
* serves as the base class for the above exceptions.
|
98 |
+
*
|
99 |
* @return array The decoded content of a successful response
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
100 |
*/
|
101 |
public function post($service, $path, $input)
|
102 |
{
|
110 |
|
111 |
$request = $this->createRequest(
|
112 |
$path,
|
113 |
+
['Content-Type: application/json']
|
114 |
);
|
115 |
|
116 |
list($statusCode, $contentType, $body) = $request->post($body);
|
117 |
+
|
118 |
return $this->handleResponse(
|
119 |
$statusCode,
|
120 |
$contentType,
|
139 |
);
|
140 |
}
|
141 |
|
|
|
142 |
private function userAgent()
|
143 |
{
|
144 |
$curlVersion = curl_version();
|
145 |
+
|
146 |
+
return $this->userAgentPrefix . 'MaxMind-WS-API/' . self::VERSION . ' PHP/' . PHP_VERSION .
|
147 |
' curl/' . $curlVersion['version'];
|
148 |
}
|
149 |
|
150 |
+
private function createRequest($path, $headers = [])
|
151 |
{
|
152 |
array_push(
|
153 |
$headers,
|
158 |
|
159 |
return $this->httpRequestFactory->request(
|
160 |
$this->urlFor($path),
|
161 |
+
[
|
162 |
'caBundle' => $this->caBundle,
|
163 |
'connectTimeout' => $this->connectTimeout,
|
164 |
'headers' => $headers,
|
165 |
'proxy' => $this->proxy,
|
166 |
'timeout' => $this->timeout,
|
167 |
'userAgent' => $this->userAgent(),
|
168 |
+
]
|
169 |
);
|
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
|
181 |
+
* @throws InsufficientFundsException when your account is out of funds
|
182 |
+
* @throws InvalidRequestException when the request is invalid for some
|
183 |
+
* other reason, e.g., invalid JSON in the POST.
|
184 |
+
* @throws HttpException when an unexpected HTTP error occurs
|
185 |
+
* @throws WebServiceException when some other error occurs. This also
|
186 |
+
* serves as the base class for the above exceptions
|
187 |
+
*
|
188 |
* @return array The decoded content of a successful response
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
189 |
*/
|
190 |
private function handleResponse(
|
191 |
$statusCode,
|
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 |
|
228 |
}
|
229 |
|
230 |
/**
|
231 |
+
* @param string $path the path to use in the URL
|
232 |
+
*
|
233 |
+
* @return string the constructed URL
|
234 |
*/
|
235 |
private function urlFor($path)
|
236 |
{
|
238 |
}
|
239 |
|
240 |
/**
|
241 |
+
* @param int $statusCode the HTTP status code
|
242 |
+
* @param string $contentType the response content-type
|
243 |
+
* @param string $body the response body
|
244 |
+
* @param string $service the service name
|
245 |
+
* @param string $path the path used in the request
|
246 |
+
*
|
247 |
* @throws AuthenticationException
|
248 |
* @throws HttpException
|
249 |
* @throws InsufficientFundsException
|
266 |
if (!strstr($contentType, 'json')) {
|
267 |
throw new HttpException(
|
268 |
"Received a $statusCode error for $service with " .
|
269 |
+
'the following body: ' . $body,
|
270 |
$statusCode,
|
271 |
$this->urlFor($path)
|
272 |
);
|
301 |
}
|
302 |
|
303 |
/**
|
304 |
+
* @param string $message the error message from the web service
|
305 |
+
* @param string $code the error code from the web service
|
306 |
+
* @param int $statusCode the HTTP status code
|
307 |
+
* @param string $path the path used in the request
|
308 |
+
*
|
309 |
* @throws AuthenticationException
|
310 |
* @throws InvalidRequestException
|
311 |
* @throws InsufficientFundsException
|
361 |
}
|
362 |
|
363 |
/**
|
364 |
+
* @param int $statusCode the HTTP status code
|
365 |
+
* @param string $service the service name
|
366 |
+
* @param string $path the URI path used in the request
|
367 |
+
*
|
368 |
* @throws HttpException
|
369 |
*/
|
370 |
private function handle5xx($statusCode, $service, $path)
|
377 |
}
|
378 |
|
379 |
/**
|
380 |
+
* @param int $statusCode the HTTP status code
|
381 |
+
* @param string $service the service name
|
382 |
+
* @param string $path the URI path used in the request
|
383 |
+
*
|
384 |
* @throws HttpException
|
385 |
*/
|
386 |
private function handleUnexpectedStatus($statusCode, $service, $path)
|
394 |
}
|
395 |
|
396 |
/**
|
397 |
+
* @param string $body the successful request body
|
398 |
+
* @param string $service the service name
|
399 |
+
*
|
400 |
* @throws WebServiceException if the request body cannot be decoded as
|
401 |
+
* JSON
|
402 |
+
*
|
403 |
+
* @return array the decoded request body
|
404 |
*/
|
405 |
private function handleSuccess($body, $service)
|
406 |
{
|
407 |
+
if (strlen($body) === 0) {
|
408 |
throw new WebServiceException(
|
409 |
"Received a 200 response for $service but did not " .
|
410 |
+
'receive a HTTP body.'
|
411 |
);
|
412 |
}
|
413 |
|
429 |
|
430 |
// On OS X, when the SSL version is "SecureTransport", the system's
|
431 |
// keychain will be used.
|
432 |
+
if ($curlVersion['ssl_version'] === 'SecureTransport') {
|
433 |
return;
|
434 |
}
|
435 |
$cert = CaBundle::getSystemCaRootBundlePath();
|
436 |
|
437 |
// Check if the cert is inside a phar. If so, we need to copy the cert
|
438 |
// to a temp file so that curl can see it.
|
439 |
+
if (substr($cert, 0, 7) === 'phar://') {
|
440 |
$tempDir = sys_get_temp_dir();
|
441 |
$newCert = tempnam($tempDir, 'geoip2-');
|
442 |
if ($newCert === false) {
|
464 |
if (!file_exists($cert)) {
|
465 |
throw new \RuntimeException("CA cert does not exist at $cert");
|
466 |
}
|
467 |
+
|
468 |
return $cert;
|
469 |
}
|
470 |
}
|
vendor/maxmind/web-service-common/src/WebService/Http/CurlRequest.php
CHANGED
@@ -6,7 +6,7 @@ use MaxMind\Exception\HttpException;
|
|
6 |
|
7 |
/**
|
8 |
* This class is for internal use only. Semantic versioning does not not apply.
|
9 |
-
*
|
10 |
* @internal
|
11 |
*/
|
12 |
class CurlRequest implements Request
|
@@ -26,6 +26,7 @@ class CurlRequest implements Request
|
|
26 |
|
27 |
/**
|
28 |
* @param $body
|
|
|
29 |
* @return array
|
30 |
*/
|
31 |
public function post($body)
|
@@ -62,7 +63,6 @@ class CurlRequest implements Request
|
|
62 |
$opts[CURLOPT_SSL_VERIFYPEER] = true;
|
63 |
$opts[CURLOPT_RETURNTRANSFER] = true;
|
64 |
|
65 |
-
|
66 |
$opts[CURLOPT_HTTPHEADER] = $this->options['headers'];
|
67 |
$opts[CURLOPT_USERAGENT] = $this->options['userAgent'];
|
68 |
$opts[CURLOPT_PROXY] = $this->options['proxy'];
|
@@ -84,6 +84,7 @@ class CurlRequest implements Request
|
|
84 |
}
|
85 |
|
86 |
curl_setopt_array($curl, $opts);
|
|
|
87 |
return $curl;
|
88 |
}
|
89 |
|
@@ -104,6 +105,6 @@ class CurlRequest implements Request
|
|
104 |
$contentType = curl_getinfo($curl, CURLINFO_CONTENT_TYPE);
|
105 |
curl_close($curl);
|
106 |
|
107 |
-
return
|
108 |
}
|
109 |
}
|
6 |
|
7 |
/**
|
8 |
* This class is for internal use only. Semantic versioning does not not apply.
|
9 |
+
*
|
10 |
* @internal
|
11 |
*/
|
12 |
class CurlRequest implements Request
|
26 |
|
27 |
/**
|
28 |
* @param $body
|
29 |
+
*
|
30 |
* @return array
|
31 |
*/
|
32 |
public function post($body)
|
63 |
$opts[CURLOPT_SSL_VERIFYPEER] = true;
|
64 |
$opts[CURLOPT_RETURNTRANSFER] = true;
|
65 |
|
|
|
66 |
$opts[CURLOPT_HTTPHEADER] = $this->options['headers'];
|
67 |
$opts[CURLOPT_USERAGENT] = $this->options['userAgent'];
|
68 |
$opts[CURLOPT_PROXY] = $this->options['proxy'];
|
84 |
}
|
85 |
|
86 |
curl_setopt_array($curl, $opts);
|
87 |
+
|
88 |
return $curl;
|
89 |
}
|
90 |
|
105 |
$contentType = curl_getinfo($curl, CURLINFO_CONTENT_TYPE);
|
106 |
curl_close($curl);
|
107 |
|
108 |
+
return [$statusCode, $contentType, $body];
|
109 |
}
|
110 |
}
|
vendor/maxmind/web-service-common/src/WebService/Http/Request.php
CHANGED
@@ -3,8 +3,8 @@
|
|
3 |
namespace MaxMind\WebService\Http;
|
4 |
|
5 |
/**
|
6 |
-
* Interface Request
|
7 |
-
*
|
8 |
* @internal
|
9 |
*/
|
10 |
interface Request
|
@@ -17,6 +17,7 @@ interface Request
|
|
17 |
|
18 |
/**
|
19 |
* @param $body
|
|
|
20 |
* @return mixed
|
21 |
*/
|
22 |
public function post($body);
|
3 |
namespace MaxMind\WebService\Http;
|
4 |
|
5 |
/**
|
6 |
+
* Interface Request.
|
7 |
+
*
|
8 |
* @internal
|
9 |
*/
|
10 |
interface Request
|
17 |
|
18 |
/**
|
19 |
* @param $body
|
20 |
+
*
|
21 |
* @return mixed
|
22 |
*/
|
23 |
public function post($body);
|
vendor/maxmind/web-service-common/src/WebService/Http/RequestFactory.php
CHANGED
@@ -3,8 +3,8 @@
|
|
3 |
namespace MaxMind\WebService\Http;
|
4 |
|
5 |
/**
|
6 |
-
* Class RequestFactory
|
7 |
-
*
|
8 |
* @internal
|
9 |
*/
|
10 |
class RequestFactory
|
@@ -16,6 +16,7 @@ class RequestFactory
|
|
16 |
/**
|
17 |
* @param $url
|
18 |
* @param $options
|
|
|
19 |
* @return CurlRequest
|
20 |
*/
|
21 |
public function request($url, $options)
|
3 |
namespace MaxMind\WebService\Http;
|
4 |
|
5 |
/**
|
6 |
+
* Class RequestFactory.
|
7 |
+
*
|
8 |
* @internal
|
9 |
*/
|
10 |
class RequestFactory
|
16 |
/**
|
17 |
* @param $url
|
18 |
* @param $options
|
19 |
+
*
|
20 |
* @return CurlRequest
|
21 |
*/
|
22 |
public function request($url, $options)
|