From 803d0ca6dde4b12941e8a2bda181e34b863d6b7e Mon Sep 17 00:00:00 2001 From: Anton Evers Date: Thu, 17 Aug 2017 18:58:54 +0600 Subject: [PATCH 01/12] add subnet mask IP support for maintenance mode --- composer.json | 3 +- composer.lock | 534 +++++++++++------- .../Magento/Framework/App/MaintenanceMode.php | 18 +- lib/internal/Magento/Framework/composer.json | 3 +- .../Magento/Setup/Validator/IpValidator.php | 34 +- 5 files changed, 369 insertions(+), 223 deletions(-) diff --git a/composer.json b/composer.json index a77d6fda4e1a1..b5be8b3b70e78 100644 --- a/composer.json +++ b/composer.json @@ -75,7 +75,8 @@ "zendframework/zend-text": "^2.6.0", "zendframework/zend-uri": "^2.5.1", "zendframework/zend-validator": "^2.6.0", - "zendframework/zend-view": "^2.8.1" + "zendframework/zend-view": "^2.8.1", + "darsyn/ip": "^3.3" }, "require-dev": { "friendsofphp/php-cs-fixer": "~2.1.1", diff --git a/composer.lock b/composer.lock index 21e15ba5b503b..f5ca9e9a01174 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,8 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "be29f60dd35aa15f9407897dc3fe303c", + "hash": "5037e3acde39ddc448dbfc6caae9b1d1", + "content-hash": "ab523bf1ee680cb995e3421628ea27c2", "packages": [ { "name": "braintree/braintree_php", @@ -51,7 +52,7 @@ } ], "description": "Braintree PHP Client Library", - "time": "2017-02-16T19:59:04+00:00" + "time": "2017-02-16 19:59:04" }, { "name": "colinmollenhour/cache-backend-file", @@ -87,7 +88,7 @@ ], "description": "The stock Zend_Cache_Backend_File backend has extremely poor performance for cleaning by tags making it become unusable as the number of cached items increases. This backend makes many changes resulting in a huge performance boost, especially for tag cleaning.", "homepage": "https://github.com/colinmollenhour/Cm_Cache_Backend_File", - "time": "2016-05-02T16:24:47+00:00" + "time": "2016-05-02 16:24:47" }, { "name": "colinmollenhour/cache-backend-redis", @@ -123,7 +124,7 @@ ], "description": "Zend_Cache backend using Redis with full support for tags.", "homepage": "https://github.com/colinmollenhour/Cm_Cache_Backend_Redis", - "time": "2017-03-25T04:54:24+00:00" + "time": "2017-03-25 04:54:24" }, { "name": "colinmollenhour/credis", @@ -162,7 +163,7 @@ ], "description": "Credis is a lightweight interface to the Redis key-value store which wraps the phpredis library when available for better performance.", "homepage": "https://github.com/colinmollenhour/credis", - "time": "2015-11-28T01:20:04+00:00" + "time": "2015-11-28 01:20:04" }, { "name": "colinmollenhour/php-redis-session-abstract", @@ -199,7 +200,7 @@ ], "description": "A Redis-based session handler with optimistic locking", "homepage": "https://github.com/colinmollenhour/php-redis-session-abstract", - "time": "2017-04-19T14:21:43+00:00" + "time": "2017-04-19 14:21:43" }, { "name": "composer/ca-bundle", @@ -258,7 +259,7 @@ "ssl", "tls" ], - "time": "2017-09-11T07:24:36+00:00" + "time": "2017-09-11 07:24:36" }, { "name": "composer/composer", @@ -335,7 +336,7 @@ "dependency", "package" ], - "time": "2017-03-10T08:29:45+00:00" + "time": "2017-03-10 08:29:45" }, { "name": "composer/semver", @@ -397,7 +398,7 @@ "validation", "versioning" ], - "time": "2016-08-30T16:08:34+00:00" + "time": "2016-08-30 16:08:34" }, { "name": "composer/spdx-licenses", @@ -458,7 +459,7 @@ "spdx", "validator" ], - "time": "2017-04-03T19:08:52+00:00" + "time": "2017-04-03 19:08:52" }, { "name": "container-interop/container-interop", @@ -489,20 +490,69 @@ ], "description": "Promoting the interoperability of container objects (DIC, SL, etc.)", "homepage": "https://github.com/container-interop/container-interop", - "time": "2017-02-14T19:40:03+00:00" + "time": "2017-02-14 19:40:03" + }, + { + "name": "darsyn/ip", + "version": "3.3.1", + "source": { + "type": "git", + "url": "https://github.com/darsyn/ip.git", + "reference": "cbd2f7ec59f34b6fe698486cad7e460e2ab33ee9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/darsyn/ip/zipball/cbd2f7ec59f34b6fe698486cad7e460e2ab33ee9", + "reference": "cbd2f7ec59f34b6fe698486cad7e460e2ab33ee9", + "shasum": "" + }, + "require": { + "php": ">=5.5" + }, + "suggest": { + "doctrine/dbal": "to use IP as a column type" + }, + "type": "library", + "autoload": { + "psr-4": { + "Darsyn\\IP\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Zander Baldwin", + "email": "hello@zanderbaldwin.com", + "homepage": "http://zanderbaldwin.com" + } + ], + "description": "An immutable IP Address value object that provides several different notations, including helper functions.", + "homepage": "https://github.com/darsyn/ip", + "keywords": [ + "IP", + "immutable", + "ipv4", + "ipv6", + "library", + "value-object" + ], + "time": "2017-08-03 13:09:45" }, { "name": "justinrainbow/json-schema", - "version": "5.2.1", + "version": "5.2.6", "source": { "type": "git", "url": "https://github.com/justinrainbow/json-schema.git", - "reference": "429be236f296ca249d61c65649cdf2652f4a5e80" + "reference": "d283e11b6e14c6f4664cf080415c4341293e5bbd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/justinrainbow/json-schema/zipball/429be236f296ca249d61c65649cdf2652f4a5e80", - "reference": "429be236f296ca249d61c65649cdf2652f4a5e80", + "url": "https://api.github.com/repos/justinrainbow/json-schema/zipball/d283e11b6e14c6f4664cf080415c4341293e5bbd", + "reference": "d283e11b6e14c6f4664cf080415c4341293e5bbd", "shasum": "" }, "require": { @@ -511,7 +561,6 @@ "require-dev": { "friendsofphp/php-cs-fixer": "^2.1", "json-schema/json-schema-test-suite": "1.2.0", - "phpdocumentor/phpdocumentor": "^2.7", "phpunit/phpunit": "^4.8.22" }, "bin": [ @@ -556,7 +605,7 @@ "json", "schema" ], - "time": "2017-05-16T21:06:09+00:00" + "time": "2017-10-21 13:15:38" }, { "name": "league/climate", @@ -605,7 +654,7 @@ "php", "terminal" ], - "time": "2015-01-18T14:31:58+00:00" + "time": "2015-01-18 14:31:58" }, { "name": "magento/composer", @@ -641,7 +690,7 @@ "AFL-3.0" ], "description": "Magento composer library helps to instantiate Composer application and run composer commands.", - "time": "2017-04-24T09:57:02+00:00" + "time": "2017-04-24 09:57:02" }, { "name": "magento/magento-composer-installer", @@ -720,7 +769,7 @@ "composer-installer", "magento" ], - "time": "2016-10-06T16:05:07+00:00" + "time": "2016-10-06 16:05:07" }, { "name": "magento/zendframework1", @@ -767,7 +816,7 @@ "ZF1", "framework" ], - "time": "2017-06-21T14:56:23+00:00" + "time": "2017-06-21 14:56:23" }, { "name": "monolog/monolog", @@ -845,7 +894,7 @@ "logging", "psr-3" ], - "time": "2017-06-19T01:22:40+00:00" + "time": "2017-06-19 01:22:40" }, { "name": "oyejorge/less.php", @@ -907,20 +956,20 @@ "php", "stylesheet" ], - "time": "2017-03-28T22:19:25+00:00" + "time": "2017-03-28 22:19:25" }, { "name": "paragonie/random_compat", - "version": "v2.0.10", + "version": "v2.0.11", "source": { "type": "git", "url": "https://github.com/paragonie/random_compat.git", - "reference": "634bae8e911eefa89c1abfbf1b66da679ac8f54d" + "reference": "5da4d3c796c275c55f057af5a643ae297d96b4d8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/paragonie/random_compat/zipball/634bae8e911eefa89c1abfbf1b66da679ac8f54d", - "reference": "634bae8e911eefa89c1abfbf1b66da679ac8f54d", + "url": "https://api.github.com/repos/paragonie/random_compat/zipball/5da4d3c796c275c55f057af5a643ae297d96b4d8", + "reference": "5da4d3c796c275c55f057af5a643ae297d96b4d8", "shasum": "" }, "require": { @@ -955,7 +1004,7 @@ "pseudorandom", "random" ], - "time": "2017-03-13T16:27:32+00:00" + "time": "2017-09-27 21:40:39" }, { "name": "pelago/emogrifier", @@ -1015,20 +1064,20 @@ ], "description": "Converts CSS styles into inline style attributes in your HTML code", "homepage": "http://www.pelagodesign.com/sidecar/emogrifier/", - "time": "2017-03-02T12:51:48+00:00" + "time": "2017-03-02 12:51:48" }, { "name": "phpseclib/phpseclib", - "version": "2.0.6", + "version": "2.0.7", "source": { "type": "git", "url": "https://github.com/phpseclib/phpseclib.git", - "reference": "34a7699e6f31b1ef4035ee36444407cecf9f56aa" + "reference": "f4b6a522dfa1fd1e477c9cfe5909d5b31f098c0b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/34a7699e6f31b1ef4035ee36444407cecf9f56aa", - "reference": "34a7699e6f31b1ef4035ee36444407cecf9f56aa", + "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/f4b6a522dfa1fd1e477c9cfe5909d5b31f098c0b", + "reference": "f4b6a522dfa1fd1e477c9cfe5909d5b31f098c0b", "shasum": "" }, "require": { @@ -1107,7 +1156,7 @@ "x.509", "x509" ], - "time": "2017-06-05T06:31:10+00:00" + "time": "2017-10-23 05:04:54" }, { "name": "psr/container", @@ -1156,7 +1205,7 @@ "container-interop", "psr" ], - "time": "2017-02-14T16:28:37+00:00" + "time": "2017-02-14 16:28:37" }, { "name": "psr/log", @@ -1203,7 +1252,7 @@ "psr", "psr-3" ], - "time": "2016-10-10T12:19:37+00:00" + "time": "2016-10-10 12:19:37" }, { "name": "ramsey/uuid", @@ -1285,7 +1334,7 @@ "identifier", "uuid" ], - "time": "2017-03-26T20:37:53+00:00" + "time": "2017-03-26 20:37:53" }, { "name": "seld/cli-prompt", @@ -1333,7 +1382,7 @@ "input", "prompt" ], - "time": "2017-03-18T11:32:45+00:00" + "time": "2017-03-18 11:32:45" }, { "name": "seld/jsonlint", @@ -1382,7 +1431,7 @@ "parser", "validator" ], - "time": "2017-06-18T15:11:04+00:00" + "time": "2017-06-18 15:11:04" }, { "name": "seld/phar-utils", @@ -1426,7 +1475,7 @@ "keywords": [ "phra" ], - "time": "2015-10-13T18:44:15+00:00" + "time": "2015-10-13 18:44:15" }, { "name": "sjparkinson/static-review", @@ -1479,20 +1528,20 @@ } ], "description": "An extendable framework for version control hooks.", - "time": "2014-09-22T08:40:36+00:00" + "time": "2014-09-22 08:40:36" }, { "name": "symfony/console", - "version": "v2.8.27", + "version": "v2.8.28", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "c0807a2ca978e64d8945d373a9221a5c35d1a253" + "reference": "f81549d2c5fdee8d711c9ab3c7e7362353ea5853" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/c0807a2ca978e64d8945d373a9221a5c35d1a253", - "reference": "c0807a2ca978e64d8945d373a9221a5c35d1a253", + "url": "https://api.github.com/repos/symfony/console/zipball/f81549d2c5fdee8d711c9ab3c7e7362353ea5853", + "reference": "f81549d2c5fdee8d711c9ab3c7e7362353ea5853", "shasum": "" }, "require": { @@ -1540,7 +1589,7 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2017-08-27T14:29:03+00:00" + "time": "2017-10-01 21:00:16" }, { "name": "symfony/debug", @@ -1597,20 +1646,20 @@ ], "description": "Symfony Debug Component", "homepage": "https://symfony.com", - "time": "2016-07-30T07:22:48+00:00" + "time": "2016-07-30 07:22:48" }, { "name": "symfony/event-dispatcher", - "version": "v2.8.27", + "version": "v2.8.28", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "1377400fd641d7d1935981546aaef780ecd5bf6d" + "reference": "7fe089232554357efb8d4af65ce209fc6e5a2186" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/1377400fd641d7d1935981546aaef780ecd5bf6d", - "reference": "1377400fd641d7d1935981546aaef780ecd5bf6d", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/7fe089232554357efb8d4af65ce209fc6e5a2186", + "reference": "7fe089232554357efb8d4af65ce209fc6e5a2186", "shasum": "" }, "require": { @@ -1657,20 +1706,20 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", - "time": "2017-06-02T07:47:27+00:00" + "time": "2017-10-01 21:00:16" }, { "name": "symfony/filesystem", - "version": "v3.3.9", + "version": "v3.3.10", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "b32a0e5f928d0fa3d1dd03c78d020777e50c10cb" + "reference": "90bc45abf02ae6b7deb43895c1052cb0038506f1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/b32a0e5f928d0fa3d1dd03c78d020777e50c10cb", - "reference": "b32a0e5f928d0fa3d1dd03c78d020777e50c10cb", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/90bc45abf02ae6b7deb43895c1052cb0038506f1", + "reference": "90bc45abf02ae6b7deb43895c1052cb0038506f1", "shasum": "" }, "require": { @@ -1706,20 +1755,20 @@ ], "description": "Symfony Filesystem Component", "homepage": "https://symfony.com", - "time": "2017-07-29T21:54:42+00:00" + "time": "2017-10-03 13:33:10" }, { "name": "symfony/finder", - "version": "v3.3.9", + "version": "v3.3.10", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "b2260dbc80f3c4198f903215f91a1ac7fe9fe09e" + "reference": "773e19a491d97926f236942484cb541560ce862d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/b2260dbc80f3c4198f903215f91a1ac7fe9fe09e", - "reference": "b2260dbc80f3c4198f903215f91a1ac7fe9fe09e", + "url": "https://api.github.com/repos/symfony/finder/zipball/773e19a491d97926f236942484cb541560ce862d", + "reference": "773e19a491d97926f236942484cb541560ce862d", "shasum": "" }, "require": { @@ -1755,20 +1804,20 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2017-07-29T21:54:42+00:00" + "time": "2017-10-02 06:42:24" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.5.0", + "version": "v1.6.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "7c8fae0ac1d216eb54349e6a8baa57d515fe8803" + "reference": "2ec8b39c38cb16674bbf3fea2b6ce5bf117e1296" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/7c8fae0ac1d216eb54349e6a8baa57d515fe8803", - "reference": "7c8fae0ac1d216eb54349e6a8baa57d515fe8803", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/2ec8b39c38cb16674bbf3fea2b6ce5bf117e1296", + "reference": "2ec8b39c38cb16674bbf3fea2b6ce5bf117e1296", "shasum": "" }, "require": { @@ -1780,7 +1829,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.5-dev" + "dev-master": "1.6-dev" } }, "autoload": { @@ -1814,20 +1863,20 @@ "portable", "shim" ], - "time": "2017-06-14T15:44:48+00:00" + "time": "2017-10-11 12:05:26" }, { "name": "symfony/process", - "version": "v2.8.27", + "version": "v2.8.28", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "57e52a0a6a80ea0aec4fc1b785a7920a95cb88a8" + "reference": "26c9fb02bf06bd6b90f661a5bd17e510810d0176" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/57e52a0a6a80ea0aec4fc1b785a7920a95cb88a8", - "reference": "57e52a0a6a80ea0aec4fc1b785a7920a95cb88a8", + "url": "https://api.github.com/repos/symfony/process/zipball/26c9fb02bf06bd6b90f661a5bd17e510810d0176", + "reference": "26c9fb02bf06bd6b90f661a5bd17e510810d0176", "shasum": "" }, "require": { @@ -1863,7 +1912,7 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2017-07-03T08:04:30+00:00" + "time": "2017-10-01 21:00:16" }, { "name": "tedivm/jshrink", @@ -1909,7 +1958,7 @@ "javascript", "minifier" ], - "time": "2015-07-04T07:35:09+00:00" + "time": "2015-07-04 07:35:09" }, { "name": "tubalmartin/cssmin", @@ -1962,7 +2011,7 @@ "minify", "yui" ], - "time": "2017-05-16T13:45:26+00:00" + "time": "2017-05-16 13:45:26" }, { "name": "zendframework/zend-captcha", @@ -2019,7 +2068,7 @@ "captcha", "zf2" ], - "time": "2017-02-23T08:09:44+00:00" + "time": "2017-02-23 08:09:44" }, { "name": "zendframework/zend-code", @@ -2072,7 +2121,7 @@ "code", "zf2" ], - "time": "2016-10-24T13:23:32+00:00" + "time": "2016-10-24 13:23:32" }, { "name": "zendframework/zend-config", @@ -2128,7 +2177,7 @@ "config", "zf2" ], - "time": "2016-02-04T23:01:10+00:00" + "time": "2016-02-04 23:01:10" }, { "name": "zendframework/zend-console", @@ -2180,7 +2229,7 @@ "console", "zf2" ], - "time": "2016-02-09T17:15:12+00:00" + "time": "2016-02-09 17:15:12" }, { "name": "zendframework/zend-crypt", @@ -2230,7 +2279,7 @@ "crypt", "zf2" ], - "time": "2016-02-03T23:46:30+00:00" + "time": "2016-02-03 23:46:30" }, { "name": "zendframework/zend-db", @@ -2287,7 +2336,7 @@ "db", "zf2" ], - "time": "2016-08-09T19:28:55+00:00" + "time": "2016-08-09 19:28:55" }, { "name": "zendframework/zend-di", @@ -2334,7 +2383,7 @@ "di", "zf2" ], - "time": "2016-04-25T20:58:11+00:00" + "time": "2016-04-25 20:58:11" }, { "name": "zendframework/zend-escaper", @@ -2378,7 +2427,7 @@ "escaper", "zf2" ], - "time": "2016-06-30T19:48:38+00:00" + "time": "2016-06-30 19:48:38" }, { "name": "zendframework/zend-eventmanager", @@ -2425,7 +2474,7 @@ "eventmanager", "zf2" ], - "time": "2016-02-18T20:49:05+00:00" + "time": "2016-02-18 20:49:05" }, { "name": "zendframework/zend-filter", @@ -2485,7 +2534,7 @@ "filter", "zf2" ], - "time": "2017-05-17T20:56:17+00:00" + "time": "2017-05-17 20:56:17" }, { "name": "zendframework/zend-form", @@ -2562,39 +2611,39 @@ "form", "zf2" ], - "time": "2017-05-18T14:59:53+00:00" + "time": "2017-05-18 14:59:53" }, { "name": "zendframework/zend-http", - "version": "2.6.0", + "version": "2.7.0", "source": { "type": "git", "url": "https://github.com/zendframework/zend-http.git", - "reference": "09f4d279f46d86be63171ff62ee0f79eca878678" + "reference": "78aa510c0ea64bfb2aa234f50c4f232c9531acfa" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-http/zipball/09f4d279f46d86be63171ff62ee0f79eca878678", - "reference": "09f4d279f46d86be63171ff62ee0f79eca878678", + "url": "https://api.github.com/repos/zendframework/zend-http/zipball/78aa510c0ea64bfb2aa234f50c4f232c9531acfa", + "reference": "78aa510c0ea64bfb2aa234f50c4f232c9531acfa", "shasum": "" }, "require": { - "php": "^5.5 || ^7.0", - "zendframework/zend-loader": "^2.5", - "zendframework/zend-stdlib": "^2.5 || ^3.0", - "zendframework/zend-uri": "^2.5", - "zendframework/zend-validator": "^2.5" + "php": "^5.6 || ^7.0", + "zendframework/zend-loader": "^2.5.1", + "zendframework/zend-stdlib": "^3.1 || ^2.7.7", + "zendframework/zend-uri": "^2.5.2", + "zendframework/zend-validator": "^2.10.1" }, "require-dev": { - "phpunit/phpunit": "^4.0", + "phpunit/phpunit": "^6.4.1 || ^5.7.15", "zendframework/zend-coding-standard": "~1.0.0", - "zendframework/zend-config": "^2.5" + "zendframework/zend-config": "^3.1 || ^2.6" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.6-dev", - "dev-develop": "2.7-dev" + "dev-master": "2.7-dev", + "dev-develop": "2.8-dev" } }, "autoload": { @@ -2609,10 +2658,13 @@ "description": "provides an easy interface for performing Hyper-Text Transfer Protocol (HTTP) requests", "homepage": "https://github.com/zendframework/zend-http", "keywords": [ + "ZendFramework", "http", - "zf2" + "http client", + "zend", + "zf" ], - "time": "2017-01-31T14:41:02+00:00" + "time": "2017-10-13 12:06:24" }, { "name": "zendframework/zend-hydrator", @@ -2670,7 +2722,7 @@ "hydrator", "zf2" ], - "time": "2016-02-18T22:38:26+00:00" + "time": "2016-02-18 22:38:26" }, { "name": "zendframework/zend-i18n", @@ -2737,7 +2789,7 @@ "i18n", "zf2" ], - "time": "2017-05-17T17:00:12+00:00" + "time": "2017-05-17 17:00:12" }, { "name": "zendframework/zend-inputfilter", @@ -2792,7 +2844,7 @@ "inputfilter", "zf2" ], - "time": "2017-05-18T14:20:56+00:00" + "time": "2017-05-18 14:20:56" }, { "name": "zendframework/zend-json", @@ -2847,7 +2899,7 @@ "json", "zf2" ], - "time": "2016-02-04T21:20:26+00:00" + "time": "2016-02-04 21:20:26" }, { "name": "zendframework/zend-loader", @@ -2891,7 +2943,7 @@ "loader", "zf2" ], - "time": "2015-06-03T14:05:47+00:00" + "time": "2015-06-03 14:05:47" }, { "name": "zendframework/zend-log", @@ -2962,7 +3014,7 @@ "logging", "zf2" ], - "time": "2017-05-17T16:03:26+00:00" + "time": "2017-05-17 16:03:26" }, { "name": "zendframework/zend-mail", @@ -3024,7 +3076,7 @@ "mail", "zf2" ], - "time": "2017-06-08T20:03:58+00:00" + "time": "2017-06-08 20:03:58" }, { "name": "zendframework/zend-math", @@ -3074,7 +3126,7 @@ "math", "zf2" ], - "time": "2016-04-07T16:29:53+00:00" + "time": "2016-04-07 16:29:53" }, { "name": "zendframework/zend-mime", @@ -3123,7 +3175,7 @@ "mime", "zf2" ], - "time": "2017-01-16T16:43:38+00:00" + "time": "2017-01-16 16:43:38" }, { "name": "zendframework/zend-modulemanager", @@ -3181,7 +3233,7 @@ "modulemanager", "zf2" ], - "time": "2017-07-11T19:39:57+00:00" + "time": "2017-07-11 19:39:57" }, { "name": "zendframework/zend-mvc", @@ -3268,7 +3320,7 @@ "mvc", "zf2" ], - "time": "2016-02-23T15:24:59+00:00" + "time": "2016-02-23 15:24:59" }, { "name": "zendframework/zend-serializer", @@ -3325,7 +3377,7 @@ "serializer", "zf2" ], - "time": "2016-06-21T17:01:55+00:00" + "time": "2016-06-21 17:01:55" }, { "name": "zendframework/zend-server", @@ -3371,7 +3423,7 @@ "server", "zf2" ], - "time": "2016-06-20T22:27:55+00:00" + "time": "2016-06-20 22:27:55" }, { "name": "zendframework/zend-servicemanager", @@ -3423,7 +3475,7 @@ "servicemanager", "zf2" ], - "time": "2016-12-19T19:14:29+00:00" + "time": "2016-12-19 19:14:29" }, { "name": "zendframework/zend-session", @@ -3489,7 +3541,7 @@ "session", "zf2" ], - "time": "2017-06-19T21:31:39+00:00" + "time": "2017-06-19 21:31:39" }, { "name": "zendframework/zend-soap", @@ -3541,7 +3593,7 @@ "soap", "zf2" ], - "time": "2016-04-21T16:06:27+00:00" + "time": "2016-04-21 16:06:27" }, { "name": "zendframework/zend-stdlib", @@ -3600,7 +3652,7 @@ "stdlib", "zf2" ], - "time": "2016-04-12T21:17:31+00:00" + "time": "2016-04-12 21:17:31" }, { "name": "zendframework/zend-text", @@ -3647,7 +3699,7 @@ "text", "zf2" ], - "time": "2016-02-08T19:03:52+00:00" + "time": "2016-02-08 19:03:52" }, { "name": "zendframework/zend-uri", @@ -3694,7 +3746,7 @@ "uri", "zf2" ], - "time": "2016-02-17T22:38:51+00:00" + "time": "2016-02-17 22:38:51" }, { "name": "zendframework/zend-validator", @@ -3765,7 +3817,7 @@ "validator", "zf2" ], - "time": "2017-08-22T14:19:23+00:00" + "time": "2017-08-22 14:19:23" }, { "name": "zendframework/zend-view", @@ -3852,7 +3904,7 @@ "view", "zf2" ], - "time": "2017-03-21T15:05:56+00:00" + "time": "2017-03-21 15:05:56" } ], "packages-dev": [ @@ -3908,7 +3960,7 @@ "constructor", "instantiate" ], - "time": "2015-06-14T21:17:01+00:00" + "time": "2015-06-14 21:17:01" }, { "name": "friendsofphp/php-cs-fixer", @@ -3978,7 +4030,7 @@ } ], "description": "A tool to automatically fix PHP code style", - "time": "2017-03-31T12:59:38+00:00" + "time": "2017-03-31 12:59:38" }, { "name": "ircmaxell/password-compat", @@ -4020,7 +4072,7 @@ "hashing", "password" ], - "time": "2014-11-20T16:49:30+00:00" + "time": "2014-11-20 16:49:30" }, { "name": "lusitanian/oauth", @@ -4087,41 +4139,44 @@ "oauth", "security" ], - "time": "2016-07-12T22:15:40+00:00" + "time": "2016-07-12 22:15:40" }, { "name": "myclabs/deep-copy", - "version": "1.6.1", + "version": "1.7.0", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "8e6e04167378abf1ddb4d3522d8755c5fd90d102" + "reference": "3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/8e6e04167378abf1ddb4d3522d8755c5fd90d102", - "reference": "8e6e04167378abf1ddb4d3522d8755c5fd90d102", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e", + "reference": "3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e", "shasum": "" }, "require": { - "php": ">=5.4.0" + "php": "^5.6 || ^7.0" }, "require-dev": { - "doctrine/collections": "1.*", - "phpunit/phpunit": "~4.1" + "doctrine/collections": "^1.0", + "doctrine/common": "^2.6", + "phpunit/phpunit": "^4.1" }, "type": "library", "autoload": { "psr-4": { "DeepCopy\\": "src/DeepCopy/" - } + }, + "files": [ + "src/DeepCopy/deep_copy.php" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "description": "Create deep copies (clones) of your objects", - "homepage": "https://github.com/myclabs/DeepCopy", "keywords": [ "clone", "copy", @@ -4129,7 +4184,7 @@ "object", "object graph" ], - "time": "2017-04-12T18:52:22+00:00" + "time": "2017-10-19 19:58:43" }, { "name": "pdepend/pdepend", @@ -4169,7 +4224,7 @@ "BSD-3-Clause" ], "description": "Official version of pdepend to be handled with Composer", - "time": "2017-01-19T14:23:36+00:00" + "time": "2017-01-19 14:23:36" }, { "name": "phar-io/manifest", @@ -4224,7 +4279,7 @@ } ], "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", - "time": "2017-03-05T18:14:27+00:00" + "time": "2017-03-05 18:14:27" }, { "name": "phar-io/version", @@ -4271,7 +4326,7 @@ } ], "description": "Library for handling version information and constraints", - "time": "2017-03-05T17:38:23+00:00" + "time": "2017-03-05 17:38:23" }, { "name": "phpdocumentor/reflection-common", @@ -4325,7 +4380,7 @@ "reflection", "static analysis" ], - "time": "2017-09-11T18:02:19+00:00" + "time": "2017-09-11 18:02:19" }, { "name": "phpdocumentor/reflection-docblock", @@ -4370,7 +4425,7 @@ } ], "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "time": "2017-08-30T18:51:59+00:00" + "time": "2017-08-30 18:51:59" }, { "name": "phpdocumentor/type-resolver", @@ -4417,7 +4472,7 @@ "email": "me@mikevanriel.com" } ], - "time": "2017-07-14T14:27:02+00:00" + "time": "2017-07-14 14:27:02" }, { "name": "phpmd/phpmd", @@ -4483,7 +4538,7 @@ "phpmd", "pmd" ], - "time": "2017-01-20T14:41:10+00:00" + "time": "2017-01-20 14:41:10" }, { "name": "phpspec/prophecy", @@ -4546,7 +4601,7 @@ "spy", "stub" ], - "time": "2017-09-04T11:05:03+00:00" + "time": "2017-09-04 11:05:03" }, { "name": "phpunit/php-code-coverage", @@ -4610,7 +4665,7 @@ "testing", "xunit" ], - "time": "2017-08-03T12:40:43+00:00" + "time": "2017-08-03 12:40:43" }, { "name": "phpunit/php-file-iterator", @@ -4657,7 +4712,7 @@ "filesystem", "iterator" ], - "time": "2016-10-03T07:40:28+00:00" + "time": "2016-10-03 07:40:28" }, { "name": "phpunit/php-text-template", @@ -4698,7 +4753,7 @@ "keywords": [ "template" ], - "time": "2015-06-21T13:50:34+00:00" + "time": "2015-06-21 13:50:34" }, { "name": "phpunit/php-timer", @@ -4747,7 +4802,7 @@ "keywords": [ "timer" ], - "time": "2017-02-26T11:10:40+00:00" + "time": "2017-02-26 11:10:40" }, { "name": "phpunit/php-token-stream", @@ -4796,7 +4851,7 @@ "keywords": [ "tokenizer" ], - "time": "2017-08-20T05:47:52+00:00" + "time": "2017-08-20 05:47:52" }, { "name": "phpunit/phpunit", @@ -4880,7 +4935,7 @@ "testing", "xunit" ], - "time": "2017-08-03T13:59:28+00:00" + "time": "2017-08-03 13:59:28" }, { "name": "phpunit/phpunit-mock-objects", @@ -4939,7 +4994,7 @@ "mock", "xunit" ], - "time": "2017-08-03T14:08:16+00:00" + "time": "2017-08-03 14:08:16" }, { "name": "sebastian/code-unit-reverse-lookup", @@ -4984,7 +5039,7 @@ ], "description": "Looks up which function or method a line of code belongs to", "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", - "time": "2017-03-04T06:30:41+00:00" + "time": "2017-03-04 06:30:41" }, { "name": "sebastian/comparator", @@ -5048,7 +5103,7 @@ "compare", "equality" ], - "time": "2017-03-03T06:26:08+00:00" + "time": "2017-03-03 06:26:08" }, { "name": "sebastian/diff", @@ -5100,7 +5155,7 @@ "keywords": [ "diff" ], - "time": "2017-05-22T07:24:03+00:00" + "time": "2017-05-22 07:24:03" }, { "name": "sebastian/environment", @@ -5150,7 +5205,7 @@ "environment", "hhvm" ], - "time": "2017-07-01T08:51:00+00:00" + "time": "2017-07-01 08:51:00" }, { "name": "sebastian/exporter", @@ -5217,7 +5272,7 @@ "export", "exporter" ], - "time": "2017-04-03T13:19:02+00:00" + "time": "2017-04-03 13:19:02" }, { "name": "sebastian/finder-facade", @@ -5256,7 +5311,7 @@ ], "description": "FinderFacade is a convenience wrapper for Symfony's Finder component.", "homepage": "https://github.com/sebastianbergmann/finder-facade", - "time": "2016-02-17T07:02:23+00:00" + "time": "2016-02-17 07:02:23" }, { "name": "sebastian/global-state", @@ -5307,7 +5362,7 @@ "keywords": [ "global state" ], - "time": "2017-04-27T15:39:26+00:00" + "time": "2017-04-27 15:39:26" }, { "name": "sebastian/object-enumerator", @@ -5354,7 +5409,7 @@ ], "description": "Traverses array structures and object graphs to enumerate all referenced objects", "homepage": "https://github.com/sebastianbergmann/object-enumerator/", - "time": "2017-08-03T12:35:26+00:00" + "time": "2017-08-03 12:35:26" }, { "name": "sebastian/object-reflector", @@ -5399,7 +5454,7 @@ ], "description": "Allows reflection of object attributes, including inherited and non-public ones", "homepage": "https://github.com/sebastianbergmann/object-reflector/", - "time": "2017-03-29T09:07:27+00:00" + "time": "2017-03-29 09:07:27" }, { "name": "sebastian/phpcpd", @@ -5450,7 +5505,7 @@ ], "description": "Copy/Paste Detector (CPD) for PHP code.", "homepage": "https://github.com/sebastianbergmann/phpcpd", - "time": "2016-04-17T19:32:49+00:00" + "time": "2016-04-17 19:32:49" }, { "name": "sebastian/recursion-context", @@ -5503,7 +5558,7 @@ ], "description": "Provides functionality to recursively process PHP variables", "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "time": "2017-03-03T06:23:57+00:00" + "time": "2017-03-03 06:23:57" }, { "name": "sebastian/resource-operations", @@ -5545,7 +5600,7 @@ ], "description": "Provides a list of PHP built-in functions that operate on resources", "homepage": "https://www.github.com/sebastianbergmann/resource-operations", - "time": "2015-07-28T20:34:47+00:00" + "time": "2015-07-28 20:34:47" }, { "name": "sebastian/version", @@ -5588,7 +5643,7 @@ ], "description": "Library that helps with managing the version number of Git-hosted PHP projects", "homepage": "https://github.com/sebastianbergmann/version", - "time": "2016-10-03T07:35:21+00:00" + "time": "2016-10-03 07:35:21" }, { "name": "squizlabs/php_codesniffer", @@ -5639,20 +5694,20 @@ "phpcs", "standards" ], - "time": "2017-06-14T01:23:49+00:00" + "time": "2017-06-14 01:23:49" }, { "name": "symfony/config", - "version": "v3.3.9", + "version": "v3.3.10", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "f9f19a39ee178f61bb2190f51ff7c517c2159315" + "reference": "4ab62407bff9cd97c410a7feaef04c375aaa5cfd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/f9f19a39ee178f61bb2190f51ff7c517c2159315", - "reference": "f9f19a39ee178f61bb2190f51ff7c517c2159315", + "url": "https://api.github.com/repos/symfony/config/zipball/4ab62407bff9cd97c410a7feaef04c375aaa5cfd", + "reference": "4ab62407bff9cd97c410a7feaef04c375aaa5cfd", "shasum": "" }, "require": { @@ -5701,20 +5756,20 @@ ], "description": "Symfony Config Component", "homepage": "https://symfony.com", - "time": "2017-09-04T16:28:07+00:00" + "time": "2017-10-04 18:56:58" }, { "name": "symfony/dependency-injection", - "version": "v3.3.9", + "version": "v3.3.10", "source": { "type": "git", "url": "https://github.com/symfony/dependency-injection.git", - "reference": "e593f06dd90a81c7b70ac1c49862a061b0ec06d2" + "reference": "8ebad929aee3ca185b05f55d9cc5521670821ad1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/e593f06dd90a81c7b70ac1c49862a061b0ec06d2", - "reference": "e593f06dd90a81c7b70ac1c49862a061b0ec06d2", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/8ebad929aee3ca185b05f55d9cc5521670821ad1", + "reference": "8ebad929aee3ca185b05f55d9cc5521670821ad1", "shasum": "" }, "require": { @@ -5771,20 +5826,73 @@ ], "description": "Symfony DependencyInjection Component", "homepage": "https://symfony.com", - "time": "2017-09-05T20:39:38+00:00" + "time": "2017-10-04 17:15:30" + }, + { + "name": "symfony/http-foundation", + "version": "v3.3.10", + "source": { + "type": "git", + "url": "https://github.com/symfony/http-foundation.git", + "reference": "22cf9c2b1d9f67cc8e75ae7f4eaa60e4c1eff1f8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/22cf9c2b1d9f67cc8e75ae7f4eaa60e4c1eff1f8", + "reference": "22cf9c2b1d9f67cc8e75ae7f4eaa60e4c1eff1f8", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8", + "symfony/polyfill-mbstring": "~1.1" + }, + "require-dev": { + "symfony/expression-language": "~2.8|~3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.3-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\HttpFoundation\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony HttpFoundation Component", + "homepage": "https://symfony.com", + "time": "2017-10-05 23:10:23" }, { "name": "symfony/polyfill-php54", - "version": "v1.5.0", + "version": "v1.6.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php54.git", - "reference": "b7763422a5334c914ef0298ed21b253d25913a6e" + "reference": "d7810a14b2c6c1aff415e1bb755f611b3d5327bc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php54/zipball/b7763422a5334c914ef0298ed21b253d25913a6e", - "reference": "b7763422a5334c914ef0298ed21b253d25913a6e", + "url": "https://api.github.com/repos/symfony/polyfill-php54/zipball/d7810a14b2c6c1aff415e1bb755f611b3d5327bc", + "reference": "d7810a14b2c6c1aff415e1bb755f611b3d5327bc", "shasum": "" }, "require": { @@ -5793,7 +5901,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.5-dev" + "dev-master": "1.6-dev" } }, "autoload": { @@ -5829,20 +5937,20 @@ "portable", "shim" ], - "time": "2017-06-14T15:44:48+00:00" + "time": "2017-10-11 12:05:26" }, { "name": "symfony/polyfill-php55", - "version": "v1.5.0", + "version": "v1.6.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php55.git", - "reference": "29b1381d66f16e0581aab0b9f678ccf073288f68" + "reference": "b64e7f0c37ecf144ecc16668936eef94e628fbfd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php55/zipball/29b1381d66f16e0581aab0b9f678ccf073288f68", - "reference": "29b1381d66f16e0581aab0b9f678ccf073288f68", + "url": "https://api.github.com/repos/symfony/polyfill-php55/zipball/b64e7f0c37ecf144ecc16668936eef94e628fbfd", + "reference": "b64e7f0c37ecf144ecc16668936eef94e628fbfd", "shasum": "" }, "require": { @@ -5852,7 +5960,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.5-dev" + "dev-master": "1.6-dev" } }, "autoload": { @@ -5885,20 +5993,20 @@ "portable", "shim" ], - "time": "2017-06-14T15:44:48+00:00" + "time": "2017-10-11 12:05:26" }, { "name": "symfony/polyfill-php70", - "version": "v1.5.0", + "version": "v1.6.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php70.git", - "reference": "b6482e68974486984f59449ecea1fbbb22ff840f" + "reference": "0442b9c0596610bd24ae7b5f0a6cdbbc16d9fcff" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php70/zipball/b6482e68974486984f59449ecea1fbbb22ff840f", - "reference": "b6482e68974486984f59449ecea1fbbb22ff840f", + "url": "https://api.github.com/repos/symfony/polyfill-php70/zipball/0442b9c0596610bd24ae7b5f0a6cdbbc16d9fcff", + "reference": "0442b9c0596610bd24ae7b5f0a6cdbbc16d9fcff", "shasum": "" }, "require": { @@ -5908,7 +6016,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.5-dev" + "dev-master": "1.6-dev" } }, "autoload": { @@ -5944,20 +6052,20 @@ "portable", "shim" ], - "time": "2017-06-14T15:44:48+00:00" + "time": "2017-10-11 12:05:26" }, { "name": "symfony/polyfill-php72", - "version": "v1.5.0", + "version": "v1.6.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php72.git", - "reference": "8abc9097f5001d310f0edba727469c988acc6ea7" + "reference": "6de4f4884b97abbbed9f0a84a95ff2ff77254254" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/8abc9097f5001d310f0edba727469c988acc6ea7", - "reference": "8abc9097f5001d310f0edba727469c988acc6ea7", + "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/6de4f4884b97abbbed9f0a84a95ff2ff77254254", + "reference": "6de4f4884b97abbbed9f0a84a95ff2ff77254254", "shasum": "" }, "require": { @@ -5966,7 +6074,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.5-dev" + "dev-master": "1.6-dev" } }, "autoload": { @@ -5999,20 +6107,20 @@ "portable", "shim" ], - "time": "2017-07-11T13:25:55+00:00" + "time": "2017-10-11 12:05:26" }, { "name": "symfony/polyfill-xml", - "version": "v1.5.0", + "version": "v1.6.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-xml.git", - "reference": "7d536462e554da7b05600a926303bf9b99153275" + "reference": "d7bcb5c3bb1832c532379df50825c08f43a64134" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-xml/zipball/7d536462e554da7b05600a926303bf9b99153275", - "reference": "7d536462e554da7b05600a926303bf9b99153275", + "url": "https://api.github.com/repos/symfony/polyfill-xml/zipball/d7bcb5c3bb1832c532379df50825c08f43a64134", + "reference": "d7bcb5c3bb1832c532379df50825c08f43a64134", "shasum": "" }, "require": { @@ -6022,7 +6130,7 @@ "type": "metapackage", "extra": { "branch-alias": { - "dev-master": "1.5-dev" + "dev-master": "1.6-dev" } }, "notification-url": "https://packagist.org/downloads/", @@ -6047,20 +6155,20 @@ "portable", "shim" ], - "time": "2017-06-14T15:44:48+00:00" + "time": "2017-10-11 12:05:26" }, { "name": "symfony/stopwatch", - "version": "v3.3.9", + "version": "v3.3.10", "source": { "type": "git", "url": "https://github.com/symfony/stopwatch.git", - "reference": "9a5610a8d6a50985a7be485c0ba745c22607beeb" + "reference": "170edf8b3247d7b6779eb6fa7428f342702ca184" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/stopwatch/zipball/9a5610a8d6a50985a7be485c0ba745c22607beeb", - "reference": "9a5610a8d6a50985a7be485c0ba745c22607beeb", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/170edf8b3247d7b6779eb6fa7428f342702ca184", + "reference": "170edf8b3247d7b6779eb6fa7428f342702ca184", "shasum": "" }, "require": { @@ -6096,7 +6204,7 @@ ], "description": "Symfony Stopwatch Component", "homepage": "https://symfony.com", - "time": "2017-07-29T21:54:42+00:00" + "time": "2017-10-02 06:42:24" }, { "name": "theseer/fdomdocument", @@ -6136,7 +6244,7 @@ ], "description": "The classes contained within this repository extend the standard DOM to use exceptions at all occasions of errors instead of PHP warnings or notices. They also add various custom methods and shortcuts for convenience and to simplify the usage of DOM.", "homepage": "https://github.com/theseer/fDOMDocument", - "time": "2017-06-30T11:53:12+00:00" + "time": "2017-06-30 11:53:12" }, { "name": "theseer/tokenizer", @@ -6176,7 +6284,7 @@ } ], "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", - "time": "2017-04-07T12:08:54+00:00" + "time": "2017-04-07 12:08:54" }, { "name": "webmozart/assert", @@ -6226,7 +6334,7 @@ "check", "validate" ], - "time": "2016-11-23T20:04:58+00:00" + "time": "2016-11-23 20:04:58" } ], "aliases": [], diff --git a/lib/internal/Magento/Framework/App/MaintenanceMode.php b/lib/internal/Magento/Framework/App/MaintenanceMode.php index 4e4328cb72aef..300da9206d389 100644 --- a/lib/internal/Magento/Framework/App/MaintenanceMode.php +++ b/lib/internal/Magento/Framework/App/MaintenanceMode.php @@ -7,6 +7,7 @@ use Magento\Framework\App\Filesystem\DirectoryList; use Magento\Framework\Filesystem; +use Darsyn\IP\IP; /** * Application Maintenance Mode @@ -62,7 +63,22 @@ public function isOn($remoteAddr = '') return false; } $info = $this->getAddressInfo(); - return !in_array($remoteAddr, $info); + $testIp = new IP($remoteAddr); + foreach ($info as $range) { + $cidr = 32; + $ip = $range; + if (strpos($range, '/') !== false) { + list($ip, $cidr) = explode('/', $range); + } + $rangeIp = new IP($ip); + if ($rangeIp->isVersion4()) { + $cidr += IP::CIDR4TO6; + } + if ($testIp->inRange($rangeIp, $cidr)) { + return false; + } + } + return true; } /** diff --git a/lib/internal/Magento/Framework/composer.json b/lib/internal/Magento/Framework/composer.json index 02cffe152bb34..9cc60dcc92b72 100644 --- a/lib/internal/Magento/Framework/composer.json +++ b/lib/internal/Magento/Framework/composer.json @@ -36,7 +36,8 @@ "zendframework/zend-mvc": "~2.6.3", "zendframework/zend-stdlib": "^2.7.7", "zendframework/zend-uri": "^2.5.1", - "zendframework/zend-validator": "^2.6.0" + "zendframework/zend-validator": "^2.6.0", + "darsyn/ip": "^3.3" }, "suggest": { "ext-imagick": "Use Image Magick >=3.0.0 as an optional alternative image processing library" diff --git a/setup/src/Magento/Setup/Validator/IpValidator.php b/setup/src/Magento/Setup/Validator/IpValidator.php index 1b5624c0c6ffe..9ce3e1c6019df 100644 --- a/setup/src/Magento/Setup/Validator/IpValidator.php +++ b/setup/src/Magento/Setup/Validator/IpValidator.php @@ -5,6 +5,9 @@ */ namespace Magento\Setup\Validator; +use Darsyn\IP\IP; +use Darsyn\IP\InvalidIpAddressException; + /** * Class to validate list of IPs for maintenance commands */ @@ -66,14 +69,31 @@ public function validateIps(array $ips, $noneAllowed) */ private function filterIps(array $ips) { - foreach ($ips as $ip) { - if (filter_var($ip, FILTER_VALIDATE_IP)) { - $this->validIps[] = $ip; - } elseif ($ip == 'none') { - $this->none[] = $ip; - } else { - $this->invalidIps[] = $ip; + foreach ($ips as $range) { + $cidr = 32; + $ip = $range; + if (strpos($range, '/') !== false) { + list($ip, $cidr) = explode('/', $range); + } + + try { + $validIp = new IP($ip); + } catch (InvalidIpAddressException $e) { + if ($range == 'none') { + $this->none[] = $range; + continue; + } + $this->invalidIps[] = $range; + continue; } + + $max = $validIp->isVersion4() ? 32 : 128; + if ($cidr >= 0 && $cidr <= $max) { + $this->validIps[] = $range; + continue; + } + + $this->invalidIps[] = $range; } } } From e8e4a93d7ecff39d9e3219e77924ca77fcba2c4c Mon Sep 17 00:00:00 2001 From: Anton Evers Date: Mon, 21 Aug 2017 11:22:45 +0600 Subject: [PATCH 02/12] Replace darsyn/ip in favour of symfony/http-foundation --- composer.json | 4 +- composer.lock | 159 ++++++------------ .../Magento/Framework/App/MaintenanceMode.php | 20 +-- lib/internal/Magento/Framework/composer.json | 4 +- .../Magento/Setup/Validator/IpValidator.php | 26 ++- 5 files changed, 74 insertions(+), 139 deletions(-) diff --git a/composer.json b/composer.json index b5be8b3b70e78..acfd277695202 100644 --- a/composer.json +++ b/composer.json @@ -47,6 +47,7 @@ "sjparkinson/static-review": "~4.1", "symfony/console": "~2.3, !=2.7.0", "symfony/event-dispatcher": "~2.1", + "symfony/http-foundation": "^3.3", "symfony/process": "~2.1", "tedivm/jshrink": "~1.1.0", "tubalmartin/cssmin": "4.1.0", @@ -75,8 +76,7 @@ "zendframework/zend-text": "^2.6.0", "zendframework/zend-uri": "^2.5.1", "zendframework/zend-validator": "^2.6.0", - "zendframework/zend-view": "^2.8.1", - "darsyn/ip": "^3.3" + "zendframework/zend-view": "^2.8.1" }, "require-dev": { "friendsofphp/php-cs-fixer": "~2.1.1", diff --git a/composer.lock b/composer.lock index f5ca9e9a01174..aac2bb3100570 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,8 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "5037e3acde39ddc448dbfc6caae9b1d1", - "content-hash": "ab523bf1ee680cb995e3421628ea27c2", + "hash": "590cacb23cafb5bddf3865bf1d949e48", + "content-hash": "196c28956ee09d96956c7ffc26d0a136", "packages": [ { "name": "braintree/braintree_php", @@ -492,55 +492,6 @@ "homepage": "https://github.com/container-interop/container-interop", "time": "2017-02-14 19:40:03" }, - { - "name": "darsyn/ip", - "version": "3.3.1", - "source": { - "type": "git", - "url": "https://github.com/darsyn/ip.git", - "reference": "cbd2f7ec59f34b6fe698486cad7e460e2ab33ee9" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/darsyn/ip/zipball/cbd2f7ec59f34b6fe698486cad7e460e2ab33ee9", - "reference": "cbd2f7ec59f34b6fe698486cad7e460e2ab33ee9", - "shasum": "" - }, - "require": { - "php": ">=5.5" - }, - "suggest": { - "doctrine/dbal": "to use IP as a column type" - }, - "type": "library", - "autoload": { - "psr-4": { - "Darsyn\\IP\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Zander Baldwin", - "email": "hello@zanderbaldwin.com", - "homepage": "http://zanderbaldwin.com" - } - ], - "description": "An immutable IP Address value object that provides several different notations, including helper functions.", - "homepage": "https://github.com/darsyn/ip", - "keywords": [ - "IP", - "immutable", - "ipv4", - "ipv6", - "library", - "value-object" - ], - "time": "2017-08-03 13:09:45" - }, { "name": "justinrainbow/json-schema", "version": "5.2.6", @@ -1806,6 +1757,59 @@ "homepage": "https://symfony.com", "time": "2017-10-02 06:42:24" }, + { + "name": "symfony/http-foundation", + "version": "v3.3.10", + "source": { + "type": "git", + "url": "https://github.com/symfony/http-foundation.git", + "reference": "22cf9c2b1d9f67cc8e75ae7f4eaa60e4c1eff1f8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/22cf9c2b1d9f67cc8e75ae7f4eaa60e4c1eff1f8", + "reference": "22cf9c2b1d9f67cc8e75ae7f4eaa60e4c1eff1f8", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8", + "symfony/polyfill-mbstring": "~1.1" + }, + "require-dev": { + "symfony/expression-language": "~2.8|~3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.3-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\HttpFoundation\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony HttpFoundation Component", + "homepage": "https://symfony.com", + "time": "2017-10-05 23:10:23" + }, { "name": "symfony/polyfill-mbstring", "version": "v1.6.0", @@ -5828,59 +5832,6 @@ "homepage": "https://symfony.com", "time": "2017-10-04 17:15:30" }, - { - "name": "symfony/http-foundation", - "version": "v3.3.10", - "source": { - "type": "git", - "url": "https://github.com/symfony/http-foundation.git", - "reference": "22cf9c2b1d9f67cc8e75ae7f4eaa60e4c1eff1f8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/22cf9c2b1d9f67cc8e75ae7f4eaa60e4c1eff1f8", - "reference": "22cf9c2b1d9f67cc8e75ae7f4eaa60e4c1eff1f8", - "shasum": "" - }, - "require": { - "php": "^5.5.9|>=7.0.8", - "symfony/polyfill-mbstring": "~1.1" - }, - "require-dev": { - "symfony/expression-language": "~2.8|~3.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.3-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\HttpFoundation\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony HttpFoundation Component", - "homepage": "https://symfony.com", - "time": "2017-10-05 23:10:23" - }, { "name": "symfony/polyfill-php54", "version": "v1.6.0", diff --git a/lib/internal/Magento/Framework/App/MaintenanceMode.php b/lib/internal/Magento/Framework/App/MaintenanceMode.php index 300da9206d389..9768344dda3b3 100644 --- a/lib/internal/Magento/Framework/App/MaintenanceMode.php +++ b/lib/internal/Magento/Framework/App/MaintenanceMode.php @@ -7,7 +7,7 @@ use Magento\Framework\App\Filesystem\DirectoryList; use Magento\Framework\Filesystem; -use Darsyn\IP\IP; +use Symfony\Component\HttpFoundation\IpUtils; /** * Application Maintenance Mode @@ -62,23 +62,7 @@ public function isOn($remoteAddr = '') if (!$this->flagDir->isExist(self::FLAG_FILENAME)) { return false; } - $info = $this->getAddressInfo(); - $testIp = new IP($remoteAddr); - foreach ($info as $range) { - $cidr = 32; - $ip = $range; - if (strpos($range, '/') !== false) { - list($ip, $cidr) = explode('/', $range); - } - $rangeIp = new IP($ip); - if ($rangeIp->isVersion4()) { - $cidr += IP::CIDR4TO6; - } - if ($testIp->inRange($rangeIp, $cidr)) { - return false; - } - } - return true; + return !IpUtils::checkIp($remoteAddr, $this->getAddressInfo()); } /** diff --git a/lib/internal/Magento/Framework/composer.json b/lib/internal/Magento/Framework/composer.json index 9cc60dcc92b72..aca7b86e06be1 100644 --- a/lib/internal/Magento/Framework/composer.json +++ b/lib/internal/Magento/Framework/composer.json @@ -28,6 +28,7 @@ "monolog/monolog": "^1.17", "oyejorge/less.php": "~1.7.0", "symfony/console": "~2.3, !=2.7.0", + "symfony/http-foundation": "^3.3", "symfony/process": "~2.1", "tedivm/jshrink": "~1.1.0", "zendframework/zend-code": "^3.1.0", @@ -37,7 +38,8 @@ "zendframework/zend-stdlib": "^2.7.7", "zendframework/zend-uri": "^2.5.1", "zendframework/zend-validator": "^2.6.0", - "darsyn/ip": "^3.3" + "zendframework/zend-stdlib": "^2.7.7", + "zendframework/zend-http": "^2.6.0" }, "suggest": { "ext-imagick": "Use Image Magick >=3.0.0 as an optional alternative image processing library" diff --git a/setup/src/Magento/Setup/Validator/IpValidator.php b/setup/src/Magento/Setup/Validator/IpValidator.php index 9ce3e1c6019df..ae4fbe24e1d5b 100644 --- a/setup/src/Magento/Setup/Validator/IpValidator.php +++ b/setup/src/Magento/Setup/Validator/IpValidator.php @@ -5,9 +5,6 @@ */ namespace Magento\Setup\Validator; -use Darsyn\IP\IP; -use Darsyn\IP\InvalidIpAddressException; - /** * Class to validate list of IPs for maintenance commands */ @@ -70,30 +67,31 @@ public function validateIps(array $ips, $noneAllowed) private function filterIps(array $ips) { foreach ($ips as $range) { + if ($range === 'none') { + $this->none[] = $range; + continue; + } + $cidr = 32; $ip = $range; if (strpos($range, '/') !== false) { list($ip, $cidr) = explode('/', $range); } - try { - $validIp = new IP($ip); - } catch (InvalidIpAddressException $e) { - if ($range == 'none') { - $this->none[] = $range; - continue; - } + $ipValidator = new \Zend_Validate_Ip(['allowipv6' => true, 'allowipv4' => true]); + if (!$ipValidator->isValid($ip)) { $this->invalidIps[] = $range; continue; } - $max = $validIp->isVersion4() ? 32 : 128; - if ($cidr >= 0 && $cidr <= $max) { - $this->validIps[] = $range; + $ipv4Validator = new \Zend_Validate_Ip(['allowipv6' => false, 'allowipv4' => true]); + $max = $ipv4Validator->isValid($ip) ? 32 : 128; + if ($cidr < 0 || $cidr > $max) { + $this->invalidIps[] = $range; continue; } - $this->invalidIps[] = $range; + $this->validIps[] = $range; } } } From ff3735970d76005ac028c9375be3962a3dac042f Mon Sep 17 00:00:00 2001 From: Anton Evers Date: Fri, 22 Sep 2017 11:50:11 +0600 Subject: [PATCH 03/12] Create a facade for Symfony's IpUtils' checkIp method --- .../Magento/Framework/App/MaintenanceMode.php | 4 ++-- .../Magento/Framework/HTTP/IpChecker.php | 24 +++++++++++++++++++ 2 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 lib/internal/Magento/Framework/HTTP/IpChecker.php diff --git a/lib/internal/Magento/Framework/App/MaintenanceMode.php b/lib/internal/Magento/Framework/App/MaintenanceMode.php index 9768344dda3b3..4dde1a8bd842b 100644 --- a/lib/internal/Magento/Framework/App/MaintenanceMode.php +++ b/lib/internal/Magento/Framework/App/MaintenanceMode.php @@ -7,7 +7,7 @@ use Magento\Framework\App\Filesystem\DirectoryList; use Magento\Framework\Filesystem; -use Symfony\Component\HttpFoundation\IpUtils; +use Magento\Framework\HTTP\IpChecker; /** * Application Maintenance Mode @@ -62,7 +62,7 @@ public function isOn($remoteAddr = '') if (!$this->flagDir->isExist(self::FLAG_FILENAME)) { return false; } - return !IpUtils::checkIp($remoteAddr, $this->getAddressInfo()); + return !IpChecker::isInRange($remoteAddr, $this->getAddressInfo()); } /** diff --git a/lib/internal/Magento/Framework/HTTP/IpChecker.php b/lib/internal/Magento/Framework/HTTP/IpChecker.php new file mode 100644 index 0000000000000..f57749c1a31d0 --- /dev/null +++ b/lib/internal/Magento/Framework/HTTP/IpChecker.php @@ -0,0 +1,24 @@ + Date: Tue, 24 Oct 2017 13:14:02 +0600 Subject: [PATCH 04/12] Remove rebase conflict code --- lib/internal/Magento/Framework/composer.json | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/internal/Magento/Framework/composer.json b/lib/internal/Magento/Framework/composer.json index aca7b86e06be1..0a152deda14e8 100644 --- a/lib/internal/Magento/Framework/composer.json +++ b/lib/internal/Magento/Framework/composer.json @@ -37,9 +37,7 @@ "zendframework/zend-mvc": "~2.6.3", "zendframework/zend-stdlib": "^2.7.7", "zendframework/zend-uri": "^2.5.1", - "zendframework/zend-validator": "^2.6.0", - "zendframework/zend-stdlib": "^2.7.7", - "zendframework/zend-http": "^2.6.0" + "zendframework/zend-validator": "^2.6.0" }, "suggest": { "ext-imagick": "Use Image Magick >=3.0.0 as an optional alternative image processing library" From db6213a0edfca626176085ee98616231dc878e19 Mon Sep 17 00:00:00 2001 From: Anton Evers Date: Tue, 24 Oct 2017 14:01:33 +0600 Subject: [PATCH 05/12] If the maintenance flag is present and an empty ip file is present, maintenance should be on, not off --- .../Magento/Framework/App/Test/Unit/MaintenanceModeTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/internal/Magento/Framework/App/Test/Unit/MaintenanceModeTest.php b/lib/internal/Magento/Framework/App/Test/Unit/MaintenanceModeTest.php index 5d1c22a38af4d..272498780b263 100644 --- a/lib/internal/Magento/Framework/App/Test/Unit/MaintenanceModeTest.php +++ b/lib/internal/Magento/Framework/App/Test/Unit/MaintenanceModeTest.php @@ -58,7 +58,7 @@ public function testisOnWithIP() ]; $this->flagDir->expects($this->exactly(2))->method('isExist') ->will(($this->returnValueMap($mapisExist))); - $this->assertFalse($this->model->isOn()); + $this->assertTrue($this->model->isOn()); } public function testisOnWithIPNoMaintenance() From c34f97a3ef3ae8f1a3f56a30e048e2bc155a7d7d Mon Sep 17 00:00:00 2001 From: Anton Evers Date: Tue, 24 Oct 2017 14:29:30 +0600 Subject: [PATCH 06/12] Add ip range tests --- .../Framework/App/Test/Unit/MaintenanceModeTest.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/lib/internal/Magento/Framework/App/Test/Unit/MaintenanceModeTest.php b/lib/internal/Magento/Framework/App/Test/Unit/MaintenanceModeTest.php index 272498780b263..cb4f19bae9beb 100644 --- a/lib/internal/Magento/Framework/App/Test/Unit/MaintenanceModeTest.php +++ b/lib/internal/Magento/Framework/App/Test/Unit/MaintenanceModeTest.php @@ -150,13 +150,16 @@ public function testOnSetMultipleAddresses() $this->flagDir->expects($this->any())->method('readFile') ->with(MaintenanceMode::IP_FILENAME) - ->will($this->returnValue('address1,10.50.60.123')); + ->will($this->returnValue('address1,1.2.3.4,192.168.0.0/16')); - $expectedArray = ['address1', '10.50.60.123']; - $this->model->setAddresses('address1,10.50.60.123'); + $expectedArray = ['address1', '1.2.3.4', '192.168.0.0/16']; + $this->model->setAddresses('address1,1.2.3.4,192.168.0.0/16'); $this->assertEquals($expectedArray, $this->model->getAddressInfo()); - $this->assertFalse($this->model->isOn('address1')); - $this->assertTrue($this->model->isOn('address3')); + $this->assertFalse($this->model->isOn('1.2.3.4')); // exact match + $this->assertFalse($this->model->isOn('192.168.22.1')); // range match + $this->assertTrue($this->model->isOn('192.22.1.1')); // range mismatch + $this->assertTrue($this->model->isOn('address1')); // not an IP address + $this->assertTrue($this->model->isOn('172.16.0.4')); // complete mismatch } public function testOffSetMultipleAddresses() From 6ea05d97a8ad7e3f111d4e9ae063627ab4d4347b Mon Sep 17 00:00:00 2001 From: Anton Evers Date: Tue, 24 Oct 2017 14:30:33 +0600 Subject: [PATCH 07/12] add range tests to testOffSetMultipleAddresses --- .../Framework/App/Test/Unit/MaintenanceModeTest.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/lib/internal/Magento/Framework/App/Test/Unit/MaintenanceModeTest.php b/lib/internal/Magento/Framework/App/Test/Unit/MaintenanceModeTest.php index cb4f19bae9beb..2d5f4499aa782 100644 --- a/lib/internal/Magento/Framework/App/Test/Unit/MaintenanceModeTest.php +++ b/lib/internal/Magento/Framework/App/Test/Unit/MaintenanceModeTest.php @@ -173,12 +173,15 @@ public function testOffSetMultipleAddresses() $this->flagDir->expects($this->any())->method('readFile') ->with(MaintenanceMode::IP_FILENAME) - ->will($this->returnValue('address1,10.50.60.123')); + ->will($this->returnValue('address1,1.2.3.4,192.168.0.0/16')); - $expectedArray = ['address1', '10.50.60.123']; - $this->model->setAddresses('address1,10.50.60.123'); + $expectedArray = ['address1', '1.2.3.4', '192.168.0.0/16']; + $this->model->setAddresses('address1,1.2.3.4,192.168.0.0/16'); $this->assertEquals($expectedArray, $this->model->getAddressInfo()); - $this->assertFalse($this->model->isOn('address1')); - $this->assertFalse($this->model->isOn('address3')); + $this->assertFalse($this->model->isOn('1.2.3.4')); // exact match + $this->assertFalse($this->model->isOn('192.168.22.1')); // range match + $this->assertFalse($this->model->isOn('192.22.1.1')); // range mismatch + $this->assertFalse($this->model->isOn('address1')); // not an IP address + $this->assertFalse($this->model->isOn('172.16.0.4')); // complete mismatch } } From e2bb34704ed90db007b21e4f4c25fdc12ff8399b Mon Sep 17 00:00:00 2001 From: Anton Evers Date: Tue, 24 Oct 2017 14:47:56 +0600 Subject: [PATCH 08/12] Add ipv6 tests --- .../App/Test/Unit/MaintenanceModeTest.php | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/lib/internal/Magento/Framework/App/Test/Unit/MaintenanceModeTest.php b/lib/internal/Magento/Framework/App/Test/Unit/MaintenanceModeTest.php index 2d5f4499aa782..43bda09ef33c9 100644 --- a/lib/internal/Magento/Framework/App/Test/Unit/MaintenanceModeTest.php +++ b/lib/internal/Magento/Framework/App/Test/Unit/MaintenanceModeTest.php @@ -150,16 +150,20 @@ public function testOnSetMultipleAddresses() $this->flagDir->expects($this->any())->method('readFile') ->with(MaintenanceMode::IP_FILENAME) - ->will($this->returnValue('address1,1.2.3.4,192.168.0.0/16')); + ->will($this->returnValue('address1,1.2.3.4,192.168.0.0/16,2620:0:2d0:200::7/32,1620:0:2d0:200::7')); - $expectedArray = ['address1', '1.2.3.4', '192.168.0.0/16']; - $this->model->setAddresses('address1,1.2.3.4,192.168.0.0/16'); + $expectedArray = ['address1', '1.2.3.4', '192.168.0.0/16', '2620:0:2d0:200::7/32', '1620:0:2d0:200::7']; + $this->model->setAddresses('address1,1.2.3.4,192.168.0.0/16,2620:0:2d0:200::7/32,1620:0:2d0:200::7'); $this->assertEquals($expectedArray, $this->model->getAddressInfo()); $this->assertFalse($this->model->isOn('1.2.3.4')); // exact match $this->assertFalse($this->model->isOn('192.168.22.1')); // range match $this->assertTrue($this->model->isOn('192.22.1.1')); // range mismatch $this->assertTrue($this->model->isOn('address1')); // not an IP address $this->assertTrue($this->model->isOn('172.16.0.4')); // complete mismatch + $this->assertFalse($this->model->isOn('1620:0:2d0:200::7')); // ipv6 match + $this->assertFalse($this->model->isOn('1620:0:2d0:200:0:0:0:7')); // ipv6 expanded match + $this->assertFalse($this->model->isOn('2620::ff43:0:ff')); // ipv6 range match + $this->assertTrue($this->model->isOn('2720::ff43:0:ff')); // ipv6 range mismatch } public function testOffSetMultipleAddresses() @@ -173,15 +177,19 @@ public function testOffSetMultipleAddresses() $this->flagDir->expects($this->any())->method('readFile') ->with(MaintenanceMode::IP_FILENAME) - ->will($this->returnValue('address1,1.2.3.4,192.168.0.0/16')); + ->will($this->returnValue('address1,1.2.3.4,192.168.0.0/16,2620:0:2d0:200::7/32,1620:0:2d0:200::7')); - $expectedArray = ['address1', '1.2.3.4', '192.168.0.0/16']; - $this->model->setAddresses('address1,1.2.3.4,192.168.0.0/16'); + $expectedArray = ['address1', '1.2.3.4', '192.168.0.0/16', '2620:0:2d0:200::7/32', '1620:0:2d0:200::7']; + $this->model->setAddresses('address1,1.2.3.4,192.168.0.0/16,2620:0:2d0:200::7/32,1620:0:2d0:200::7'); $this->assertEquals($expectedArray, $this->model->getAddressInfo()); $this->assertFalse($this->model->isOn('1.2.3.4')); // exact match $this->assertFalse($this->model->isOn('192.168.22.1')); // range match $this->assertFalse($this->model->isOn('192.22.1.1')); // range mismatch $this->assertFalse($this->model->isOn('address1')); // not an IP address $this->assertFalse($this->model->isOn('172.16.0.4')); // complete mismatch + $this->assertFalse($this->model->isOn('1620:0:2d0:200::7')); // ipv6 match + $this->assertFalse($this->model->isOn('1620:0:2d0:200:0:0:0:7')); // ipv6 expanded match + $this->assertFalse($this->model->isOn('2620::ff43:0:ff')); // ipv6 range match + $this->assertFalse($this->model->isOn('2720::ff43:0:ff')); // ipv6 range mismatch } } From d8dd590f73e3413ac63ced667dc71fb19c101775 Mon Sep 17 00:00:00 2001 From: Anton Evers Date: Wed, 25 Oct 2017 10:12:08 +0600 Subject: [PATCH 09/12] Resolve codacy/pr test --- .../Magento/Framework/App/MaintenanceMode.php | 12 ++++++++++-- lib/internal/Magento/Framework/HTTP/IpChecker.php | 6 +++++- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/lib/internal/Magento/Framework/App/MaintenanceMode.php b/lib/internal/Magento/Framework/App/MaintenanceMode.php index 4dde1a8bd842b..ae58935064786 100644 --- a/lib/internal/Magento/Framework/App/MaintenanceMode.php +++ b/lib/internal/Magento/Framework/App/MaintenanceMode.php @@ -6,6 +6,7 @@ namespace Magento\Framework\App; use Magento\Framework\App\Filesystem\DirectoryList; +use Magento\Framework\App\ObjectManager; use Magento\Framework\Filesystem; use Magento\Framework\HTTP\IpChecker; @@ -39,14 +40,21 @@ class MaintenanceMode */ protected $flagDir; + /** + * @var IpChecker + */ + private $ipChecker; + /** * Constructor * * @param \Magento\Framework\Filesystem $filesystem + * @param IpChecker|null $ipChecker */ - public function __construct(Filesystem $filesystem) + public function __construct(Filesystem $filesystem, IpChecker $ipChecker = null) { $this->flagDir = $filesystem->getDirectoryWrite(self::FLAG_DIR); + $this->ipChecker = $ipChecker ?: ObjectManager::getInstance()->get(IpChecker::class); } /** @@ -62,7 +70,7 @@ public function isOn($remoteAddr = '') if (!$this->flagDir->isExist(self::FLAG_FILENAME)) { return false; } - return !IpChecker::isInRange($remoteAddr, $this->getAddressInfo()); + return $this->ipChecker->isInRange($remoteAddr, $this->getAddressInfo()); } /** diff --git a/lib/internal/Magento/Framework/HTTP/IpChecker.php b/lib/internal/Magento/Framework/HTTP/IpChecker.php index f57749c1a31d0..f522b14083fb7 100644 --- a/lib/internal/Magento/Framework/HTTP/IpChecker.php +++ b/lib/internal/Magento/Framework/HTTP/IpChecker.php @@ -7,6 +7,9 @@ use Symfony\Component\HttpFoundation\IpUtils; +/** + * Ip checker facade + */ class IpChecker { /** @@ -16,8 +19,9 @@ class IpChecker * @param string|array $ips List of IPs or subnets (can be a string if only a single one) * * @return bool Whether the IP is contained in the list of given IPs or subnets + * @SuppressWarnings(PHPMD.StaticAccess) */ - public static function isInRange($requestIp, $ips) + public function isInRange($requestIp, $ips) { return IpUtils::checkIp($requestIp, $ips); } From 8120d7f11cb54149bbf4bb690f8eca71ca752ae8 Mon Sep 17 00:00:00 2001 From: Anton Evers Date: Wed, 25 Oct 2017 20:29:57 +0600 Subject: [PATCH 10/12] resolve review comments --- setup/src/Magento/Setup/Validator/IpValidator.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/setup/src/Magento/Setup/Validator/IpValidator.php b/setup/src/Magento/Setup/Validator/IpValidator.php index ae4fbe24e1d5b..451809414ddc0 100644 --- a/setup/src/Magento/Setup/Validator/IpValidator.php +++ b/setup/src/Magento/Setup/Validator/IpValidator.php @@ -78,15 +78,15 @@ private function filterIps(array $ips) list($ip, $cidr) = explode('/', $range); } - $ipValidator = new \Zend_Validate_Ip(['allowipv6' => true, 'allowipv4' => true]); + $ipValidator = new \Zend\Validator\Ip(); if (!$ipValidator->isValid($ip)) { $this->invalidIps[] = $range; continue; } - $ipv4Validator = new \Zend_Validate_Ip(['allowipv6' => false, 'allowipv4' => true]); - $max = $ipv4Validator->isValid($ip) ? 32 : 128; - if ($cidr < 0 || $cidr > $max) { + $ipv4Validator = new \Zend\Validator\Ip(['allowipv6' => false]); + $maxBits = $ipv4Validator->isValid($ip) ? 32 : 128; + if ($cidr < 0 || $cidr > $maxBits) { $this->invalidIps[] = $range; continue; } From 9f8519b43ded804ad0ad6d78422f2b7e035ac49a Mon Sep 17 00:00:00 2001 From: Anton Evers Date: Wed, 25 Oct 2017 20:43:07 +0600 Subject: [PATCH 11/12] Maintenance on test was exactly the wrong way around --- lib/internal/Magento/Framework/App/MaintenanceMode.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/internal/Magento/Framework/App/MaintenanceMode.php b/lib/internal/Magento/Framework/App/MaintenanceMode.php index ae58935064786..fc15b1a59c634 100644 --- a/lib/internal/Magento/Framework/App/MaintenanceMode.php +++ b/lib/internal/Magento/Framework/App/MaintenanceMode.php @@ -70,7 +70,7 @@ public function isOn($remoteAddr = '') if (!$this->flagDir->isExist(self::FLAG_FILENAME)) { return false; } - return $this->ipChecker->isInRange($remoteAddr, $this->getAddressInfo()); + return !$this->ipChecker->isInRange($remoteAddr, $this->getAddressInfo()); } /** From 9457972dabe54b40a28e6a4a2675196ad2809f86 Mon Sep 17 00:00:00 2001 From: Anton Evers Date: Thu, 26 Oct 2017 10:08:40 +0600 Subject: [PATCH 12/12] rename $cidr to $subnetMask because it is a subnet mask in cidr notation --- setup/src/Magento/Setup/Validator/IpValidator.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/setup/src/Magento/Setup/Validator/IpValidator.php b/setup/src/Magento/Setup/Validator/IpValidator.php index 451809414ddc0..3eda0ee4614fc 100644 --- a/setup/src/Magento/Setup/Validator/IpValidator.php +++ b/setup/src/Magento/Setup/Validator/IpValidator.php @@ -72,10 +72,10 @@ private function filterIps(array $ips) continue; } - $cidr = 32; + $subnetMask = 32; $ip = $range; if (strpos($range, '/') !== false) { - list($ip, $cidr) = explode('/', $range); + list($ip, $subnetMask) = explode('/', $range); } $ipValidator = new \Zend\Validator\Ip(); @@ -86,7 +86,7 @@ private function filterIps(array $ips) $ipv4Validator = new \Zend\Validator\Ip(['allowipv6' => false]); $maxBits = $ipv4Validator->isValid($ip) ? 32 : 128; - if ($cidr < 0 || $cidr > $maxBits) { + if ($subnetMask < 0 || $subnetMask > $maxBits) { $this->invalidIps[] = $range; continue; }