Skip to content

Instantly share code, notes, and snippets.

@barbanet
Created May 18, 2016 05:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save barbanet/90e8d7a152986818702d62742e5e4085 to your computer and use it in GitHub Desktop.
Save barbanet/90e8d7a152986818702d62742e5e4085 to your computer and use it in GitHub Desktop.
Magento2 2.0.5 - 2.0.6 diff
--- Magento-CE-2.0.5/app/bootstrap.php 2016-04-27 23:23:14.000000000 -0300
+++ Magento-CE-2.0.6/app/bootstrap.php 2016-05-16 13:49:31.000000000 -0300
@@ -9,7 +9,6 @@
*/
error_reporting(E_ALL);
#ini_set('display_errors', 1);
-umask(0);
/* PHP version validation */
if (version_compare(phpversion(), '5.5.0', '<') === true) {
@@ -31,6 +30,11 @@
require_once __DIR__ . '/autoload.php';
require_once BP . '/app/functions.php';
+/* Custom umask value may be provided in optional mage_umask file in root */
+$umaskFile = BP . '/magento_umask';
+$mask = file_exists($umaskFile) ? octdec(file_get_contents($umaskFile)) : 002;
+umask($mask);
+
if (!empty($_SERVER['MAGE_PROFILER'])
&& isset($_SERVER['HTTP_ACCEPT'])
&& strpos($_SERVER['HTTP_ACCEPT'], 'text/html') !== false
--- Magento-CE-2.0.5/app/etc/di.xml 2016-04-27 23:23:14.000000000 -0300
+++ Magento-CE-2.0.6/app/etc/di.xml 2016-05-16 13:49:31.000000000 -0300
@@ -141,6 +141,8 @@
<preference for="Magento\Framework\Stdlib\DateTime\DateTimeFormatterInterface" type="Magento\Framework\Stdlib\DateTime\DateTimeFormatter"/>
<preference for="Magento\Framework\Api\Search\SearchInterface" type="Magento\Framework\Search\Search"/>
<preference for="Magento\Framework\View\Design\FileResolution\Fallback\ResolverInterface" type="Magento\Framework\View\Design\FileResolution\Fallback\Resolver\Simple" />
+ <preference for="Cm\RedisSession\Handler\ConfigInterface" type="Magento\Framework\Session\SaveHandler\Redis\Config"/>
+ <preference for="Cm\RedisSession\Handler\LoggerInterface" type="Magento\Framework\Session\SaveHandler\Redis\Logger"/>
<type name="Magento\Framework\Model\ResourceModel\Db\TransactionManager" shared="false" />
<type name="Magento\Framework\Logger\Handler\Base">
<arguments>
@@ -186,9 +188,16 @@
<arguments>
<argument name="handlers" xsi:type="array">
<item name="db" xsi:type="string">Magento\Framework\Session\SaveHandler\DbTable</item>
+ <item name="redis" xsi:type="string">Magento\Framework\Session\SaveHandler\Redis</item>
</argument>
</arguments>
</type>
+ <type name="Magento\Framework\Session\SaveHandler\Redis">
+ <arguments>
+ <argument name="config" xsi:type="object">Cm\RedisSession\Handler\ConfigInterface</argument>
+ <argument name="logger" xsi:type="object">Cm\RedisSession\Handler\LoggerInterface</argument>
+ </arguments>
+ </type>
<virtualType name="interceptionConfigScope" type="Magento\Framework\Config\Scope">
<arguments>
<argument name="defaultScope" xsi:type="string">global</argument>
--- Magento-CE-2.0.5/CHANGELOG.md 2016-04-27 23:23:12.000000000 -0300
+++ Magento-CE-2.0.6/CHANGELOG.md 2016-05-16 13:49:30.000000000 -0300
@@ -1,3 +1,16 @@
+2.0.6
+=============
+* Functional fixes:
+ * Fixed issue with Redis sessions.
+ * Fixed issue with Varnish cache on GoDaddy.
+
+* Security fixes:
+ * This release contains several security fixes. We describe each issue in detail in the Magento Security Center (https://www.magento.com/security).
+
+* Enhancements:
+ * Management of file ownership and permissions have been made more flexible.
+ * Support for using the Redis adapter to provide session storage.
+
2.0.5
=============
* Fixed bugs:
--- Magento-CE-2.0.5/composer.json 2016-04-28 06:15:02.000000000 -0300
+++ Magento-CE-2.0.6/composer.json 2016-05-16 20:18:24.000000000 -0300
@@ -2,7 +2,7 @@
"name": "magento/project-community-edition",
"description": "eCommerce Platform for Growth (Community Edition)",
"type": "project",
- "version": "2.0.5",
+ "version": "2.0.6",
"license": [
"OSL-3.0",
"AFL-3.0"
@@ -14,7 +14,7 @@
}
],
"require": {
- "magento/product-community-edition": "2.0.5",
+ "magento/product-community-edition": "2.0.6",
"composer/composer": "@alpha"
},
"require-dev": {
--- Magento-CE-2.0.5/composer.lock 2016-04-27 23:23:12.000000000 -0300
+++ Magento-CE-2.0.6/composer.lock 2016-05-16 13:49:29.000000000 -0300
@@ -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": "f6359ef06edcf8618a448d22fe90bddb",
- "content-hash": "105f002e28e8b66f04527f536399a388",
+ "hash": "29ad27a57ed2b85e77925869d9ba6ddf",
+ "content-hash": "8af0532f6e066125537acdfc3e65caa2",
"packages": [
{
"name": "braintree/braintree_php",
@@ -53,6 +53,83 @@
"time": "2015-05-07 16:53:06"
},
{
+ "name": "colinmollenhour/credis",
+ "version": "1.6",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/colinmollenhour/credis.git",
+ "reference": "409edfd0ea81f5cb74afbdb86df54890c207b5e4"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/colinmollenhour/credis/zipball/409edfd0ea81f5cb74afbdb86df54890c207b5e4",
+ "reference": "409edfd0ea81f5cb74afbdb86df54890c207b5e4",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.0"
+ },
+ "type": "library",
+ "autoload": {
+ "classmap": [
+ "Client.php",
+ "Cluster.php",
+ "Sentinel.php"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Colin Mollenhour",
+ "email": "colin@mollenhour.com"
+ }
+ ],
+ "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-28 01:20:04"
+ },
+ {
+ "name": "colinmollenhour/php-redis-session-abstract",
+ "version": "v1.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/colinmollenhour/php-redis-session-abstract.git",
+ "reference": "95330b7f29663dab81f53d1a438e4d927b6c5f66"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/colinmollenhour/php-redis-session-abstract/zipball/95330b7f29663dab81f53d1a438e4d927b6c5f66",
+ "reference": "95330b7f29663dab81f53d1a438e4d927b6c5f66",
+ "shasum": ""
+ },
+ "require": {
+ "colinmollenhour/credis": "1.6",
+ "magento/zendframework1": "1.12.16",
+ "php": "~5.5.0|~5.6.0|~7.0.0"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-0": {
+ "Cm\\RedisSession\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Colin Mollenhour"
+ }
+ ],
+ "description": "A Redis-based session handler with optimistic locking",
+ "homepage": "https://github.com/colinmollenhour/php-redis-session-abstract",
+ "time": "2016-02-03 18:13:49"
+ },
+ {
"name": "composer/composer",
"version": "1.0.0-alpha10",
"source": {
@@ -217,12 +294,12 @@
},
{
"name": "magento/framework",
- "version": "100.0.7",
+ "version": "100.0.8",
"dist": {
"type": "zip",
- "url": "https://repo.magento.com/archives/magento/framework/magento-framework-100.0.7.0.zip",
+ "url": "https://repo.magento.com/archives/magento/framework/magento-framework-100.0.8.0.zip",
"reference": null,
- "shasum": "8d92c12b2af52d3a79421a4a8e6c2e617823d016"
+ "shasum": "4a560ce4a54a5dd93bfdf0da684b9c9815270057"
},
"require": {
"ext-curl": "*",
@@ -502,12 +579,12 @@
},
{
"name": "magento/magento2-base",
- "version": "2.0.5",
+ "version": "2.0.6",
"dist": {
"type": "zip",
- "url": "https://repo.magento.com/archives/magento/magento2-base/magento-magento2-base-2.0.5.0.zip",
+ "url": "https://repo.magento.com/archives/magento/magento2-base/magento-magento2-base-2.0.6.0.zip",
"reference": null,
- "shasum": "bf8651c1475548c710ee905166b57c65f1482aea"
+ "shasum": "2cbc57a9cba85c2507e3fec7edadeb3ad795d532"
},
"require": {
"braintree/braintree_php": "2.39.0",
@@ -552,7 +629,6 @@
"replace": {
"blueimp/jquery-file-upload": "5.6.14",
"colinmollenhour/cache-backend-redis": "1.8",
- "colinmollenhour/credis": "1.5",
"components/jquery": "1.11.0",
"components/jqueryui": "1.10.4",
"tinymce/tinymce": "3.4.7",
@@ -564,7 +640,6 @@
"component_paths": {
"trentrichardson/jquery-timepicker-addon": "lib/web/jquery/jquery-ui-timepicker-addon.js",
"colinmollenhour/cache-backend-redis": "lib/internal/Cm/Cache/Backend/Redis.php",
- "colinmollenhour/credis": "lib/internal/Credis",
"components/jquery": [
"lib/web/jquery.js",
"lib/web/jquery/jquery.min.js",
@@ -585,10 +660,6 @@
"lib/internal/LinLibertineFont"
],
[
- "lib/internal/Credis",
- "lib/internal/Credis"
- ],
- [
"lib/.htaccess",
"lib/.htaccess"
],
@@ -1150,12 +1221,12 @@
},
{
"name": "magento/module-authorizenet",
- "version": "100.0.5",
+ "version": "100.0.6",
"dist": {
"type": "zip",
- "url": "https://repo.magento.com/archives/magento/module-authorizenet/magento-module-authorizenet-100.0.5.0.zip",
+ "url": "https://repo.magento.com/archives/magento/module-authorizenet/magento-module-authorizenet-100.0.6.0.zip",
"reference": null,
- "shasum": "8afc16a41ec226a403ad6fea7cf06aa3952e2418"
+ "shasum": "0e0c204dbb84e15e1d8b67930fe5159201094966"
},
"require": {
"magento/framework": "100.0.*",
@@ -1184,12 +1255,12 @@
},
{
"name": "magento/module-backend",
- "version": "100.0.6",
+ "version": "100.0.7",
"dist": {
"type": "zip",
- "url": "https://repo.magento.com/archives/magento/module-backend/magento-module-backend-100.0.6.0.zip",
+ "url": "https://repo.magento.com/archives/magento/module-backend/magento-module-backend-100.0.7.0.zip",
"reference": null,
- "shasum": "20d9d267f7a1f731bd204ea2482982f01b5bc3d7"
+ "shasum": "87e39bc1baec0f1d4bd233487f6bc03b0d4c6956"
},
"require": {
"magento/framework": "100.0.*",
@@ -1227,12 +1298,12 @@
},
{
"name": "magento/module-backup",
- "version": "100.0.5",
+ "version": "100.0.6",
"dist": {
"type": "zip",
- "url": "https://repo.magento.com/archives/magento/module-backup/magento-module-backup-100.0.5.0.zip",
+ "url": "https://repo.magento.com/archives/magento/module-backup/magento-module-backup-100.0.6.0.zip",
"reference": null,
- "shasum": "f00cae2d6da998dcd5d7c29ec254123a21c2eb8c"
+ "shasum": "46588c767d0a9037799e5c5456db20e5adc18847"
},
"require": {
"magento/framework": "100.0.*",
@@ -1258,12 +1329,12 @@
},
{
"name": "magento/module-braintree",
- "version": "100.0.5",
+ "version": "100.0.6",
"dist": {
"type": "zip",
- "url": "https://repo.magento.com/archives/magento/module-braintree/magento-module-braintree-100.0.5.0.zip",
+ "url": "https://repo.magento.com/archives/magento/module-braintree/magento-module-braintree-100.0.6.0.zip",
"reference": null,
- "shasum": "ed9b516ba022ef63fce27393726b3f90f3d571a6"
+ "shasum": "2f68cc659891297e3346f60a32e910b2208faf93"
},
"require": {
"braintree/braintree_php": "2.39.0",
@@ -1409,12 +1480,12 @@
},
{
"name": "magento/module-captcha",
- "version": "100.0.6",
+ "version": "100.0.7",
"dist": {
"type": "zip",
- "url": "https://repo.magento.com/archives/magento/module-captcha/magento-module-captcha-100.0.6.0.zip",
+ "url": "https://repo.magento.com/archives/magento/module-captcha/magento-module-captcha-100.0.7.0.zip",
"reference": null,
- "shasum": "822c0f58618485c26b5aca7c2bb38abd2a5f8277"
+ "shasum": "642d83460877a0e0b15a2373abfa1b8dca214285"
},
"require": {
"magento/framework": "100.0.*",
@@ -1441,12 +1512,12 @@
},
{
"name": "magento/module-catalog",
- "version": "100.0.6",
+ "version": "100.0.7",
"dist": {
"type": "zip",
- "url": "https://repo.magento.com/archives/magento/module-catalog/magento-module-catalog-100.0.6.0.zip",
+ "url": "https://repo.magento.com/archives/magento/module-catalog/magento-module-catalog-100.0.7.0.zip",
"reference": null,
- "shasum": "7d6ed2305ba456f8584426c31a63f58e2d2f2c1b"
+ "shasum": "f6da28cbee4e50ed1f9222522e50f8c3edbb1de9"
},
"require": {
"magento/framework": "100.0.*",
@@ -2227,12 +2298,12 @@
},
{
"name": "magento/module-deploy",
- "version": "100.0.5",
+ "version": "100.0.6",
"dist": {
"type": "zip",
- "url": "https://repo.magento.com/archives/magento/module-deploy/magento-module-deploy-100.0.5.0.zip",
+ "url": "https://repo.magento.com/archives/magento/module-deploy/magento-module-deploy-100.0.6.0.zip",
"reference": null,
- "shasum": "bcf8835df106fb67170e59c0809a5f3b99f185d1"
+ "shasum": "e5cc66c6502dd14ba2be0737961ba97a3fd72dee"
},
"require": {
"magento/framework": "100.0.*",
@@ -2843,12 +2914,12 @@
},
{
"name": "magento/module-integration",
- "version": "100.0.5",
+ "version": "100.0.6",
"dist": {
"type": "zip",
- "url": "https://repo.magento.com/archives/magento/module-integration/magento-module-integration-100.0.5.0.zip",
+ "url": "https://repo.magento.com/archives/magento/module-integration/magento-module-integration-100.0.6.0.zip",
"reference": null,
- "shasum": "baee3f3ece2f2195fb203c8338c67c89c2768731"
+ "shasum": "f67bb20e7bce5e52e6ed82a413e38579ed6b3341"
},
"require": {
"magento/framework": "100.0.*",
@@ -3112,12 +3183,12 @@
},
{
"name": "magento/module-offline-payments",
- "version": "100.0.5",
+ "version": "100.0.6",
"dist": {
"type": "zip",
- "url": "https://repo.magento.com/archives/magento/module-offline-payments/magento-module-offline-payments-100.0.5.0.zip",
+ "url": "https://repo.magento.com/archives/magento/module-offline-payments/magento-module-offline-payments-100.0.6.0.zip",
"reference": null,
- "shasum": "415b222e7ed3e9d67124947de26f31138a8281a8"
+ "shasum": "3a846d6b729ef96209d629b5bdb96ba87625d8f2"
},
"require": {
"magento/framework": "100.0.*",
@@ -3183,12 +3254,12 @@
},
{
"name": "magento/module-page-cache",
- "version": "100.0.5",
+ "version": "100.0.6",
"dist": {
"type": "zip",
- "url": "https://repo.magento.com/archives/magento/module-page-cache/magento-module-page-cache-100.0.5.0.zip",
+ "url": "https://repo.magento.com/archives/magento/module-page-cache/magento-module-page-cache-100.0.6.0.zip",
"reference": null,
- "shasum": "a8c9921fe26a8cd6a8a6e74e0ba78de4af8497fb"
+ "shasum": "31719ed14ae3a9933ad40a0b7a516e0db72ef367"
},
"require": {
"magento/framework": "100.0.*",
@@ -3214,12 +3285,12 @@
},
{
"name": "magento/module-payment",
- "version": "100.0.5",
+ "version": "100.0.6",
"dist": {
"type": "zip",
- "url": "https://repo.magento.com/archives/magento/module-payment/magento-module-payment-100.0.5.0.zip",
+ "url": "https://repo.magento.com/archives/magento/module-payment/magento-module-payment-100.0.6.0.zip",
"reference": null,
- "shasum": "adcbca4bc81e6c5257d088dec419bc486a34b78e"
+ "shasum": "8bb5ea8bd483740934145deb5fa093a72c151ae3"
},
"require": {
"magento/framework": "100.0.*",
@@ -3248,12 +3319,12 @@
},
{
"name": "magento/module-paypal",
- "version": "100.0.5",
+ "version": "100.0.6",
"dist": {
"type": "zip",
- "url": "https://repo.magento.com/archives/magento/module-paypal/magento-module-paypal-100.0.5.0.zip",
+ "url": "https://repo.magento.com/archives/magento/module-paypal/magento-module-paypal-100.0.6.0.zip",
"reference": null,
- "shasum": "00c4fdaea15989b7db0c389f67c1211099d77802"
+ "shasum": "693f078dea41d6793dcce5db636a46d977050654"
},
"require": {
"lib-libxml": "*",
@@ -3393,12 +3464,12 @@
},
{
"name": "magento/module-quote",
- "version": "100.0.5",
+ "version": "100.0.6",
"dist": {
"type": "zip",
- "url": "https://repo.magento.com/archives/magento/module-quote/magento-module-quote-100.0.5.0.zip",
+ "url": "https://repo.magento.com/archives/magento/module-quote/magento-module-quote-100.0.6.0.zip",
"reference": null,
- "shasum": "bc9237e09c6e30f8abda8013b499f837514a071a"
+ "shasum": "fd607a2af00a10bde8e25c2546ce96e86d422cb9"
},
"require": {
"magento/framework": "100.0.*",
@@ -3611,12 +3682,12 @@
},
{
"name": "magento/module-sales",
- "version": "100.0.6",
+ "version": "100.0.7",
"dist": {
"type": "zip",
- "url": "https://repo.magento.com/archives/magento/module-sales/magento-module-sales-100.0.6.0.zip",
+ "url": "https://repo.magento.com/archives/magento/module-sales/magento-module-sales-100.0.7.0.zip",
"reference": null,
- "shasum": "512a7947c1f5557d7e0e449c7a05b54e2fed8a44"
+ "shasum": "82fede25e06ca9116ba02b4ddf855301496dcf02"
},
"require": {
"magento/framework": "100.0.*",
@@ -4396,12 +4467,12 @@
},
{
"name": "magento/module-webapi",
- "version": "100.0.5",
+ "version": "100.0.6",
"dist": {
"type": "zip",
- "url": "https://repo.magento.com/archives/magento/module-webapi/magento-module-webapi-100.0.5.0.zip",
+ "url": "https://repo.magento.com/archives/magento/module-webapi/magento-module-webapi-100.0.6.0.zip",
"reference": null,
- "shasum": "fc8813ae2017132a5b9ebb0bc9d02fe3f9d5774f"
+ "shasum": "de30d4518317db49014473867b6bc9bdfd634c7e"
},
"require": {
"magento/framework": "100.0.*",
@@ -4585,15 +4656,17 @@
},
{
"name": "magento/product-community-edition",
- "version": "2.0.5",
+ "version": "2.0.6",
"dist": {
"type": "zip",
- "url": "https://repo.magento.com/archives/magento/product-community-edition/magento-product-community-edition-2.0.5.0.zip",
+ "url": "https://repo.magento.com/archives/magento/product-community-edition/magento-product-community-edition-2.0.6.0.zip",
"reference": null,
- "shasum": "a652f333b48fc07e376fdd78e317328e65c4f0a8"
+ "shasum": "e1856ebd6bdb9b0e42546f8176b6f471fc4431b9"
},
"require": {
"braintree/braintree_php": "2.39.0",
+ "colinmollenhour/credis": "1.6",
+ "colinmollenhour/php-redis-session-abstract": "1.1",
"composer/composer": "1.0.0-alpha10",
"ext-ctype": "*",
"ext-curl": "*",
@@ -4611,7 +4684,7 @@
"ext-zip": "*",
"lib-libxml": "*",
"magento/composer": "~1.0.0",
- "magento/framework": "100.0.7",
+ "magento/framework": "100.0.8",
"magento/language-de_de": "100.0.5",
"magento/language-en_us": "100.0.5",
"magento/language-es_es": "100.0.5",
@@ -4620,19 +4693,19 @@
"magento/language-pt_br": "100.0.5",
"magento/language-zh_hans_cn": "100.0.5",
"magento/magento-composer-installer": "*",
- "magento/magento2-base": "2.0.5",
+ "magento/magento2-base": "2.0.6",
"magento/module-admin-notification": "100.0.5",
"magento/module-advanced-pricing-import-export": "100.0.6",
"magento/module-authorization": "100.0.5",
- "magento/module-authorizenet": "100.0.5",
- "magento/module-backend": "100.0.6",
- "magento/module-backup": "100.0.5",
- "magento/module-braintree": "100.0.5",
+ "magento/module-authorizenet": "100.0.6",
+ "magento/module-backend": "100.0.7",
+ "magento/module-backup": "100.0.6",
+ "magento/module-braintree": "100.0.6",
"magento/module-bundle": "100.0.5",
"magento/module-bundle-import-export": "100.0.5",
"magento/module-cache-invalidate": "100.0.5",
- "magento/module-captcha": "100.0.6",
- "magento/module-catalog": "100.0.6",
+ "magento/module-captcha": "100.0.7",
+ "magento/module-catalog": "100.0.7",
"magento/module-catalog-import-export": "100.0.6",
"magento/module-catalog-inventory": "100.0.5",
"magento/module-catalog-rule": "100.0.5",
@@ -4653,7 +4726,7 @@
"magento/module-currency-symbol": "100.0.5",
"magento/module-customer": "100.0.6",
"magento/module-customer-import-export": "100.0.5",
- "magento/module-deploy": "100.0.5",
+ "magento/module-deploy": "100.0.6",
"magento/module-developer": "100.0.5",
"magento/module-dhl": "100.0.5",
"magento/module-directory": "100.0.5",
@@ -4671,7 +4744,7 @@
"magento/module-grouped-product": "100.0.5",
"magento/module-import-export": "100.0.5",
"magento/module-indexer": "100.0.5",
- "magento/module-integration": "100.0.5",
+ "magento/module-integration": "100.0.6",
"magento/module-layered-navigation": "100.0.5",
"magento/module-marketplace": "100.0.5",
"magento/module-media-storage": "100.0.5",
@@ -4679,21 +4752,21 @@
"magento/module-multishipping": "100.0.5",
"magento/module-new-relic-reporting": "100.0.5",
"magento/module-newsletter": "100.0.6",
- "magento/module-offline-payments": "100.0.5",
+ "magento/module-offline-payments": "100.0.6",
"magento/module-offline-shipping": "100.0.5",
- "magento/module-page-cache": "100.0.5",
- "magento/module-payment": "100.0.5",
- "magento/module-paypal": "100.0.5",
+ "magento/module-page-cache": "100.0.6",
+ "magento/module-payment": "100.0.6",
+ "magento/module-paypal": "100.0.6",
"magento/module-persistent": "100.0.5",
"magento/module-product-alert": "100.0.5",
"magento/module-product-video": "100.0.5",
- "magento/module-quote": "100.0.5",
+ "magento/module-quote": "100.0.6",
"magento/module-reports": "100.0.5",
"magento/module-require-js": "100.0.5",
"magento/module-review": "100.0.5",
"magento/module-rss": "100.0.5",
"magento/module-rule": "100.0.5",
- "magento/module-sales": "100.0.6",
+ "magento/module-sales": "100.0.7",
"magento/module-sales-rule": "100.0.5",
"magento/module-sales-sequence": "100.0.5",
"magento/module-sample-data": "100.0.5",
@@ -4715,7 +4788,7 @@
"magento/module-usps": "100.0.5",
"magento/module-variable": "100.0.5",
"magento/module-version": "100.0.5",
- "magento/module-webapi": "100.0.5",
+ "magento/module-webapi": "100.0.6",
"magento/module-webapi-security": "100.0.1",
"magento/module-weee": "100.0.5",
"magento/module-widget": "100.0.6",
@@ -5319,16 +5392,16 @@
},
{
"name": "symfony/event-dispatcher",
- "version": "v2.8.4",
+ "version": "v2.8.6",
"source": {
"type": "git",
"url": "https://github.com/symfony/event-dispatcher.git",
- "reference": "47d2d8cade9b1c3987573d2943bb9352536cdb87"
+ "reference": "a158f13992a3147d466af7a23b564ac719a4ddd8"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/47d2d8cade9b1c3987573d2943bb9352536cdb87",
- "reference": "47d2d8cade9b1c3987573d2943bb9352536cdb87",
+ "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/a158f13992a3147d466af7a23b564ac719a4ddd8",
+ "reference": "a158f13992a3147d466af7a23b564ac719a4ddd8",
"shasum": ""
},
"require": {
@@ -5375,11 +5448,11 @@
],
"description": "Symfony EventDispatcher Component",
"homepage": "https://symfony.com",
- "time": "2016-03-07 14:04:32"
+ "time": "2016-05-03 18:59:18"
},
{
"name": "symfony/finder",
- "version": "v2.8.4",
+ "version": "v2.8.6",
"source": {
"type": "git",
"url": "https://github.com/symfony/finder.git",
@@ -5428,16 +5501,16 @@
},
{
"name": "symfony/process",
- "version": "v2.8.4",
+ "version": "v2.8.6",
"source": {
"type": "git",
"url": "https://github.com/symfony/process.git",
- "reference": "fb467471952ef5cf8497c029980e556b47545333"
+ "reference": "1276bd9be89be039748cf753a2137f4ef149cd74"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/process/zipball/fb467471952ef5cf8497c029980e556b47545333",
- "reference": "fb467471952ef5cf8497c029980e556b47545333",
+ "url": "https://api.github.com/repos/symfony/process/zipball/1276bd9be89be039748cf753a2137f4ef149cd74",
+ "reference": "1276bd9be89be039748cf753a2137f4ef149cd74",
"shasum": ""
},
"require": {
@@ -5473,7 +5546,7 @@
],
"description": "Symfony Process Component",
"homepage": "https://symfony.com",
- "time": "2016-03-23 13:11:46"
+ "time": "2016-04-14 15:22:22"
},
{
"name": "tedivm/jshrink",
@@ -5567,7 +5640,7 @@
},
{
"name": "zendframework/zend-code",
- "version": "2.4.9",
+ "version": "2.4.10",
"source": {
"type": "git",
"url": "https://github.com/zendframework/zend-code.git",
@@ -5620,7 +5693,7 @@
},
{
"name": "zendframework/zend-config",
- "version": "2.4.9",
+ "version": "2.4.10",
"source": {
"type": "git",
"url": "https://github.com/zendframework/zend-config.git",
@@ -5677,7 +5750,7 @@
},
{
"name": "zendframework/zend-console",
- "version": "2.4.9",
+ "version": "2.4.10",
"source": {
"type": "git",
"url": "https://github.com/zendframework/zend-console.git",
@@ -5727,7 +5800,7 @@
},
{
"name": "zendframework/zend-crypt",
- "version": "2.4.9",
+ "version": "2.4.10",
"source": {
"type": "git",
"url": "https://github.com/zendframework/zend-crypt.git",
@@ -5779,7 +5852,7 @@
},
{
"name": "zendframework/zend-di",
- "version": "2.4.9",
+ "version": "2.4.10",
"source": {
"type": "git",
"url": "https://github.com/zendframework/zend-di.git",
@@ -5830,7 +5903,7 @@
},
{
"name": "zendframework/zend-escaper",
- "version": "2.4.9",
+ "version": "2.4.10",
"source": {
"type": "git",
"url": "https://github.com/zendframework/zend-escaper.git",
@@ -5875,7 +5948,7 @@
},
{
"name": "zendframework/zend-eventmanager",
- "version": "2.4.9",
+ "version": "2.4.10",
"source": {
"type": "git",
"url": "https://github.com/zendframework/zend-eventmanager.git",
@@ -5921,7 +5994,7 @@
},
{
"name": "zendframework/zend-filter",
- "version": "2.4.9",
+ "version": "2.4.10",
"source": {
"type": "git",
"url": "https://github.com/zendframework/zend-filter.git",
@@ -5977,7 +6050,7 @@
},
{
"name": "zendframework/zend-form",
- "version": "2.4.9",
+ "version": "2.4.10",
"source": {
"type": "git",
"url": "https://github.com/zendframework/zend-form.git",
@@ -6048,7 +6121,7 @@
},
{
"name": "zendframework/zend-http",
- "version": "2.4.9",
+ "version": "2.4.10",
"source": {
"type": "git",
"url": "https://github.com/zendframework/zend-http.git",
@@ -6099,7 +6172,7 @@
},
{
"name": "zendframework/zend-i18n",
- "version": "2.4.9",
+ "version": "2.4.10",
"source": {
"type": "git",
"url": "https://github.com/zendframework/zend-i18n.git",
@@ -6163,7 +6236,7 @@
},
{
"name": "zendframework/zend-inputfilter",
- "version": "2.4.9",
+ "version": "2.4.10",
"source": {
"type": "git",
"url": "https://github.com/zendframework/zend-inputfilter.git",
@@ -6214,7 +6287,7 @@
},
{
"name": "zendframework/zend-json",
- "version": "2.4.9",
+ "version": "2.4.10",
"source": {
"type": "git",
"url": "https://github.com/zendframework/zend-json.git",
@@ -6268,7 +6341,7 @@
},
{
"name": "zendframework/zend-loader",
- "version": "2.4.9",
+ "version": "2.4.10",
"source": {
"type": "git",
"url": "https://github.com/zendframework/zend-loader.git",
@@ -6313,7 +6386,7 @@
},
{
"name": "zendframework/zend-log",
- "version": "2.4.9",
+ "version": "2.4.10",
"source": {
"type": "git",
"url": "https://github.com/zendframework/zend-log.git",
@@ -6375,7 +6448,7 @@
},
{
"name": "zendframework/zend-math",
- "version": "2.4.9",
+ "version": "2.4.10",
"source": {
"type": "git",
"url": "https://github.com/zendframework/zend-math.git",
@@ -6426,7 +6499,7 @@
},
{
"name": "zendframework/zend-modulemanager",
- "version": "2.4.9",
+ "version": "2.4.10",
"source": {
"type": "git",
"url": "https://github.com/zendframework/zend-modulemanager.git",
@@ -6484,7 +6557,7 @@
},
{
"name": "zendframework/zend-mvc",
- "version": "2.4.9",
+ "version": "2.4.10",
"source": {
"type": "git",
"url": "https://github.com/zendframework/zend-mvc.git",
@@ -6572,7 +6645,7 @@
},
{
"name": "zendframework/zend-serializer",
- "version": "2.4.9",
+ "version": "2.4.10",
"source": {
"type": "git",
"url": "https://github.com/zendframework/zend-serializer.git",
@@ -6625,7 +6698,7 @@
},
{
"name": "zendframework/zend-server",
- "version": "2.4.9",
+ "version": "2.4.10",
"source": {
"type": "git",
"url": "https://github.com/zendframework/zend-server.git",
@@ -6672,7 +6745,7 @@
},
{
"name": "zendframework/zend-servicemanager",
- "version": "2.4.9",
+ "version": "2.4.10",
"source": {
"type": "git",
"url": "https://github.com/zendframework/zend-servicemanager.git",
@@ -6722,7 +6795,7 @@
},
{
"name": "zendframework/zend-soap",
- "version": "2.4.9",
+ "version": "2.4.10",
"source": {
"type": "git",
"url": "https://github.com/zendframework/zend-soap.git",
@@ -6774,7 +6847,7 @@
},
{
"name": "zendframework/zend-stdlib",
- "version": "2.4.9",
+ "version": "2.4.10",
"source": {
"type": "git",
"url": "https://github.com/zendframework/zend-stdlib.git",
@@ -6829,7 +6902,7 @@
},
{
"name": "zendframework/zend-text",
- "version": "2.4.9",
+ "version": "2.4.10",
"source": {
"type": "git",
"url": "https://github.com/zendframework/zend-text.git",
@@ -6876,7 +6949,7 @@
},
{
"name": "zendframework/zend-uri",
- "version": "2.4.9",
+ "version": "2.4.10",
"source": {
"type": "git",
"url": "https://github.com/zendframework/zend-uri.git",
@@ -6924,7 +6997,7 @@
},
{
"name": "zendframework/zend-validator",
- "version": "2.4.9",
+ "version": "2.4.10",
"source": {
"type": "git",
"url": "https://github.com/zendframework/zend-validator.git",
@@ -6989,7 +7062,7 @@
},
{
"name": "zendframework/zend-view",
- "version": "2.4.9",
+ "version": "2.4.10",
"source": {
"type": "git",
"url": "https://github.com/zendframework/zend-view.git",
@@ -7545,21 +7618,24 @@
},
{
"name": "phpunit/php-timer",
- "version": "1.0.7",
+ "version": "1.0.8",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-timer.git",
- "reference": "3e82f4e9fc92665fafd9157568e4dcb01d014e5b"
+ "reference": "38e9124049cf1a164f1e4537caf19c99bf1eb260"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3e82f4e9fc92665fafd9157568e4dcb01d014e5b",
- "reference": "3e82f4e9fc92665fafd9157568e4dcb01d014e5b",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/38e9124049cf1a164f1e4537caf19c99bf1eb260",
+ "reference": "38e9124049cf1a164f1e4537caf19c99bf1eb260",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
+ "require-dev": {
+ "phpunit/phpunit": "~4|~5"
+ },
"type": "library",
"autoload": {
"classmap": [
@@ -7582,7 +7658,7 @@
"keywords": [
"timer"
],
- "time": "2015-06-21 08:01:12"
+ "time": "2016-05-12 18:03:57"
},
{
"name": "phpunit/php-token-stream",
@@ -7881,16 +7957,16 @@
},
{
"name": "sebastian/environment",
- "version": "1.3.5",
+ "version": "1.3.6",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/environment.git",
- "reference": "dc7a29032cf72b54f36dac15a1ca5b3a1b6029bf"
+ "reference": "2292b116f43c272ff4328083096114f84ea46a56"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/dc7a29032cf72b54f36dac15a1ca5b3a1b6029bf",
- "reference": "dc7a29032cf72b54f36dac15a1ca5b3a1b6029bf",
+ "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/2292b116f43c272ff4328083096114f84ea46a56",
+ "reference": "2292b116f43c272ff4328083096114f84ea46a56",
"shasum": ""
},
"require": {
@@ -7927,7 +8003,7 @@
"environment",
"hhvm"
],
- "time": "2016-02-26 18:40:46"
+ "time": "2016-05-04 07:59:13"
},
{
"name": "sebastian/exporter",
@@ -8213,16 +8289,16 @@
},
{
"name": "symfony/config",
- "version": "v2.8.4",
+ "version": "v2.8.6",
"source": {
"type": "git",
"url": "https://github.com/symfony/config.git",
- "reference": "5273f4724dc5288fe7a33cb08077ab9852621f2c"
+ "reference": "edbbcf33cffa2a85104fc80de8dc052cc51596bb"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/config/zipball/5273f4724dc5288fe7a33cb08077ab9852621f2c",
- "reference": "5273f4724dc5288fe7a33cb08077ab9852621f2c",
+ "url": "https://api.github.com/repos/symfony/config/zipball/edbbcf33cffa2a85104fc80de8dc052cc51596bb",
+ "reference": "edbbcf33cffa2a85104fc80de8dc052cc51596bb",
"shasum": ""
},
"require": {
@@ -8262,20 +8338,20 @@
],
"description": "Symfony Config Component",
"homepage": "https://symfony.com",
- "time": "2016-03-04 07:54:35"
+ "time": "2016-04-20 18:52:26"
},
{
"name": "symfony/dependency-injection",
- "version": "v2.8.4",
+ "version": "v2.8.6",
"source": {
"type": "git",
"url": "https://github.com/symfony/dependency-injection.git",
- "reference": "f7b4a498e679fa440b16facb934680a1527ed48c"
+ "reference": "bd04588c087651ceffdc45d40dc4de05af9c7c52"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/f7b4a498e679fa440b16facb934680a1527ed48c",
- "reference": "f7b4a498e679fa440b16facb934680a1527ed48c",
+ "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/bd04588c087651ceffdc45d40dc4de05af9c7c52",
+ "reference": "bd04588c087651ceffdc45d40dc4de05af9c7c52",
"shasum": ""
},
"require": {
@@ -8291,6 +8367,7 @@
},
"suggest": {
"symfony/config": "",
+ "symfony/expression-language": "For using expressions in service container configuration",
"symfony/proxy-manager-bridge": "Generate service proxies to lazy load them",
"symfony/yaml": ""
},
@@ -8324,20 +8401,20 @@
],
"description": "Symfony DependencyInjection Component",
"homepage": "https://symfony.com",
- "time": "2016-03-21 07:27:21"
+ "time": "2016-05-09 18:12:35"
},
{
"name": "symfony/filesystem",
- "version": "v2.8.4",
+ "version": "v2.8.6",
"source": {
"type": "git",
"url": "https://github.com/symfony/filesystem.git",
- "reference": "f08ffdf229252cd2745558cb2112df43903bcae4"
+ "reference": "dee379131dceed90a429e951546b33edfe7dccbb"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/filesystem/zipball/f08ffdf229252cd2745558cb2112df43903bcae4",
- "reference": "f08ffdf229252cd2745558cb2112df43903bcae4",
+ "url": "https://api.github.com/repos/symfony/filesystem/zipball/dee379131dceed90a429e951546b33edfe7dccbb",
+ "reference": "dee379131dceed90a429e951546b33edfe7dccbb",
"shasum": ""
},
"require": {
@@ -8373,11 +8450,11 @@
],
"description": "Symfony Filesystem Component",
"homepage": "https://symfony.com",
- "time": "2016-03-27 10:20:16"
+ "time": "2016-04-12 18:01:21"
},
{
"name": "symfony/stopwatch",
- "version": "v3.0.4",
+ "version": "v3.0.6",
"source": {
"type": "git",
"url": "https://github.com/symfony/stopwatch.git",
@@ -8426,16 +8503,16 @@
},
{
"name": "symfony/yaml",
- "version": "v2.8.4",
+ "version": "v2.8.6",
"source": {
"type": "git",
"url": "https://github.com/symfony/yaml.git",
- "reference": "584e52cb8f788a887553ba82db6caacb1d6260bb"
+ "reference": "e4fbcc65f90909c999ac3b4dfa699ee6563a9940"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/yaml/zipball/584e52cb8f788a887553ba82db6caacb1d6260bb",
- "reference": "584e52cb8f788a887553ba82db6caacb1d6260bb",
+ "url": "https://api.github.com/repos/symfony/yaml/zipball/e4fbcc65f90909c999ac3b4dfa699ee6563a9940",
+ "reference": "e4fbcc65f90909c999ac3b4dfa699ee6563a9940",
"shasum": ""
},
"require": {
@@ -8471,7 +8548,7 @@
],
"description": "Symfony Yaml Component",
"homepage": "https://symfony.com",
- "time": "2016-03-04 07:54:35"
+ "time": "2016-03-29 19:00:15"
}
],
"aliases": [],
--- Magento-CE-2.0.5/dev/tests/api-functional/testsuite/Magento/Quote/Api/GuestCartManagementTest.php 2016-04-27 23:23:14.000000000 -0300
+++ Magento-CE-2.0.6/dev/tests/api-functional/testsuite/Magento/Quote/Api/GuestCartManagementTest.php 2016-05-16 13:49:31.000000000 -0300
@@ -70,9 +70,9 @@
$quote = $this->objectManager->create('Magento\Quote\Model\Quote')->load('test01', 'reserved_order_id');
$cartId = $quote->getId();
/** @var \Magento\Quote\Model\QuoteIdMask $quoteIdMask */
- $quoteIdMask = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()
- ->create('Magento\Quote\Model\QuoteIdMaskFactory')
- ->create();
+ $quoteIdMaskFactory = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()
+ ->create('Magento\Quote\Model\QuoteIdMaskFactory');
+ $quoteIdMask = $quoteIdMaskFactory->create();
$quoteIdMask->load($cartId, 'quote_id');
//Use masked cart Id
$cartId = $quoteIdMask->getMaskedId();
@@ -110,6 +110,7 @@
$this->assertEquals($customer->getId(), $quote->getCustomerId());
$this->assertEquals($customer->getFirstname(), $quote->getCustomerFirstname());
$this->assertEquals($customer->getLastname(), $quote->getCustomerLastname());
+ $this->assertNull($quoteIdMaskFactory->create()->load($cartId, 'masked_id')->getId());
}
/**
--- Magento-CE-2.0.5/dev/tests/api-functional/testsuite/Magento/Webapi/Authentication/RestTest.php 2016-04-27 23:23:14.000000000 -0300
+++ Magento-CE-2.0.6/dev/tests/api-functional/testsuite/Magento/Webapi/Authentication/RestTest.php 2016-05-16 13:49:31.000000000 -0300
@@ -90,6 +90,8 @@
public function testGetRequestTokenExpiredConsumer()
{
$this::consumerFixture('2012-01-01 00:00:00');
+ $this::$_consumer->setUpdatedAt('2012-01-01 00:00:00');
+ $this::$_consumer->save();
/** @var $oAuthClient \Magento\TestFramework\Authentication\Rest\OauthClient */
$oAuthClient = $this->_getOauthClient(self::$_consumerKey, self::$_consumerSecret);
$oAuthClient->requestRequestToken();
--- Magento-CE-2.0.5/dev/tests/functional/lib/Magento/Mtf/Util/Generate/Factory/AbstractFactory.php 2016-04-27 23:23:13.000000000 -0300
+++ Magento-CE-2.0.6/dev/tests/functional/lib/Magento/Mtf/Util/Generate/Factory/AbstractFactory.php 2016-05-16 13:49:30.000000000 -0300
@@ -105,7 +105,7 @@
* @return bool
* @throws \Exception
*/
- protected function checkAndCreateFolder($folder, $mode = DriverInterface::WRITEABLE_DIRECTORY_MODE)
+ protected function checkAndCreateFolder($folder, $mode = 0777)
{
if (is_dir($folder)) {
return true;
@@ -127,7 +127,7 @@
* @param bool $recursive
* @return bool
*/
- protected function mkDir($dir, $mode = 0770, $recursive = true)
+ protected function mkDir($dir, $mode = 0777, $recursive = true)
{
return @mkdir($dir, $mode, $recursive);
}
--- Magento-CE-2.0.5/dev/tests/integration/framework/Magento/TestFramework/Application.php 2016-04-27 23:23:12.000000000 -0300
+++ Magento-CE-2.0.6/dev/tests/integration/framework/Magento/TestFramework/Application.php 2016-05-16 13:49:30.000000000 -0300
@@ -573,7 +573,7 @@
{
if (!file_exists($dir)) {
$old = umask(0);
- mkdir($dir, DriverInterface::WRITEABLE_DIRECTORY_MODE);
+ mkdir($dir);
umask($old);
} elseif (!is_dir($dir)) {
throw new \Magento\Framework\Exception\LocalizedException(__("'%1' is not a directory.", $dir));
--- Magento-CE-2.0.5/dev/tests/integration/testsuite/Magento/Cms/Model/Wysiwyg/Images/StorageTest.php 2016-04-27 23:23:12.000000000 -0300
+++ Magento-CE-2.0.6/dev/tests/integration/testsuite/Magento/Cms/Model/Wysiwyg/Images/StorageTest.php 2016-05-16 13:49:30.000000000 -0300
@@ -25,7 +25,7 @@
'Magento\Cms\Helper\Wysiwyg\Images'
)->getCurrentPath() . 'MagentoCmsModelWysiwygImagesStorageTest';
if (!file_exists(self::$_baseDir)) {
- mkdir(self::$_baseDir, 0770);
+ mkdir(self::$_baseDir);
}
touch(self::$_baseDir . '/1.swf');
}
--- Magento-CE-2.0.5/dev/tests/integration/testsuite/Magento/Framework/Filesystem/Directory/WriteTest.php 2016-04-27 23:23:13.000000000 -0300
+++ Magento-CE-2.0.6/dev/tests/integration/testsuite/Magento/Framework/Filesystem/Directory/WriteTest.php 2016-05-16 13:49:30.000000000 -0300
@@ -28,7 +28,7 @@
*/
public function testInstance()
{
- $dir = $this->getDirectoryInstance('newDir1', 0770);
+ $dir = $this->getDirectoryInstance('newDir1', 0777);
$this->assertTrue($dir instanceof ReadInterface);
$this->assertTrue($dir instanceof WriteInterface);
}
@@ -56,10 +56,10 @@
public function createProvider()
{
return [
- ['newDir1', 0770, "newDir1"],
- ['newDir1', 0770, "root_dir1/subdir1/subdir2"],
- ['newDir2', 0750, "root_dir2/subdir"],
- ['newDir1', 0770, "."]
+ ['newDir1', 0777, "newDir1"],
+ ['newDir1', 0777, "root_dir1/subdir1/subdir2"],
+ ['newDir2', 0777, "root_dir2/subdir"],
+ ['newDir1', 0777, "."]
];
}
@@ -71,7 +71,7 @@
*/
public function testDelete($path)
{
- $directory = $this->getDirectoryInstance('newDir', 0770);
+ $directory = $this->getDirectoryInstance('newDir', 0777);
$directory->create($path);
$this->assertTrue($directory->isExist($path));
$directory->delete($path);
@@ -116,7 +116,7 @@
*/
public function renameProvider()
{
- return [['newDir1', 0770, 'first_name.txt', 'second_name.txt']];
+ return [['newDir1', 0777, 'first_name.txt', 'second_name.txt']];
}
/**
@@ -150,7 +150,7 @@
*/
public function renameTargetDirProvider()
{
- return [['dir1', 'dir2', 0770, 'first_name.txt', 'second_name.txt']];
+ return [['dir1', 'dir2', 0777, 'first_name.txt', 'second_name.txt']];
}
/**
@@ -180,8 +180,8 @@
public function copyProvider()
{
return [
- ['newDir1', 0770, 'first_name.txt', 'second_name.txt'],
- ['newDir1', 0770, 'subdir/first_name.txt', 'subdir/second_name.txt']
+ ['newDir1', 0777, 'first_name.txt', 'second_name.txt'],
+ ['newDir1', 0777, 'subdir/first_name.txt', 'subdir/second_name.txt']
];
}
@@ -216,8 +216,8 @@
public function copyTargetDirProvider()
{
return [
- ['dir1', 'dir2', 0770, 'first_name.txt', 'second_name.txt'],
- ['dir1', 'dir2', 0770, 'subdir/first_name.txt', 'subdir/second_name.txt']
+ ['dir1', 'dir2', 0777, 'first_name.txt', 'second_name.txt'],
+ ['dir1', 'dir2', 0777, 'subdir/first_name.txt', 'subdir/second_name.txt']
];
}
@@ -226,9 +226,9 @@
*/
public function testChangePermissions()
{
- $directory = $this->getDirectoryInstance('newDir1', 0770);
+ $directory = $this->getDirectoryInstance('newDir1', 0777);
$directory->create('test_directory');
- $this->assertTrue($directory->changePermissions('test_directory', 0640));
+ $this->assertTrue($directory->changePermissions('test_directory', 0644));
}
/**
@@ -241,7 +241,7 @@
$directory->create('test_directory/subdirectory');
$directory->writeFile('test_directory/subdirectory/test_file.txt', 'Test Content');
- $this->assertTrue($directory->changePermissionsRecursively('test_directory', 0750, 0640));
+ $this->assertTrue($directory->changePermissionsRecursively('test_directory', 0777, 0644));
}
/**
@@ -269,8 +269,8 @@
public function touchProvider()
{
return [
- ['test_directory', 0770, 'touch_file.txt', time() - 3600],
- ['test_directory', 0770, 'subdirectory/touch_file.txt', time() - 3600]
+ ['test_directory', 0777, 'touch_file.txt', time() - 3600],
+ ['test_directory', 0777, 'subdirectory/touch_file.txt', time() - 3600]
];
}
@@ -279,7 +279,7 @@
*/
public function testIsWritable()
{
- $directory = $this->getDirectoryInstance('newDir1', 0770);
+ $directory = $this->getDirectoryInstance('newDir1', 0777);
$directory->create('bar');
$this->assertFalse($directory->isWritable('not_existing_dir'));
$this->assertTrue($directory->isWritable('bar'));
@@ -310,8 +310,8 @@
public function openFileProvider()
{
return [
- ['newDir1', 0770, 'newFile.txt', 'w+'],
- ['newDir1', 0770, 'subdirectory/newFile.txt', 'w+']
+ ['newDir1', 0777, 'newFile.txt', 'w+'],
+ ['newDir1', 0777, 'subdirectory/newFile.txt', 'w+']
];
}
@@ -325,7 +325,7 @@
*/
public function testWriteFile($path, $content, $extraContent)
{
- $directory = $this->getDirectoryInstance('writeFileDir', 0770);
+ $directory = $this->getDirectoryInstance('writeFileDir', 0777);
$directory->writeFile($path, $content);
$this->assertEquals($content, $directory->readFile($path));
$directory->writeFile($path, $extraContent);
@@ -342,7 +342,7 @@
*/
public function testWriteFileAppend($path, $content, $extraContent)
{
- $directory = $this->getDirectoryInstance('writeFileDir', 0770);
+ $directory = $this->getDirectoryInstance('writeFileDir', 0777);
$directory->writeFile($path, $content, 'a+');
$this->assertEquals($content, $directory->readFile($path));
$directory->writeFile($path, $extraContent, 'a+');
--- Magento-CE-2.0.5/dev/tests/integration/testsuite/Magento/Framework/Filesystem/Driver/FileTest.php 2016-04-27 23:23:13.000000000 -0300
+++ Magento-CE-2.0.6/dev/tests/integration/testsuite/Magento/Framework/Filesystem/Driver/FileTest.php 2016-05-16 13:49:30.000000000 -0300
@@ -75,7 +75,7 @@
if (is_dir($generatedPath)) {
$this->assertTrue($this->driver->deleteDirectory($generatedPathBase));
}
- $this->assertTrue($this->driver->createDirectory($generatedPath, '755'));
+ $this->assertTrue($this->driver->createDirectory($generatedPath));
$this->assertTrue(is_dir($generatedPath));
}
}
--- Magento-CE-2.0.5/dev/tests/integration/testsuite/Magento/Framework/Session/ConfigTest.php 2016-04-27 23:23:13.000000000 -0300
+++ Magento-CE-2.0.6/dev/tests/integration/testsuite/Magento/Framework/Session/ConfigTest.php 2016-05-16 13:49:30.000000000 -0300
@@ -36,15 +36,12 @@
$sessionManager->writeClose();
}
$this->deploymentConfigMock = $this->getMock('Magento\Framework\App\DeploymentConfig', [], [], '', false);
+
$this->deploymentConfigMock->expects($this->at(0))
->method('get')
- ->with($this->equalTo(Config::PARAM_SESSION_SAVE_METHOD), $this->anything())
- ->will($this->returnValue('files'));
- $this->deploymentConfigMock->expects($this->at(1))
- ->method('get')
->with(Config::PARAM_SESSION_SAVE_PATH)
->will($this->returnValue(null));
- $this->deploymentConfigMock->expects($this->at(2))
+ $this->deploymentConfigMock->expects($this->at(1))
->method('get')
->with(Config::PARAM_SESSION_CACHE_LIMITER)
->will($this->returnValue($this->_cacheLimiter));
@@ -86,11 +83,6 @@
$this->assertEquals($this->_model->getSavePath(), $this->_model->getOption('save_path'));
}
- public function testGetSessionSaveMethod()
- {
- $this->assertEquals('files', $this->_model->getSaveHandler());
- }
-
/**
* Unable to add integration tests for testGetLifetimePathNonDefault
*
@@ -122,7 +114,6 @@
return [
['save_path', 'getSavePath', __DIR__],
['name', 'getName', 'FOOBAR'],
- ['save_handler', 'getSaveHandler', 'user'],
['gc_probability', 'getGcProbability', 42],
['gc_divisor', 'getGcDivisor', 3],
['gc_maxlifetime', 'getGcMaxlifetime', 180],
@@ -152,12 +143,6 @@
$this->assertEquals('FOOBAR', $this->_model->getName());
}
- public function testSaveHandlerIsMutable()
- {
- $this->_model->setSaveHandler('user');
- $this->assertEquals('user', $this->_model->getSaveHandler());
- }
-
public function testCookieLifetimeIsMutable()
{
$this->_model->setCookieLifetime(20);
@@ -295,7 +280,7 @@
$this->markTestSkipped('Cannot set session.save_path with ini_set');
}
- $this->deploymentConfigMock->expects($this->at(1))
+ $this->deploymentConfigMock->expects($this->at(0))
->method('get')
->with(Config::PARAM_SESSION_SAVE_PATH)
->will($this->returnValue($given));
--- Magento-CE-2.0.5/dev/tests/integration/testsuite/Magento/Framework/Session/SaveHandlerTest.php 1969-12-31 21:00:00.000000000 -0300
+++ Magento-CE-2.0.6/dev/tests/integration/testsuite/Magento/Framework/Session/SaveHandlerTest.php 2016-05-16 13:49:30.000000000 -0300
@@ -0,0 +1,89 @@
+<?php
+/**
+ * Copyright © 2016 Magento. All rights reserved.
+ * See COPYING.txt for license details.
+ */
+namespace Magento\Framework\Session;
+
+use Magento\Framework\App\DeploymentConfig;
+use Magento\Framework\Session\Config\ConfigInterface;
+use Magento\Framework\Session\SaveHandler;
+use Magento\Framework\App\ObjectManager;
+
+class SaveHandlerTest extends \PHPUnit_Framework_TestCase
+{
+ /** @var \Magento\Framework\Session\Config\ConfigInterface */
+ private $sessionConfig;
+
+ /** @var \Magento\Framework\App\DeploymentConfig */
+ private $deploymentConfig;
+
+ public function setUp()
+ {
+ $this->sessionConfig = ObjectManager::getInstance()->get(ConfigInterface::class);
+ $this->deploymentConfig = ObjectManager::getInstance()->get(DeploymentConfig::class);
+ }
+
+ /**
+ * Tests that the session handler is correctly set when object is created.
+ *
+ * @dataProvider saveHandlerProvider
+ * @param string $deploymentConfigHandler
+ * @param string $iniHandler
+ */
+ public function testSetSaveHandler($deploymentConfigHandler, $iniHandler)
+ {
+ // Set expected session.save_handler config
+ if ($deploymentConfigHandler) {
+ if ($deploymentConfigHandler !== 'files') {
+ $expected = 'user';
+ } else {
+ $expected = $deploymentConfigHandler;
+ }
+ } else if ($iniHandler) {
+ $expected = $iniHandler;
+ } else {
+ $expected = SaveHandlerInterface::DEFAULT_HANDLER;
+ }
+
+ // Set ini configuration
+ if ($iniHandler) {
+ $oldIni = ini_set('session.save_handler', $iniHandler);
+ }
+
+ /** @var DeploymentConfig | \PHPUnit_Framework_MockObject_MockObject $deploymentConfigMock */
+ $deploymentConfigMock = $this->getMockBuilder(DeploymentConfig::class)
+ ->disableOriginalConstructor()
+ ->getMock();
+ $deploymentConfigMock->expects($this->once())
+ ->method('get')
+ ->with(Config::PARAM_SESSION_SAVE_METHOD, SaveHandlerInterface::DEFAULT_HANDLER)
+ ->willReturn($deploymentConfigHandler ?: SaveHandlerInterface::DEFAULT_HANDLER);
+
+ new SaveHandler(
+ ObjectManager::getInstance()->get(SaveHandlerFactory::class),
+ $deploymentConfigMock
+ );
+
+ // Test expectation
+ $this->assertEquals(
+ $expected,
+ ObjectManager::getInstance()->get(ConfigInterface::class)->getOption('session.save_handler')
+ );
+
+ // Reset ini configuration
+ if (isset($oldIni)) {
+ ini_set('session.save_handler', $oldIni);
+ }
+ }
+
+ public function saveHandlerProvider()
+ {
+ return [
+ ['db', false],
+ ['db', 'files'],
+ [false, 'files'],
+ [false, false],
+ ];
+ }
+}
--- Magento-CE-2.0.5/dev/tests/integration/testsuite/Magento/Paypal/Model/Payment/Method/Billing/AbstractAgreementTest.php 2016-04-27 23:23:12.000000000 -0300
+++ Magento-CE-2.0.6/dev/tests/integration/testsuite/Magento/Paypal/Model/Payment/Method/Billing/AbstractAgreementTest.php 2016-05-16 13:49:30.000000000 -0300
@@ -6,6 +6,8 @@
namespace Magento\Paypal\Model\Payment\Method\Billing;
+use Magento\Quote\Api\Data\PaymentInterface;
+
class AbstractAgreementTest extends \PHPUnit_Framework_TestCase
{
/** @var \Magento\Paypal\Model\Method\Agreement */
@@ -60,8 +62,10 @@
)->getFirstItem();
$data = new \Magento\Framework\DataObject(
[
+ PaymentInterface::KEY_ADDITIONAL_DATA => [
AbstractAgreement::TRANSPORT_BILLING_AGREEMENT_ID => $billingAgreement->getId()
]
+ ]
);
$this->_model->assignData($data);
$this->assertEquals(
--- Magento-CE-2.0.5/dev/tests/integration/testsuite/Magento/Setup/Controller/ComponentGridTest.php 2016-04-27 23:23:12.000000000 -0300
+++ Magento-CE-2.0.6/dev/tests/integration/testsuite/Magento/Setup/Controller/ComponentGridTest.php 2016-05-16 13:49:30.000000000 -0300
@@ -15,73 +15,13 @@
use Magento\Framework\Stdlib\DateTime\TimezoneInterface;
use Magento\Setup\Model\MarketplaceManager;
-class ComponentGridTest extends \PHPUnit_Framework_TestCase
-{
- /**
- * @var ComposerInformation|\PHPUnit_Framework_MockObject_MockObject
- */
- private $composerInformationMock;
-
- /**
- * @var UpdatePackagesCache|\PHPUnit_Framework_MockObject_MockObject
- */
- private $updatePackagesCacheMock;
-
- /**
- * @var TimezoneInterface|\PHPUnit_Framework_MockObject_MockObject
- *
- */
- private $timezoneMock;
-
/**
- * @var FullModuleList|\PHPUnit_Framework_MockObject_MockObject
- */
- private $fullModuleListMock;
-
- /**
- * @var ModuleList|\PHPUnit_Framework_MockObject_MockObject
- */
- private $enabledModuleListMock;
-
- /**
- * @var PackageInfoFactory|\PHPUnit_Framework_MockObject_MockObject
- */
- private $packageInfoFactoryMock;
-
- /**
- * Module package info
+ * @deprecated
*
- * @var PackageInfo
+ * @link setup/src/Magento/Setup/Test/Unit/Controller/ComponentGridTest.php
*/
- private $packageInfo;
-
- /**
- * Controller
- *
- * @var ComponentGrid
- */
- private $controller;
-
- /**
- * @var MarketplaceManager
- */
- private $marketplaceManagerMock;
-
- /**
- * @var array
- */
- private $componentData = [];
-
- /**
- * @var array
- */
- private $lastSyncData = [];
-
- /**
- * @var array
- */
- private $convertedLastSyncDate = [];
-
+class ComponentGridTest extends \PHPUnit_Framework_TestCase
+{
/**#@+
* Canned formatted date and time to return from mock
*/
@@ -91,179 +31,17 @@
public function setUp()
{
- $this->convertedLastSyncDate = [
- 'lastSyncDate' => [
- 'date' => self::FORMATTED_DATE,
- 'time' => self::FORMATTED_TIME,
- ],
- ];
-
- $this->lastSyncData = [
- "lastSyncDate" => "1447271496",
- "packages" => [
- 'magento/sample-module-one' => [
- 'name' => 'magento/sample-module-one',
- 'type' => 'magento2-module',
- 'version' => '1.0.0'
- ]
- ],
- 'countOfInstall' => 0,
- 'countOfUpdate' => 1
- ];
- $this->componentData = [
- 'magento/sample-module-one' => [
- 'name' => 'magento/sample-module-one',
- 'type' => 'magento2-module',
- 'version' => '1.0.0'
- ]
- ];
- $allComponentData = [
- 'magento/sample-module-two' => [
- 'name' => 'magento/sample-module-two',
- 'type' => 'magento2-module',
- 'version' => '1.0.0'
- ]
- ];
- $allComponentData = array_merge($allComponentData, $this->componentData);
- $this->composerInformationMock = $this->getMock(
- 'Magento\Framework\Composer\ComposerInformation',
- [],
- [],
- '',
- false
- );
- $objectManagerProvider = $this->getMock('Magento\Setup\Model\ObjectManagerProvider', [], [], '', false);
- $objectManager = $this->getMock('Magento\Framework\ObjectManagerInterface', [], [], '', false);
- $objectManagerProvider->expects($this->once())
- ->method('get')
- ->willReturn($objectManager);
- $this->packageInfoFactoryMock = $this
- ->getMock('Magento\Framework\Module\PackageInfoFactory', [], [], '', false);
- $this->enabledModuleListMock = $this->getMock('Magento\Framework\Module\ModuleList', [], [], '', false);
- $this->enabledModuleListMock->expects($this->any())->method('has')->willReturn(true);
- $this->fullModuleListMock = $this->getMock('Magento\Framework\Module\FullModuleList', [], [], '', false);
- $this->fullModuleListMock->expects($this->any())->method('getNames')->willReturn($allComponentData);
- $this->timezoneMock = $this->getMock('Magento\Framework\Stdlib\DateTime\TimezoneInterface', [], [], '', false);
- $objectManager->expects($this->exactly(4))
- ->method('get')
- ->willReturnMap([
- ['Magento\Framework\Module\PackageInfoFactory', $this->packageInfoFactoryMock],
- ['Magento\Framework\Module\FullModuleList', $this->fullModuleListMock],
- ['Magento\Framework\Module\ModuleList', $this->enabledModuleListMock],
- ['Magento\Framework\Stdlib\DateTime\TimezoneInterface', $this->timezoneMock]
- ]);
- $this->packageInfo = $this->getMock('Magento\Framework\Module\PackageInfo', [], [], '', false);
- $this->updatePackagesCacheMock = $this->getMock('Magento\Setup\Model\UpdatePackagesCache', [], [], '', false);
- $this->marketplaceManagerMock = $this->getMock('Magento\Setup\Model\MarketplaceManager', [], [], '', false);
- $this->packageInfoFactoryMock->expects($this->once())->method('create')->willReturn($this->packageInfo);
- $this->controller = new ComponentGrid(
- $this->composerInformationMock,
- $objectManagerProvider,
- $this->updatePackagesCacheMock,
- $this->marketplaceManagerMock
- );
}
public function testIndexAction()
{
- $viewModel = $this->controller->indexAction();
- $this->assertInstanceOf('Zend\View\Model\ViewModel', $viewModel);
- $this->assertTrue($viewModel->terminate());
}
public function testComponentsAction()
{
- $this->fullModuleListMock->expects($this->once())
- ->method('getNames')
- ->willReturn(['magento/sample-module1']);
- $this->packageInfo->expects($this->once())
- ->method('getModuleName')
- ->willReturn('Sample_Module');
- $this->packageInfo->expects($this->exactly(2))
- ->method('getPackageName')
- ->willReturn($this->componentData['magento/sample-module-one']['name']);
- $this->packageInfo->expects($this->exactly(2))
- ->method('getVersion')
- ->willReturn($this->componentData['magento/sample-module-one']['version']);
- $this->enabledModuleListMock->expects($this->once())
- ->method('has')
- ->willReturn(true);
- $this->composerInformationMock->expects($this->once())
- ->method('getInstalledMagentoPackages')
- ->willReturn($this->componentData);
- $this->composerInformationMock->expects($this->once())
- ->method('isPackageInComposerJson')
- ->willReturn(true);
- $this->updatePackagesCacheMock->expects($this->once())
- ->method('getPackagesForUpdate')
- ->willReturn($this->lastSyncData);
- $this->setupTimezoneMock();
- $jsonModel = $this->controller->componentsAction();
- $this->assertInstanceOf('Zend\View\Model\JsonModel', $jsonModel);
- $variables = $jsonModel->getVariables();
- $this->assertArrayHasKey('success', $variables);
- $this->assertTrue($variables['success']);
- $expected = [[
- 'name' => 'magento/sample-module-one',
- 'type' => 'magento2-module',
- 'version' => '1.0.0',
- 'update' => false,
- 'uninstall' => true,
- 'vendor' => 'magento',
- 'moduleName' => 'Sample_Module',
- 'enable' => true,
- 'disable' => false
- ]];
- $this->assertEquals($expected, $variables['components']);
- $this->assertArrayHasKey('total', $variables);
- $this->assertEquals(1, $variables['total']);
- $expectedLastSyncData = array_replace($this->lastSyncData, $this->convertedLastSyncDate);
- $this->assertEquals($expectedLastSyncData, $variables['lastSyncData']);
}
public function testSyncAction()
{
- $this->updatePackagesCacheMock->expects($this->once())
- ->method('syncPackagesForUpdate');
- $this->updatePackagesCacheMock->expects($this->once())
- ->method('getPackagesForUpdate')
- ->willReturn($this->lastSyncData);
- $this->setupTimezoneMock();
- $jsonModel = $this->controller->syncAction();
- $this->assertInstanceOf('Zend\View\Model\JsonModel', $jsonModel);
- $variables = $jsonModel->getVariables();
- $this->assertArrayHasKey('success', $variables);
- $this->assertTrue($variables['success']);
- $expectedLastSyncData = array_replace($this->lastSyncData, $this->convertedLastSyncDate);
- $this->assertEquals($expectedLastSyncData, $variables['lastSyncData']);
- }
-
- /**
- * Prepare the timezone mock to expect calls and return formatted date and time
- *
- * @return none
- */
- private function setupTimezoneMock()
- {
- $this->timezoneMock->expects($this->at(0))
- ->method('formatDateTime')
- ->with(
- $this->isInstanceOf('\DateTime'),
- \IntlDateFormatter::MEDIUM,
- \IntlDateFormatter::NONE,
- null,
- null,
- null
- )->willReturn(self::FORMATTED_DATE);
- $this->timezoneMock->expects($this->at(1))
- ->method('formatDateTime')
- ->with(
- $this->isInstanceOf('\DateTime'),
- \IntlDateFormatter::NONE,
- \IntlDateFormatter::MEDIUM,
- null,
- null,
- null
- )->willReturn(self::FORMATTED_TIME);
}
}
--- Magento-CE-2.0.5/dev/tests/integration/testsuite/Magento/Setup/Model/UpdatePackagesCacheTest.php 2016-04-27 23:23:12.000000000 -0300
+++ Magento-CE-2.0.6/dev/tests/integration/testsuite/Magento/Setup/Model/UpdatePackagesCacheTest.php 2016-05-16 13:49:30.000000000 -0300
@@ -9,7 +9,6 @@
use Magento\TestFramework\Helper\Bootstrap;
use Magento\Framework\Composer\ComposerJsonFinder;
use Magento\Framework\Composer\MagentoComposerApplicationFactory;
-use Magento\Setup\Model\UpdatePackagesCache;
/**
* Tests Magento\Framework\ComposerInformation
@@ -81,12 +80,6 @@
$this->setupDirectory('testSkeleton');
- $objectManagerProvider = $this->getMock('Magento\Setup\Model\ObjectManagerProvider', [], [], '', false);
- $objectManagerProvider
- ->expects($this->any())
- ->method('get')
- ->willReturn($this->objectManager);
-
/** @var UpdatePackagesCache $updatePackagesCache|\PHPUnit_Framework_MockObject_MockObject */
$updatePackagesCache = $this->getMock('Magento\Setup\Model\UpdatePackagesCache', [], [], '', false);
--- Magento-CE-2.0.5/dev/tests/static/testsuite/Magento/Test/Integrity/Di/CompilerTest.php 2016-04-27 23:23:14.000000000 -0300
+++ Magento-CE-2.0.6/dev/tests/static/testsuite/Magento/Test/Integrity/Di/CompilerTest.php 2016-05-16 13:49:31.000000000 -0300
@@ -69,15 +69,14 @@
$basePath = Files::init()->getPathToSource();
$basePath = str_replace('\\', '/', $basePath);
-
$this->_tmpDir = realpath(__DIR__) . '/tmp';
$this->_generationDir = $this->_tmpDir . '/generation';
if (!file_exists($this->_generationDir)) {
- mkdir($this->_generationDir, 0770, true);
+ mkdir($this->_generationDir, 0777, true);
}
$this->_compilationDir = $this->_tmpDir . '/di';
if (!file_exists($this->_compilationDir)) {
- mkdir($this->_compilationDir, 0770, true);
+ mkdir($this->_compilationDir, 0777, true);
}
$this->_command = 'php ' . $basePath . '/bin/magento setup:di:compile-multi-tenant --generation=%s --di=%s';
--- Magento-CE-2.0.5/dev/tests/static/testsuite/Magento/Test/Js/Exemplar/JsHintTest.php 2016-04-27 23:23:14.000000000 -0300
+++ Magento-CE-2.0.6/dev/tests/static/testsuite/Magento/Test/Js/Exemplar/JsHintTest.php 2016-05-16 13:49:31.000000000 -0300
@@ -29,7 +29,7 @@
{
$reportFile = self::$_cmd->getReportFile();
if (!is_dir(dirname($reportFile))) {
- mkdir(dirname($reportFile), 0770);
+ mkdir(dirname($reportFile));
}
}
--- Magento-CE-2.0.5/dev/tests/static/testsuite/Magento/Test/Js/LiveCodeTest.php 2016-04-27 23:23:14.000000000 -0300
+++ Magento-CE-2.0.6/dev/tests/static/testsuite/Magento/Test/Js/LiveCodeTest.php 2016-05-16 13:49:31.000000000 -0300
@@ -60,7 +60,7 @@
{
$reportDir = Files::init()->getPathToSource() . '/dev/tests/static/report';
if (!is_dir($reportDir)) {
- mkdir($reportDir, 0770);
+ mkdir($reportDir);
}
self::$_reportFile = $reportDir . '/js_report.txt';
@unlink(self::$_reportFile);
--- Magento-CE-2.0.5/dev/tests/static/testsuite/Magento/Test/Php/LiveCodeTest.php 2016-04-27 23:23:14.000000000 -0300
+++ Magento-CE-2.0.6/dev/tests/static/testsuite/Magento/Test/Php/LiveCodeTest.php 2016-05-16 13:49:31.000000000 -0300
@@ -42,7 +42,7 @@
self::$pathToSource = Utility\Files::init()->getPathToSource();
self::$reportDir = self::$pathToSource . '/dev/tests/static/report';
if (!is_dir(self::$reportDir)) {
- mkdir(self::$reportDir, 0770);
+ mkdir(self::$reportDir);
}
}
--- Magento-CE-2.0.5/.htaccess 2016-04-27 23:23:14.000000000 -0300
+++ Magento-CE-2.0.6/.htaccess 2016-05-16 13:49:31.000000000 -0300
@@ -279,6 +279,10 @@
order allow,deny
deny from all
</Files>
+ <Files magento_umask>
+ order allow,deny
+ deny from all
+ </Files>
################################
## If running in cluster environment, uncomment this
--- Magento-CE-2.0.5/.htaccess.sample 2016-04-27 23:23:12.000000000 -0300
+++ Magento-CE-2.0.6/.htaccess.sample 2016-05-16 13:49:30.000000000 -0300
@@ -245,6 +245,10 @@
order allow,deny
deny from all
</Files>
+ <Files magento_umask>
+ order allow,deny
+ deny from all
+ </Files>
################################
## If running in cluster environment, uncomment this
--- Magento-CE-2.0.5/lib/internal/Credis/Client.php 2016-04-27 23:23:12.000000000 -0300
+++ Magento-CE-2.0.6/lib/internal/Credis/Client.php 1969-12-31 21:00:00.000000000 -0300
@@ -1,1113 +0,0 @@
-<?php
-/**
- * Credis_Client (a fork of Redisent)
- *
- * Most commands are compatible with phpredis library:
- * - use "pipeline()" to start a pipeline of commands instead of multi(Redis::PIPELINE)
- * - any arrays passed as arguments will be flattened automatically
- * - setOption and getOption are not supported in standalone mode
- * - order of arguments follows redis-cli instead of phpredis where they differ (lrem)
- *
- * - Uses phpredis library if extension is installed for better performance.
- * - Establishes connection lazily.
- * - Supports tcp and unix sockets.
- * - Reconnects automatically unless a watch or transaction is in progress.
- * - Can set automatic retry connection attempts for iffy Redis connections.
- *
- * @author Colin Mollenhour <colin@mollenhour.com>
- * @copyright 2011 Colin Mollenhour <colin@mollenhour.com>
- * @license http://www.opensource.org/licenses/mit-license.php The MIT License
- * @package Credis_Client
- */
-
-if( ! defined('CRLF')) define('CRLF', sprintf('%s%s', chr(13), chr(10)));
-
-/**
- * Credis-specific errors, wraps native Redis errors
- */
-class CredisException extends Exception
-{
-
- const CODE_TIMED_OUT = 1;
- const CODE_DISCONNECTED = 2;
-
- public function __construct($message, $code = 0, $exception = NULL)
- {
- if ($exception && get_class($exception) == 'RedisException' && $message == 'read error on connection') {
- $code = CredisException::CODE_DISCONNECTED;
- }
- parent::__construct($message, $code, $exception);
- }
-
-}
-
-/**
- * Credis_Client, a lightweight Redis PHP standalone client and phpredis wrapper
- *
- * Server/Connection:
- * @method Credis_Client pipeline()
- * @method Credis_Client multi()
- * @method array exec()
- * @method string flushAll()
- * @method string flushDb()
- * @method array info()
- * @method bool|array config(string $setGet, string $key, string $value = null)
- *
- * Keys:
- * @method int del(string $key)
- * @method int exists(string $key)
- * @method int expire(string $key, int $seconds)
- * @method int expireAt(string $key, int $timestamp)
- * @method array keys(string $key)
- * @method int persist(string $key)
- * @method bool rename(string $key, string $newKey)
- * @method bool renameNx(string $key, string $newKey)
- * @method array sort(string $key, string $arg1, string $valueN = null)
- * @method int ttl(string $key)
- * @method string type(string $key)
- *
- * Scalars:
- * @method int append(string $key, string $value)
- * @method int decr(string $key)
- * @method int decrBy(string $key, int $decrement)
- * @method bool|string get(string $key)
- * @method int getBit(string $key, int $offset)
- * @method string getRange(string $key, int $start, int $end)
- * @method string getSet(string $key, string $value)
- * @method int incr(string $key)
- * @method int incrBy(string $key, int $decrement)
- * @method array mGet(array $keys)
- * @method bool mSet(array $keysValues)
- * @method int mSetNx(array $keysValues)
- * @method bool set(string $key, string $value)
- * @method int setBit(string $key, int $offset, int $value)
- * @method bool setEx(string $key, int $seconds, string $value)
- * @method int setNx(string $key, string $value)
- * @method int setRange(string $key, int $offset, int $value)
- * @method int strLen(string $key)
- *
- * Sets:
- * @method int sAdd(string $key, mixed $value, string $valueN = null)
- * @method int sRem(string $key, mixed $value, string $valueN = null)
- * @method array sMembers(string $key)
- * @method array sUnion(mixed $keyOrArray, string $valueN = null)
- * @method array sInter(mixed $keyOrArray, string $valueN = null)
- * @method array sDiff(mixed $keyOrArray, string $valueN = null)
- * @method string sPop(string $key)
- * @method int sCard(string $key)
- * @method int sIsMember(string $key, string $member)
- * @method int sMove(string $source, string $dest, string $member)
- * @method string|array sRandMember(string $key, int $count = null)
- * @method int sUnionStore(string $dest, string $key1, string $key2 = null)
- * @method int sInterStore(string $dest, string $key1, string $key2 = null)
- * @method int sDiffStore(string $dest, string $key1, string $key2 = null)
- *
- * Hashes:
- * @method bool|int hSet(string $key, string $field, string $value)
- * @method bool hSetNx(string $key, string $field, string $value)
- * @method bool|string hGet(string $key, string $field)
- * @method bool|int hLen(string $key)
- * @method bool hDel(string $key, string $field)
- * @method array hKeys(string $key, string $field)
- * @method array hVals(string $key, string $field)
- * @method array hGetAll(string $key)
- * @method bool hExists(string $key, string $field)
- * @method int hIncrBy(string $key, string $field, int $value)
- * @method bool hMSet(string $key, array $keysValues)
- * @method array hMGet(string $key, array $fields)
- *
- * Lists:
- * @method array|null blPop(string $keyN, int $timeout)
- * @method array|null brPop(string $keyN, int $timeout)
- * @method array|null brPoplPush(string $source, string $destination, int $timeout)
- * @method string|null lIndex(string $key, int $index)
- * @method int lInsert(string $key, string $beforeAfter, string $pivot, string $value)
- * @method int lLen(string $key)
- * @method string|null lPop(string $key)
- * @method int lPush(string $key, mixed $value, mixed $valueN = null)
- * @method int lPushX(string $key, mixed $value)
- * @method array lRange(string $key, int $start, int $stop)
- * @method int lRem(string $key, int $count, mixed $value)
- * @method bool lSet(string $key, int $index, mixed $value)
- * @method bool lTrim(string $key, int $start, int $stop)
- * @method string|null rPop(string $key)
- * @method string|null rPoplPush(string $source, string $destination)
- * @method int rPush(string $key, mixed $value, mixed $valueN = null)
- * @method int rPushX(string $key, mixed $value)
- *
- * Sorted Sets:
- * TODO
- *
- * Pub/Sub
- * @method array pUnsubscribe(mixed $pattern, string $patternN = NULL))
- * @method array unsubscribe(mixed $channel, string $channelN = NULL))
- * @method int publish(string $channel, string $message)
- * @method int|array pubsub(string $subCommand, $arg = NULL)
- *
- * Scripting:
- * @method string|int script(string $command, string $arg1 = null)
- * @method string|int|array|bool eval(string $script, array $keys = NULL, array $args = NULL)
- * @method string|int|array|bool evalSha(string $script, array $keys = NULL, array $args = NULL)
- */
-class Credis_Client {
-
- const TYPE_STRING = 'string';
- const TYPE_LIST = 'list';
- const TYPE_SET = 'set';
- const TYPE_ZSET = 'zset';
- const TYPE_HASH = 'hash';
- const TYPE_NONE = 'none';
- const FREAD_BLOCK_SIZE = 8192;
-
- /**
- * Socket connection to the Redis server or Redis library instance
- * @var resource|Redis
- */
- protected $redis;
- protected $redisMulti;
-
- /**
- * Host of the Redis server
- * @var string
- */
- protected $host;
-
- /**
- * Port on which the Redis server is running
- * @var integer
- */
- protected $port;
-
- /**
- * Timeout for connecting to Redis server
- * @var float
- */
- protected $timeout;
-
- /**
- * Timeout for reading response from Redis server
- * @var float
- */
- protected $readTimeout;
-
- /**
- * Unique identifier for persistent connections
- * @var string
- */
- protected $persistent;
-
- /**
- * @var bool
- */
- protected $closeOnDestruct = TRUE;
-
- /**
- * @var bool
- */
- protected $connected = FALSE;
-
- /**
- * @var bool
- */
- protected $standalone;
-
- /**
- * @var int
- */
- protected $maxConnectRetries = 0;
-
- /**
- * @var int
- */
- protected $connectFailures = 0;
-
- /**
- * @var bool
- */
- protected $usePipeline = FALSE;
-
- /**
- * @var array
- */
- protected $commandNames;
-
- /**
- * @var string
- */
- protected $commands;
-
- /**
- * @var bool
- */
- protected $isMulti = FALSE;
-
- /**
- * @var bool
- */
- protected $isWatching = FALSE;
-
- /**
- * @var string
- */
- protected $authPassword;
-
- /**
- * @var int
- */
- protected $selectedDb = 0;
-
- /**
- * Aliases for backwards compatibility with phpredis
- * @var array
- */
- protected $wrapperMethods = array('delete' => 'del', 'getkeys' => 'keys', 'sremove' => 'srem');
-
- /**
- * @var array
- */
- protected $renamedCommands;
-
- /**
- * @var int
- */
- protected $requests = 0;
-
- /**
- * Creates a Redisent connection to the Redis server on host {@link $host} and port {@link $port}.
- * $host may also be a path to a unix socket or a string in the form of tcp://[hostname]:[port] or unix://[path]
- *
- * @param string $host The hostname of the Redis server
- * @param integer $port The port number of the Redis server
- * @param float $timeout Timeout period in seconds
- * @param string $persistent Flag to establish persistent connection
- * @param int $db The selected datbase of the Redis server
- * @param string $password The authentication password of the Redis server
- */
- public function __construct($host = '127.0.0.1', $port = 6379, $timeout = null, $persistent = '', $db = 0, $password = null)
- {
- $this->host = (string) $host;
- $this->port = (int) $port;
- $this->timeout = $timeout;
- $this->persistent = (string) $persistent;
- $this->standalone = ! extension_loaded('redis');
- $this->authPassword = $password;
- $this->selectedDb = (int)$db;
- $this->convertHost();
- }
-
- public function __destruct()
- {
- if ($this->closeOnDestruct) {
- $this->close();
- }
- }
- /**
- * Return the host of the Redis instance
- * @return string
- */
- public function getHost()
- {
- return $this->host;
- }
- /**
- * Return the port of the Redis instance
- * @return int
- */
- public function getPort()
- {
- return $this->port;
- }
-
- /**
- * Return the selected database
- * @return int
- */
- public function getSelectedDb()
- {
- return $this->selectedDb;
- }
- /**
- * @return string
- */
- public function getPersistence()
- {
- return $this->persistent;
- }
- /**
- * @throws CredisException
- * @return Credis_Client
- */
- public function forceStandalone()
- {
- if($this->connected) {
- throw new CredisException('Cannot force Credis_Client to use standalone PHP driver after a connection has already been established.');
- }
- $this->standalone = TRUE;
- return $this;
- }
-
- /**
- * @param int $retries
- * @return Credis_Client
- */
- public function setMaxConnectRetries($retries)
- {
- $this->maxConnectRetries = $retries;
- return $this;
- }
-
- /**
- * @param bool $flag
- * @return Credis_Client
- */
- public function setCloseOnDestruct($flag)
- {
- $this->closeOnDestruct = $flag;
- return $this;
- }
- protected function convertHost()
- {
- if (preg_match('#^(tcp|unix)://(.*)$#', $this->host, $matches)) {
- if($matches[1] == 'tcp') {
- if ( ! preg_match('#^([^:]+)(:([0-9]+))?(/(.+))?$#', $matches[2], $matches)) {
- throw new CredisException('Invalid host format; expected tcp://host[:port][/persistence_identifier]');
- }
- $this->host = $matches[1];
- $this->port = (int) (isset($matches[3]) ? $matches[3] : 6379);
- $this->persistent = isset($matches[5]) ? $matches[5] : '';
- } else {
- $this->host = $matches[2];
- $this->port = NULL;
- if (substr($this->host,0,1) != '/') {
- throw new CredisException('Invalid unix socket format; expected unix:///path/to/redis.sock');
- }
- }
- }
- if ($this->port !== NULL && substr($this->host,0,1) == '/') {
- $this->port = NULL;
- }
- }
- /**
- * @throws CredisException
- * @return Credis_Client
- */
- public function connect()
- {
- if ($this->connected) {
- return $this;
- }
- if ($this->standalone) {
- $flags = STREAM_CLIENT_CONNECT;
- $remote_socket = $this->port === NULL
- ? 'unix://'.$this->host
- : 'tcp://'.$this->host.':'.$this->port;
- if ($this->persistent) {
- if ($this->port === NULL) { // Unix socket
- throw new CredisException('Persistent connections to UNIX sockets are not supported in standalone mode.');
- }
- $remote_socket .= '/'.$this->persistent;
- $flags = $flags | STREAM_CLIENT_PERSISTENT;
- }
- $result = $this->redis = @stream_socket_client($remote_socket, $errno, $errstr, $this->timeout !== null ? $this->timeout : 2.5, $flags);
- }
- else {
- if ( ! $this->redis) {
- $this->redis = new Redis;
- }
- $result = $this->persistent
- ? $this->redis->pconnect($this->host, $this->port, $this->timeout, $this->persistent)
- : $this->redis->connect($this->host, $this->port, $this->timeout);
- }
-
- // Use recursion for connection retries
- if ( ! $result) {
- $this->connectFailures++;
- if ($this->connectFailures <= $this->maxConnectRetries) {
- return $this->connect();
- }
- $failures = $this->connectFailures;
- $this->connectFailures = 0;
- throw new CredisException("Connection to Redis failed after $failures failures." . (isset($errno) && isset($errstr) ? "Last Error : ({$errno}) {$errstr}" : ""));
- }
-
- $this->connectFailures = 0;
- $this->connected = TRUE;
-
- // Set read timeout
- if ($this->readTimeout) {
- $this->setReadTimeout($this->readTimeout);
- }
-
- if($this->authPassword !== null) {
- $this->auth($this->authPassword);
- }
- if($this->selectedDb !== 0) {
- $this->select($this->selectedDb);
- }
- return $this;
- }
- /**
- * @return bool
- */
- public function isConnected()
- {
- return $this->connected;
- }
- /**
- * Set the read timeout for the connection. Use 0 to disable timeouts entirely (or use a very long timeout
- * if not supported).
- *
- * @param int $timeout 0 (or -1) for no timeout, otherwise number of seconds
- * @throws CredisException
- * @return Credis_Client
- */
- public function setReadTimeout($timeout)
- {
- if ($timeout < -1) {
- throw new CredisException('Timeout values less than -1 are not accepted.');
- }
- $this->readTimeout = $timeout;
- if ($this->connected) {
- if ($this->standalone) {
- $timeout = $timeout <= 0 ? 315360000 : $timeout; // Ten-year timeout
- stream_set_blocking($this->redis, TRUE);
- stream_set_timeout($this->redis, (int) floor($timeout), ($timeout - floor($timeout)) * 1000000);
- } else if (defined('Redis::OPT_READ_TIMEOUT')) {
- // supported in phpredis 2.2.3
- // a timeout value of -1 means reads will not timeout
- $timeout = $timeout == 0 ? -1 : $timeout;
- $this->redis->setOption(Redis::OPT_READ_TIMEOUT, $timeout);
- }
- }
- return $this;
- }
-
- /**
- * @return bool
- */
- public function close()
- {
- $result = TRUE;
- if ($this->connected && ! $this->persistent) {
- try {
- $result = $this->standalone ? fclose($this->redis) : $this->redis->close();
- $this->connected = FALSE;
- } catch (Exception $e) {
- ; // Ignore exceptions on close
- }
- }
- return $result;
- }
-
- /**
- * Enabled command renaming and provide mapping method. Supported methods are:
- *
- * 1. renameCommand('foo') // Salted md5 hash for all commands -> md5('foo'.$command)
- * 2. renameCommand(function($command){ return 'my'.$command; }); // Callable
- * 3. renameCommand('get', 'foo') // Single command -> alias
- * 4. renameCommand(['get' => 'foo', 'set' => 'bar']) // Full map of [command -> alias]
- *
- * @param string|callable|array $command
- * @param string|null $alias
- * @return $this
- */
- public function renameCommand($command, $alias = NULL)
- {
- if ( ! $this->standalone) {
- $this->forceStandalone();
- }
- if ($alias === NULL) {
- $this->renamedCommands = $command;
- } else {
- if ( ! $this->renamedCommands) {
- $this->renamedCommands = array();
- }
- $this->renamedCommands[$command] = $alias;
- }
- return $this;
- }
-
- /**
- * @param $command
- */
- public function getRenamedCommand($command)
- {
- static $map;
-
- // Command renaming not enabled
- if ($this->renamedCommands === NULL) {
- return $command;
- }
-
- // Initialize command map
- if ($map === NULL) {
- if (is_array($this->renamedCommands)) {
- $map = $this->renamedCommands;
- } else {
- $map = array();
- }
- }
-
- // Generate and return cached result
- if ( ! isset($map[$command])) {
- // String means all commands are hashed with salted md5
- if (is_string($this->renamedCommands)) {
- $map[$command] = md5($this->renamedCommands.$command);
- }
- // Would already be set in $map if it was intended to be renamed
- else if (is_array($this->renamedCommands)) {
- return $command;
- }
- // User-supplied function
- else if (is_callable($this->renamedCommands)) {
- $map[$command] = call_user_func($this->renamedCommands, $command);
- }
- }
- return $map[$command];
- }
-
- /**
- * @param string $password
- * @return bool
- */
- public function auth($password)
- {
- $response = $this->__call('auth', array($password));
- $this->authPassword = $password;
- return $response;
- }
-
- /**
- * @param int $index
- * @return bool
- */
- public function select($index)
- {
- $response = $this->__call('select', array($index));
- $this->selectedDb = (int) $index;
- return $response;
- }
-
- /**
- * @param string|array $patterns
- * @param $callback
- * @return $this|array|bool|Credis_Client|mixed|null|string
- * @throws CredisException
- */
- public function pSubscribe($patterns, $callback)
- {
- if ( ! $this->standalone) {
- return $this->__call('pSubscribe', array((array)$patterns, $callback));
- }
-
- // Standalone mode: use infinite loop to subscribe until timeout
- $patternCount = is_array($patterns) ? count($patterns) : 1;
- while ($patternCount--) {
- if (isset($status)) {
- list($command, $pattern, $status) = $this->read_reply();
- } else {
- list($command, $pattern, $status) = $this->__call('psubscribe', array($patterns));
- }
- if ( ! $status) {
- throw new CredisException('Invalid pSubscribe response.');
- }
- }
- try {
- while (1) {
- list($type, $pattern, $channel, $message) = $this->read_reply();
- if ($type != 'pmessage') {
- throw new CredisException('Received non-pmessage reply.');
- }
- $callback($this, $pattern, $channel, $message);
- }
- } catch (CredisException $e) {
- if ($e->getCode() == CredisException::CODE_TIMED_OUT) {
- try {
- list($command, $pattern, $status) = $this->pUnsubscribe($patterns);
- while ($status !== 0) {
- list($command, $pattern, $status) = $this->read_reply();
- }
- } catch (CredisException $e2) {
- throw $e2;
- }
- }
- throw $e;
- }
- }
-
- /**
- * @param string|array $channels
- * @param $callback
- * @throws CredisException
- * @return $this|array|bool|Credis_Client|mixed|null|string
- */
- public function subscribe($channels, $callback)
- {
- if ( ! $this->standalone) {
- return $this->__call('subscribe', array((array)$channels, $callback));
- }
-
- // Standalone mode: use infinite loop to subscribe until timeout
- $channelCount = is_array($channels) ? count($channels) : 1;
- while ($channelCount--) {
- if (isset($status)) {
- list($command, $channel, $status) = $this->read_reply();
- } else {
- list($command, $channel, $status) = $this->__call('subscribe', array($channels));
- }
- if ( ! $status) {
- throw new CredisException('Invalid subscribe response.');
- }
- }
- try {
- while (1) {
- list($type, $channel, $message) = $this->read_reply();
- if ($type != 'message') {
- throw new CredisException('Received non-message reply.');
- }
- $callback($this, $channel, $message);
- }
- } catch (CredisException $e) {
- if ($e->getCode() == CredisException::CODE_TIMED_OUT) {
- try {
- list($command, $channel, $status) = $this->unsubscribe($channels);
- while ($status !== 0) {
- list($command, $channel, $status) = $this->read_reply();
- }
- } catch (CredisException $e2) {
- throw $e2;
- }
- }
- throw $e;
- }
- }
-
- public function __call($name, $args)
- {
- // Lazy connection
- $this->connect();
-
- $name = strtolower($name);
-
- // Send request via native PHP
- if($this->standalone)
- {
- switch ($name) {
- case 'eval':
- case 'evalsha':
- $script = array_shift($args);
- $keys = (array) array_shift($args);
- $eArgs = (array) array_shift($args);
- $args = array($script, count($keys), $keys, $eArgs);
- break;
- }
- // Flatten arguments
- $argsFlat = NULL;
- foreach($args as $index => $arg) {
- if(is_array($arg)) {
- if($argsFlat === NULL) {
- $argsFlat = array_slice($args, 0, $index);
- }
- if($name == 'mset' || $name == 'msetnx' || $name == 'hmset') {
- foreach($arg as $key => $value) {
- $argsFlat[] = $key;
- $argsFlat[] = $value;
- }
- } else {
- $argsFlat = array_merge($argsFlat, $arg);
- }
- } else if($argsFlat !== NULL) {
- $argsFlat[] = $arg;
- }
- }
- if($argsFlat !== NULL) {
- $args = $argsFlat;
- $argsFlat = NULL;
- }
-
- // In pipeline mode
- if($this->usePipeline)
- {
- if($name == 'pipeline') {
- throw new CredisException('A pipeline is already in use and only one pipeline is supported.');
- }
- else if($name == 'exec') {
- if($this->isMulti) {
- $this->commandNames[] = $name;
- $this->commands .= self::_prepare_command(array($this->getRenamedCommand($name)));
- }
-
- // Write request
- if($this->commands) {
- $this->write_command($this->commands);
- }
- $this->commands = NULL;
-
- // Read response
- $response = array();
- foreach($this->commandNames as $command) {
- $response[] = $this->read_reply($command);
- }
- $this->commandNames = NULL;
-
- if($this->isMulti) {
- $response = array_pop($response);
- }
- $this->usePipeline = $this->isMulti = FALSE;
- return $response;
- }
- else {
- if($name == 'multi') {
- $this->isMulti = TRUE;
- }
- array_unshift($args, $this->getRenamedCommand($name));
- $this->commandNames[] = $name;
- $this->commands .= self::_prepare_command($args);
- return $this;
- }
- }
-
- // Start pipeline mode
- if($name == 'pipeline')
- {
- $this->usePipeline = TRUE;
- $this->commandNames = array();
- $this->commands = '';
- return $this;
- }
-
- // If unwatching, allow reconnect with no error thrown
- if($name == 'unwatch') {
- $this->isWatching = FALSE;
- }
-
- // Non-pipeline mode
- array_unshift($args, $this->getRenamedCommand($name));
- $command = self::_prepare_command($args);
- $this->write_command($command);
- $response = $this->read_reply($name);
-
- // Watch mode disables reconnect so error is thrown
- if($name == 'watch') {
- $this->isWatching = TRUE;
- }
- // Transaction mode
- else if($this->isMulti && ($name == 'exec' || $name == 'discard')) {
- $this->isMulti = FALSE;
- }
- // Started transaction
- else if($this->isMulti || $name == 'multi') {
- $this->isMulti = TRUE;
- $response = $this;
- }
- }
-
- // Send request via phpredis client
- else
- {
- // Tweak arguments
- switch($name) {
- case 'get': // optimize common cases
- case 'set':
- case 'hget':
- case 'hset':
- case 'setex':
- case 'mset':
- case 'msetnx':
- case 'hmset':
- case 'hmget':
- case 'del':
- break;
- case 'mget':
- if(isset($args[0]) && ! is_array($args[0])) {
- $args = array($args);
- }
- break;
- case 'lrem':
- $args = array($args[0], $args[2], $args[1]);
- break;
- case 'eval':
- case 'evalsha':
- if (isset($args[1]) && is_array($args[1])) {
- $cKeys = $args[1];
- } elseif (isset($args[1]) && is_string($args[1])) {
- $cKeys = array($args[1]);
- } else {
- $cKeys = array();
- }
- if (isset($args[2]) && is_array($args[2])) {
- $cArgs = $args[2];
- } elseif (isset($args[2]) && is_string($args[2])) {
- $cArgs = array($args[2]);
- } else {
- $cArgs = array();
- }
- $args = array($args[0], array_merge($cKeys, $cArgs), count($cKeys));
- break;
- case 'subscribe':
- case 'psubscribe':
- break;
- default:
- // Flatten arguments
- $argsFlat = NULL;
- foreach($args as $index => $arg) {
- if(is_array($arg)) {
- if($argsFlat === NULL) {
- $argsFlat = array_slice($args, 0, $index);
- }
- $argsFlat = array_merge($argsFlat, $arg);
- } else if($argsFlat !== NULL) {
- $argsFlat[] = $arg;
- }
- }
- if($argsFlat !== NULL) {
- $args = $argsFlat;
- $argsFlat = NULL;
- }
- }
-
- try {
- // Proxy pipeline mode to the phpredis library
- if($name == 'pipeline' || $name == 'multi') {
- if($this->isMulti) {
- return $this;
- } else {
- $this->isMulti = TRUE;
- $this->redisMulti = call_user_func_array(array($this->redis, $name), $args);
- }
- }
- else if($name == 'exec' || $name == 'discard') {
- $this->isMulti = FALSE;
- $response = $this->redisMulti->$name();
- $this->redisMulti = NULL;
- #echo "> $name : ".substr(print_r($response, TRUE),0,100)."\n";
- return $response;
- }
-
- // Use aliases to be compatible with phpredis wrapper
- if(isset($this->wrapperMethods[$name])) {
- $name = $this->wrapperMethods[$name];
- }
-
- // Multi and pipeline return self for chaining
- if($this->isMulti) {
- call_user_func_array(array($this->redisMulti, $name), $args);
- return $this;
- }
-
- // Send request, retry one time when using persistent connections on the first request only
- $this->requests++;
- try {
- $response = call_user_func_array(array($this->redis, $name), $args);
- } catch (RedisException $e) {
- if ($this->persistent && $this->requests == 1 && $e->getMessage() == 'read error on connection') {
- $this->connected = FALSE;
- $this->connect();
- $response = call_user_func_array(array($this->redis, $name), $args);
- } else {
- throw $e;
- }
- }
- }
- // Wrap exceptions
- catch(RedisException $e) {
- $code = 0;
- if ( ! ($result = $this->redis->IsConnected())) {
- $this->connected = FALSE;
- $code = CredisException::CODE_DISCONNECTED;
- }
- throw new CredisException($e->getMessage(), $code, $e);
- }
-
- #echo "> $name : ".substr(print_r($response, TRUE),0,100)."\n";
-
- // change return values where it is too difficult to minim in standalone mode
- switch($name)
- {
- case 'hmget':
- $response = array_values($response);
- break;
-
- case 'type':
- $typeMap = array(
- self::TYPE_NONE,
- self::TYPE_STRING,
- self::TYPE_SET,
- self::TYPE_LIST,
- self::TYPE_ZSET,
- self::TYPE_HASH,
- );
- $response = $typeMap[$response];
- break;
-
- // Handle scripting errors
- case 'eval':
- case 'evalsha':
- case 'script':
- $error = $this->redis->getLastError();
- $this->redis->clearLastError();
- if ($error && substr($error,0,8) == 'NOSCRIPT') {
- $response = NULL;
- } else if ($error) {
- throw new CredisException($error);
- }
- break;
- default:
- $error = $this->redis->getLastError();
- $this->redis->clearLastError();
- if ($error) {
- throw new CredisException($error);
- }
- break;
- }
- }
-
- return $response;
- }
-
- protected function write_command($command)
- {
- // Reconnect on lost connection (Redis server "timeout" exceeded since last command)
- if(feof($this->redis)) {
- $this->close();
- // If a watch or transaction was in progress and connection was lost, throw error rather than reconnect
- // since transaction/watch state will be lost.
- if(($this->isMulti && ! $this->usePipeline) || $this->isWatching) {
- $this->isMulti = $this->isWatching = FALSE;
- throw new CredisException('Lost connection to Redis server during watch or transaction.');
- }
- $this->connected = FALSE;
- $this->connect();
- if($this->authPassword) {
- $this->auth($this->authPassword);
- }
- if($this->selectedDb != 0) {
- $this->select($this->selectedDb);
- }
- }
-
- $commandLen = strlen($command);
- for ($written = 0; $written < $commandLen; $written += $fwrite) {
- $fwrite = fwrite($this->redis, substr($command, $written));
- if ($fwrite === FALSE || $fwrite == 0 ) {
- $this->connected = FALSE;
- throw new CredisException('Failed to write entire command to stream');
- }
- }
- }
-
- protected function read_reply($name = '')
- {
- $reply = fgets($this->redis);
- if($reply === FALSE) {
- $info = stream_get_meta_data($this->redis);
- if ($info['timed_out']) {
- throw new CredisException('Read operation timed out.', CredisException::CODE_TIMED_OUT);
- } else {
- $this->connected = FALSE;
- throw new CredisException('Lost connection to Redis server.', CredisException::CODE_DISCONNECTED);
- }
- }
- $reply = rtrim($reply, CRLF);
- #echo "> $name: $reply\n";
- $replyType = substr($reply, 0, 1);
- switch ($replyType) {
- /* Error reply */
- case '-':
- if($this->isMulti || $this->usePipeline) {
- $response = FALSE;
- } else if ($name == 'evalsha' && substr($reply,0,9) == '-NOSCRIPT') {
- $response = NULL;
- } else {
- throw new CredisException(substr($reply,0,4) == '-ERR' ? substr($reply, 5) : substr($reply,1));
- }
- break;
- /* Inline reply */
- case '+':
- $response = substr($reply, 1);
- if($response == 'OK' || $response == 'QUEUED') {
- return TRUE;
- }
- break;
- /* Bulk reply */
- case '$':
- if ($reply == '$-1') return FALSE;
- $size = (int) substr($reply, 1);
- $response = stream_get_contents($this->redis, $size + 2);
- if( ! $response) {
- $this->connected = FALSE;
- throw new CredisException('Error reading reply.');
- }
- $response = substr($response, 0, $size);
- break;
- /* Multi-bulk reply */
- case '*':
- $count = substr($reply, 1);
- if ($count == '-1') return FALSE;
-
- $response = array();
- for ($i = 0; $i < $count; $i++) {
- $response[] = $this->read_reply();
- }
- break;
- /* Integer reply */
- case ':':
- $response = intval(substr($reply, 1));
- break;
- default:
- throw new CredisException('Invalid response: '.print_r($reply, TRUE));
- break;
- }
-
- // Smooth over differences between phpredis and standalone response
- switch($name)
- {
- case '': // Minor optimization for multi-bulk replies
- break;
- case 'config':
- case 'hgetall':
- $keys = $values = array();
- while($response) {
- $keys[] = array_shift($response);
- $values[] = array_shift($response);
- }
- $response = count($keys) ? array_combine($keys, $values) : array();
- break;
- case 'info':
- $lines = explode(CRLF, trim($response,CRLF));
- $response = array();
- foreach($lines as $line) {
- if ( ! $line || substr($line, 0, 1) == '#') {
- continue;
- }
- list($key, $value) = explode(':', $line, 2);
- $response[$key] = $value;
- }
- break;
- case 'ttl':
- if($response === -1) {
- $response = FALSE;
- }
- break;
- }
-
- return $response;
- }
-
- /**
- * Build the Redis unified protocol command
- *
- * @param array $args
- * @return string
- */
- private static function _prepare_command($args)
- {
- return sprintf('*%d%s%s%s', count($args), CRLF, implode(array_map(array('self', '_map'), $args), CRLF), CRLF);
- }
-
- private static function _map($arg)
- {
- return sprintf('$%d%s%s', strlen($arg), CRLF, $arg);
- }
-
-}
--- Magento-CE-2.0.5/pub/errors/processor.php 2016-04-27 23:23:12.000000000 -0300
+++ Magento-CE-2.0.6/pub/errors/processor.php 2016-05-16 13:49:30.000000000 -0300
@@ -454,11 +454,10 @@
$this->_setReportData($reportData);
if (!file_exists($this->_reportDir)) {
- @mkdir($this->_reportDir, DriverInterface::WRITEABLE_DIRECTORY_MODE, true);
+ @mkdir($this->_reportDir, 0777, true);
}
@file_put_contents($this->_reportFile, serialize($reportData));
- @chmod($this->_reportFile, DriverInterface::WRITEABLE_FILE_MODE);
if (isset($reportData['skin']) && self::DEFAULT_SKIN != $reportData['skin']) {
$this->_setSkin($reportData['skin']);
--- Magento-CE-2.0.5/setup/src/Magento/Setup/Console/Command/AbstractModuleCommand.php 2016-04-27 23:23:14.000000000 -0300
+++ Magento-CE-2.0.6/setup/src/Magento/Setup/Console/Command/AbstractModuleCommand.php 2016-05-16 13:49:31.000000000 -0300
@@ -84,14 +84,18 @@
/** @var \Magento\Framework\App\State\CleanupFiles $cleanupFiles */
$cleanupFiles = $this->objectManager->get('Magento\Framework\App\State\CleanupFiles');
$cleanupFiles->clearCodeGeneratedClasses();
- $output->writeln('<info>Generated classes cleared successfully. Please re-run Magento compile command</info>');
+ $output->writeln(
+ "<info>Generated classes cleared successfully. Please run the 'setup:di:compile' command to "
+ . 'generate classes.</info>'
+ );
if ($input->getOption(self::INPUT_KEY_CLEAR_STATIC_CONTENT)) {
$cleanupFiles->clearMaterializedViewFiles();
$output->writeln('<info>Generated static view files cleared successfully.</info>');
} else {
$output->writeln(
- '<info>Info: Some modules might require static view files to be cleared. Use the optional --' .
- self::INPUT_KEY_CLEAR_STATIC_CONTENT . ' option to clear them.</info>'
+ "<info>Info: Some modules might require static view files to be cleared. To do this, run '"
+ . $this->getName() . "' with the --" . self::INPUT_KEY_CLEAR_STATIC_CONTENT
+ . ' option to clear them.</info>'
);
}
}
--- Magento-CE-2.0.5/setup/src/Magento/Setup/Console/Command/AbstractModuleManageCommand.php 2016-04-27 23:23:14.000000000 -0300
+++ Magento-CE-2.0.6/setup/src/Magento/Setup/Console/Command/AbstractModuleManageCommand.php 2016-05-16 13:49:31.000000000 -0300
@@ -6,8 +6,10 @@
namespace Magento\Setup\Console\Command;
use Symfony\Component\Console\Input\InputInterface;
-use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
+use Symfony\Component\Console\Input\InputOption;
+use Magento\Framework\App\DeploymentConfig;
+use Magento\Framework\Module\Status;
abstract class AbstractModuleManageCommand extends AbstractModuleCommand
{
@@ -18,6 +20,11 @@
const INPUT_KEY_FORCE = 'force';
/**
+ * @var DeploymentConfig
+ */
+ protected $deploymentConfig;
+
+ /**
* {@inheritdoc}
*/
protected function configure()
@@ -64,12 +71,8 @@
$output->writeln(implode(PHP_EOL, $messages));
return;
}
- /**
- * @var \Magento\Framework\Module\Status $status
- */
- $status = $this->objectManager->get('Magento\Framework\Module\Status');
try {
- $modulesToChange = $status->getModulesToChange($isEnable, $modules);
+ $modulesToChange = $this->getStatus()->getModulesToChange($isEnable, $modules);
} catch (\LogicException $e) {
$output->writeln('<error>' . $e->getMessage() . '</error>');
return;
@@ -77,7 +80,7 @@
if (!empty($modulesToChange)) {
$force = $input->getOption(self::INPUT_KEY_FORCE);
if (!$force) {
- $constraints = $status->checkConstraints($isEnable, $modulesToChange);
+ $constraints = $this->getStatus()->checkConstraints($isEnable, $modulesToChange);
if ($constraints) {
$output->writeln(
"<error>Unable to change status of modules because of the following constraints:</error>"
@@ -86,30 +89,55 @@
return;
}
}
- $status->setIsEnabled($isEnable, $modulesToChange);
+ $this->setIsEnabled($isEnable, $modulesToChange, $output);
+ $this->cleanup($input, $output);
+ if ($force) {
+ $output->writeln(
+ '<error>Alert: You used the --force option.'
+ . ' As a result, modules might not function properly.</error>'
+ );
+ }
+ } else {
+ $output->writeln('<info>No modules were changed.</info>');
+ }
+ }
+
+ /**
+ * Enable/disable modules
+ *
+ * @param bool $isEnable
+ * @param string[] $modulesToChange
+ * @param OutputInterface $output
+ * @return void
+ */
+ private function setIsEnabled($isEnable, $modulesToChange, $output)
+ {
+ $this->getStatus()->setIsEnabled($isEnable, $modulesToChange);
if ($isEnable) {
$output->writeln('<info>The following modules have been enabled:</info>');
$output->writeln('<info>- ' . implode("\n- ", $modulesToChange) . '</info>');
$output->writeln('');
+ if ($this->getDeploymentConfig()->isAvailable()) {
$output->writeln(
'<info>To make sure that the enabled modules are properly registered,'
. " run 'setup:upgrade'.</info>"
);
+ }
} else {
$output->writeln('<info>The following modules have been disabled:</info>');
$output->writeln('<info>- ' . implode("\n- ", $modulesToChange) . '</info>');
$output->writeln('');
}
- $this->cleanup($input, $output);
- if ($force) {
- $output->writeln(
- '<error>Alert: You used the --force option.'
- . ' As a result, modules might not function properly.</error>'
- );
- }
- } else {
- $output->writeln('<info>No modules were changed.</info>');
}
+
+ /**
+ * Get module status
+ *
+ * @return Status
+ */
+ private function getStatus()
+ {
+ return $this->objectManager->get(Status::class);
}
/**
@@ -134,4 +162,18 @@
* @return bool
*/
abstract protected function isEnable();
+
+ /**
+ * Get deployment config
+ *
+ * @return DeploymentConfig
+ * @deprecated
+ */
+ private function getDeploymentConfig()
+ {
+ if (!($this->deploymentConfig instanceof DeploymentConfig)) {
+ return $this->objectManager->get(DeploymentConfig::class);
+ }
+ return $this->deploymentConfig;
+ }
}
--- Magento-CE-2.0.5/setup/src/Magento/Setup/Console/Command/DiCompileCommand.php 2016-04-27 23:23:14.000000000 -0300
+++ Magento-CE-2.0.6/setup/src/Magento/Setup/Console/Command/DiCompileCommand.php 2016-05-16 13:49:31.000000000 -0300
@@ -3,15 +3,17 @@
* Copyright © 2016 Magento. All rights reserved.
* See COPYING.txt for license details.
*/
-
namespace Magento\Setup\Console\Command;
+use Magento\Framework\ObjectManagerInterface;
+use Magento\Framework\Filesystem\DriverInterface;
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Output\OutputInterface;
use Magento\Framework\Filesystem;
use Magento\Framework\App\Filesystem\DirectoryList;
-use Magento\Framework\Filesystem\DriverInterface;
-use Magento\Framework\ObjectManagerInterface;
use Magento\Framework\App\DeploymentConfig;
use Magento\Framework\Component\ComponentRegistrar;
+use Magento\Framework\Config\ConfigOptionsListConstants;
use Magento\Setup\Model\ObjectManagerProvider;
use Magento\Setup\Module\Di\App\Task\Manager;
use Magento\Setup\Module\Di\App\Task\OperationFactory;
@@ -19,8 +21,6 @@
use Magento\Setup\Module\Di\App\Task\OperationInterface;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Helper\ProgressBar;
-use Symfony\Component\Console\Input\InputInterface;
-use Symfony\Component\Console\Output\OutputInterface;
/**
* Command to run compile in single-tenant mode
@@ -107,8 +107,10 @@
private function checkEnvironment()
{
$messages = [];
- if (!$this->deploymentConfig->isAvailable()) {
- $messages[] = 'You cannot run this command because the Magento application is not installed.';
+ $config = $this->deploymentConfig->get(ConfigOptionsListConstants::KEY_MODULES);
+ if (!$config) {
+ $messages[] = 'You cannot run this command because modules are not enabled. You can enable modules by'
+ . ' running the \'module:enable --all\' command.';
}
/**
--- Magento-CE-2.0.5/setup/src/Magento/Setup/Console/Command/DiCompileMultiTenantCommand.php 2016-04-27 23:23:14.000000000 -0300
+++ Magento-CE-2.0.6/setup/src/Magento/Setup/Console/Command/DiCompileMultiTenantCommand.php 2016-05-16 13:49:31.000000000 -0300
@@ -407,7 +407,7 @@
// 2.2 Compression
$relationsFileDir = dirname($relationsFile);
if (!file_exists($relationsFileDir)) {
- mkdir($relationsFileDir, DriverInterface::WRITEABLE_DIRECTORY_MODE, true);
+ mkdir($relationsFileDir, 0777, true);
}
$relations = array_filter($relations);
file_put_contents($relationsFile, $serializer->serialize($relations));
@@ -425,7 +425,7 @@
$outputContent = $serializer->serialize($pluginDefinitions);
$pluginDefFileDir = dirname($pluginDefFile);
if (!file_exists($pluginDefFileDir)) {
- mkdir($pluginDefFileDir, DriverInterface::WRITEABLE_DIRECTORY_MODE, true);
+ mkdir($pluginDefFileDir, 0777, true);
}
file_put_contents($pluginDefFile, $outputContent);
}
--- Magento-CE-2.0.5/setup/src/Magento/Setup/Controller/ComponentGrid.php 2016-04-27 23:23:14.000000000 -0300
+++ Magento-CE-2.0.6/setup/src/Magento/Setup/Controller/ComponentGrid.php 2016-05-16 13:49:31.000000000 -0300
@@ -6,6 +6,8 @@
namespace Magento\Setup\Controller;
+use Magento\Setup\Model\DateTime\TimezoneProvider;
+
/**
* Controller for component grid tasks
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
@@ -52,10 +54,15 @@
private $timezone;
/**
+ * @var \Magento\Framework\ObjectManagerInterface
+ */
+ private $objectManager;
+
+ /**
* @param \Magento\Framework\Composer\ComposerInformation $composerInformation
* @param \Magento\Setup\Model\ObjectManagerProvider $objectManagerProvider
- * @param \Magento\Setup\Model\MarketplaceManager $marketplaceManager
* @param \Magento\Setup\Model\UpdatePackagesCache $updatePackagesCache
+ * @param \Magento\Setup\Model\MarketplaceManager $marketplaceManager
*/
public function __construct(
\Magento\Framework\Composer\ComposerInformation $composerInformation,
@@ -64,13 +71,40 @@
\Magento\Setup\Model\MarketplaceManager $marketplaceManager
) {
$this->composerInformation = $composerInformation;
- $objectManager = $objectManagerProvider->get();
- $this->enabledModuleList = $objectManager->get('Magento\Framework\Module\ModuleList');
- $this->fullModuleList = $objectManager->get('Magento\Framework\Module\FullModuleList');
- $this->packageInfo = $objectManager->get('Magento\Framework\Module\PackageInfoFactory')->create();
+ $this->objectManager = $objectManagerProvider->get();
+ $this->enabledModuleList = $this->objectManager->get('Magento\Framework\Module\ModuleList');
+ $this->fullModuleList = $this->objectManager->get('Magento\Framework\Module\FullModuleList');
+ $this->packageInfo = $this->objectManager->get('Magento\Framework\Module\PackageInfoFactory')->create();
$this->marketplaceManager = $marketplaceManager;
$this->updatePackagesCache = $updatePackagesCache;
- $this->timezone = $objectManager->get('Magento\Framework\Stdlib\DateTime\TimezoneInterface');
+ }
+
+ /**
+ * Get timezone
+ *
+ * @return \Magento\Framework\Stdlib\DateTime\TimezoneInterface|null
+ */
+ private function getTimezone()
+ {
+ if ($this->timezone === null) {
+ $this->timezone = $this->objectManager->get('Magento\Setup\Model\DateTime\TimezoneProvider')->get();
+ }
+ return $this->timezone;
+ }
+
+ /**
+ * Set timezone
+ *
+ * @param \Magento\Framework\Stdlib\DateTime\TimezoneInterface $timezone
+ * @return void
+ * @throws \Exception
+ */
+ public function setTimezone(\Magento\Framework\Stdlib\DateTime\TimezoneInterface $timezone)
+ {
+ if ($this->timezone !== null) {
+ throw new \Exception('timezone is already set');
+ }
+ $this->timezone = $timezone;
}
/**
@@ -214,12 +248,12 @@
private function formatSyncDate($syncDate)
{
return [
- 'date' => $this->timezone->formatDateTime(
+ 'date' => $this->getTimezone()->formatDateTime(
new \DateTime('@'.$syncDate),
\IntlDateFormatter::MEDIUM,
\IntlDateFormatter::NONE
),
- 'time' => $this->timezone->formatDateTime(
+ 'time' => $this->getTimezone()->formatDateTime(
new \DateTime('@'.$syncDate),
\IntlDateFormatter::NONE,
\IntlDateFormatter::MEDIUM
--- Magento-CE-2.0.5/setup/src/Magento/Setup/Controller/Install.php 2016-04-27 23:23:14.000000000 -0300
+++ Magento-CE-2.0.6/setup/src/Magento/Setup/Controller/Install.php 2016-05-16 13:49:31.000000000 -0300
@@ -49,6 +49,11 @@
protected $sampleDataState;
/**
+ * @var \Magento\Framework\App\DeploymentConfig
+ */
+ private $deploymentConfig;
+
+ /**
* Default Constructor
*
* @param WebLogger $logger
@@ -89,6 +94,7 @@
$this->log->clear();
$json = new JsonModel;
try {
+ $this->checkForPriorInstall();
$data = array_merge(
$this->importDeploymentConfigForm(),
$this->importUserConfigForm(),
@@ -106,6 +112,7 @@
$json->setVariable('messages', $this->installer->getInstallInfo()[Installer::INFO_MESSAGE]);
} catch (\Exception $e) {
$this->log->logError($e);
+ $json->setVariable('messages', $e->getMessage());
$json->setVariable('success', false);
}
return $json;
@@ -146,6 +153,19 @@
}
/**
+ * Checks for prior install
+ *
+ * @return void
+ * @throws \Magento\Setup\Exception
+ */
+ private function checkForPriorInstall()
+ {
+ if ($this->getDeploymentConfig()->isAvailable()) {
+ throw new \Magento\Setup\Exception('Magento application is already installed.');
+ }
+ }
+
+ /**
* Maps data from request to format of deployment config model
*
* @return array
@@ -242,4 +262,20 @@
$result[AdminAccount::KEY_LAST_NAME] = $result[AdminAccount::KEY_USER];
return $result;
}
+
+ /**
+ * Get Deployment Config
+ *
+ * @return \Magento\Framework\App\DeploymentConfig
+ *
+ * @deprecated
+ */
+ private function getDeploymentConfig()
+ {
+ if ($this->deploymentConfig === null) {
+ $this->deploymentConfig = $this->installer->getObjectManagerProvider()->get()
+ ->get(\Magento\Framework\App\DeploymentConfig::class);
+ }
+ return $this->deploymentConfig;
+ }
}
--- Magento-CE-2.0.5/setup/src/Magento/Setup/Model/ConfigGenerator.php 2016-04-27 23:23:14.000000000 -0300
+++ Magento-CE-2.0.6/setup/src/Magento/Setup/Model/ConfigGenerator.php 2016-05-16 13:49:31.000000000 -0300
@@ -64,6 +64,8 @@
/**
* Creates install segment config data
*
+ * @deprecated
+ *
* @return ConfigData
*/
public function createInstallConfig()
--- Magento-CE-2.0.5/setup/src/Magento/Setup/Model/ConfigOptionsList.php 2016-04-27 23:23:14.000000000 -0300
+++ Magento-CE-2.0.6/setup/src/Magento/Setup/Model/ConfigOptionsList.php 2016-05-16 13:49:31.000000000 -0300
@@ -163,7 +163,6 @@
public function createConfig(array $data, DeploymentConfig $deploymentConfig)
{
$configData = [];
- $configData[] = $this->configGenerator->createInstallConfig($deploymentConfig);
$configData[] = $this->configGenerator->createCryptConfig($data, $deploymentConfig);
$configData[] = $this->configGenerator->createSessionConfig($data);
$definitionConfig = $this->configGenerator->createDefinitionsConfig($data);
--- Magento-CE-2.0.5/setup/src/Magento/Setup/Model/DateTime/DateTimeProvider.php 1969-12-31 21:00:00.000000000 -0300
+++ Magento-CE-2.0.6/setup/src/Magento/Setup/Model/DateTime/DateTimeProvider.php 2016-05-16 13:49:31.000000000 -0300
@@ -0,0 +1,63 @@
+<?php
+/**
+ * Copyright © 2016 Magento. All rights reserved.
+ * See COPYING.txt for license details.
+ */
+namespace Magento\Setup\Model\DateTime;
+
+use Magento\Setup\Model\ObjectManagerProvider;
+
+/**
+ * Provider of DateTime instance
+ */
+class DateTimeProvider
+{
+ /**
+ * Timezone provider
+ *
+ * @var TimezoneProvider
+ */
+ private $tzProvider;
+
+ /**
+ * Object Manager provider
+ *
+ * @var ObjectManagerProvider
+ */
+ private $objectManagerProvider;
+
+ /**
+ * DateTime instance
+ *
+ * @var \Magento\Framework\Stdlib\DateTime\DateTime
+ */
+ private $dateTime;
+
+ /**
+ * Init
+ *
+ * @param TimezoneProvider $tzProvider
+ * @param ObjectManagerProvider $objectManagerProvider
+ */
+ public function __construct(TimezoneProvider $tzProvider, ObjectManagerProvider $objectManagerProvider)
+ {
+ $this->tzProvider = $tzProvider;
+ $this->objectManagerProvider = $objectManagerProvider;
+ }
+
+ /**
+ * Get instance of DateTime
+ *
+ * @return \Magento\Framework\Stdlib\DateTime\DateTime
+ */
+ public function get()
+ {
+ if (!$this->dateTime) {
+ $this->dateTime = $this->objectManagerProvider->get()->create(
+ 'Magento\Framework\Stdlib\DateTime\DateTime',
+ ['localeDate' => $this->tzProvider->get()]
+ );
+ }
+ return $this->dateTime;
+ }
+}
--- Magento-CE-2.0.5/setup/src/Magento/Setup/Model/DateTime/TimezoneProvider.php 1969-12-31 21:00:00.000000000 -0300
+++ Magento-CE-2.0.6/setup/src/Magento/Setup/Model/DateTime/TimezoneProvider.php 2016-05-16 13:49:31.000000000 -0300
@@ -0,0 +1,55 @@
+<?php
+/**
+ * Copyright © 2016 Magento. All rights reserved.
+ * See COPYING.txt for license details.
+ */
+namespace Magento\Setup\Model\DateTime;
+
+use Magento\Framework\App\Config\ScopeConfigInterface;
+use Magento\Setup\Model\ObjectManagerProvider;
+
+/**
+ * Provider of Timezone instance
+ */
+class TimezoneProvider
+{
+ /**
+ * Object Manager provider
+ *
+ * @var ObjectManagerProvider
+ */
+ private $objectManagerProvider;
+
+ /**
+ * Instance of Timezone
+ *
+ * @var \Magento\Framework\Stdlib\DateTime\Timezone
+ */
+ private $timezone;
+
+ /**
+ * Init
+ *
+ * @param ObjectManagerProvider $objectManagerProvider
+ */
+ public function __construct(ObjectManagerProvider $objectManagerProvider)
+ {
+ $this->objectManagerProvider = $objectManagerProvider;
+ }
+
+ /**
+ * Get instance of Timezone
+ *
+ * @return \Magento\Framework\Stdlib\DateTime\Timezone
+ */
+ public function get()
+ {
+ if (!$this->timezone) {
+ $this->timezone = $this->objectManagerProvider->get()->create(
+ 'Magento\Framework\Stdlib\DateTime\Timezone',
+ ['scopeType' => ScopeConfigInterface::SCOPE_TYPE_DEFAULT]
+ );
+ }
+ return $this->timezone;
+ }
+}
--- Magento-CE-2.0.5/setup/src/Magento/Setup/Model/Installer.php 2016-04-27 23:23:14.000000000 -0300
+++ Magento-CE-2.0.6/setup/src/Magento/Setup/Model/Installer.php 2016-05-16 13:49:31.000000000 -0300
@@ -13,6 +13,7 @@
use Magento\Framework\App\ResourceConnection\Config;
use Magento\Framework\Component\ComponentRegistrar;
use Magento\Framework\Config\ConfigOptionsListConstants;
+use Magento\Framework\Config\Data\ConfigData;
use Magento\Framework\Filesystem;
use Magento\Framework\Exception\FileSystemException;
use Magento\Framework\Model\ResourceModel\Db\Context;
@@ -319,6 +320,7 @@
$script[] = ['Caches clearing:', 'cleanCaches', []];
$script[] = ['Disabling Maintenance Mode:', 'setMaintenanceMode', [0]];
$script[] = ['Post installation file permissions check...', 'checkApplicationFilePermissions', []];
+ $script[] = ['Write installation date...', 'writeInstallationDate', []];
$estimatedModules = $this->createModulesConfig($request);
$total = count($script) + 3 * count(array_filter($estimatedModules));
@@ -347,6 +349,20 @@
}
/**
+ * Writes installation date to the configuration
+ *
+ * @return void
+ * @SuppressWarnings(PHPMD.UnusedPrivateMethod) Called by install() via callback.
+ */
+ private function writeInstallationDate()
+ {
+ $dateData = new ConfigData(ConfigFilePool::APP_ENV);
+ $dateData->set(ConfigOptionsListConstants::CONFIG_PATH_INSTALL_DATE, date('r'));
+ $configData = [$dateData->getFileKey() => $dateData->getData()];
+ $this->deploymentConfigWriter->saveConfig($configData);
+ }
+
+ /**
* Creates modules deployment configuration segment
*
* @param \ArrayObject|array $request
@@ -356,11 +372,9 @@
private function createModulesConfig($request)
{
$all = array_keys($this->moduleLoader->load());
- $currentModules = [];
- if ($this->deploymentConfig->isAvailable()) {
$deploymentConfig = $this->deploymentConfigReader->load();
- $currentModules = isset($deploymentConfig['modules']) ? $deploymentConfig['modules'] : [] ;
- }
+ $currentModules = isset($deploymentConfig[ConfigOptionsListConstants::KEY_MODULES])
+ ? $deploymentConfig[ConfigOptionsListConstants::KEY_MODULES] : [] ;
$enable = $this->readListOfModules($all, $request, self::ENABLE_MODULES);
$disable = $this->readListOfModules($all, $request, self::DISABLE_MODULES);
$result = [];
@@ -466,17 +480,25 @@
$this->checkInstallationFilePermissions();
$userData = is_array($data) ? $data : $data->getArrayCopy();
$this->setupConfigModel->process($userData);
- if ($this->deploymentConfig->isAvailable()) {
$deploymentConfigData = $this->deploymentConfig->get(ConfigOptionsListConstants::CONFIG_PATH_CRYPT_KEY);
if (isset($deploymentConfigData)) {
$this->installInfo[ConfigOptionsListConstants::KEY_ENCRYPTION_KEY] = $deploymentConfigData;
}
- }
// reset object manager now that there is a deployment config
$this->objectManagerProvider->reset();
}
/**
+ * Get Object Manager Provider
+ *
+ * @return ObjectManagerProvider
+ */
+ public function getObjectManagerProvider()
+ {
+ return $this->objectManagerProvider;
+ }
+
+ /**
* Set up setup_module table to register modules' versions, skip this process if it already exists
*
* @param SchemaSetupInterface $setup
@@ -725,6 +747,8 @@
*/
public function installSchema()
{
+ $this->assertDbConfigExists();
+ $this->assertDbAccessible();
$setup = $this->setupFactory->create($this->context->getResources());
$this->setupModuleRegistry($setup);
$this->setupCoreTables($setup);
@@ -740,6 +764,8 @@
*/
public function installDataFixtures()
{
+ $this->assertDbConfigExists();
+ $this->assertDbAccessible();
$setup = $this->dataSetupFactory->create();
$this->checkInstallationFilePermissions();
$this->log->log('Data install/update:');
@@ -763,9 +789,6 @@
throw new \Magento\Setup\Exception("Unsupported operation type $type is requested");
}
- $this->assertDeploymentConfigExists();
- $this->assertDbAccessible();
-
$resource = new \Magento\Framework\Module\ModuleResource($this->context);
$verType = $type . '-version';
$installType = $type . '-install';
@@ -826,6 +849,20 @@
}
/**
+ * @return void
+ * @throws \Magento\Setup\Exception
+ */
+ private function assertDbConfigExists()
+ {
+ $config = $this->deploymentConfig->get(ConfigOptionsListConstants::CONFIG_PATH_DB_CONNECTION_DEFAULT);
+ if (!$config) {
+ throw new \Magento\Setup\Exception(
+ "Can't run this operation: configuration for DB connection is absent."
+ );
+ }
+ }
+
+ /**
* Installs user configuration
*
* @param \ArrayObject|array $data
@@ -922,7 +959,7 @@
*/
public function installAdminUser($data)
{
- $this->assertDeploymentConfigExists();
+ $this->assertDbConfigExists();
$setup = $this->setupFactory->create($this->context->getResources());
$adminAccount = $this->adminAccountFactory->create($setup, (array)$data);
$adminAccount->save();
@@ -936,10 +973,15 @@
*/
public function updateModulesSequence($keepGeneratedCode = false)
{
- $this->assertDeploymentConfigExists();
+ $config = $this->deploymentConfig->get(ConfigOptionsListConstants::KEY_MODULES);
+ if (!$config) {
+ throw new \Magento\Setup\Exception(
+ "Can't run this operation: deployment configuration is absent."
+ . " Run 'magento setup:config:set --help' for options."
+ );
+ }
$this->cleanCaches();
-
if (!$keepGeneratedCode) {
$this->cleanupGeneratedCode();
}
@@ -1035,8 +1077,6 @@
*/
public function cleanupDb()
{
- // stops cleanup if configuration does not exist
- if ($this->deploymentConfig->isAvailable()) {
$config = $this->deploymentConfig->get(ConfigOptionsListConstants::CONFIG_PATH_DB_CONNECTION_DEFAULT);
if ($config) {
try {
@@ -1052,11 +1092,10 @@
$this->log->log("Cleaning up database {$dbName}");
$connection->query("DROP DATABASE IF EXISTS {$dbName}");
$connection->query("CREATE DATABASE IF NOT EXISTS {$dbName}");
- return;
- }
- }
+ } else {
$this->log->log('No database connection defined - skipping database cleanup');
}
+ }
/**
* Removes deployment configuration
@@ -1085,8 +1124,12 @@
/**
* Validates that deployment configuration exists
*
+ * @deprecated
+ *
* @throws \Magento\Setup\Exception
* @return void
+ *
+ * @SuppressWarnings(PHPMD.UnusedPrivateMethod)
*/
private function assertDeploymentConfigExists()
{
--- Magento-CE-2.0.5/setup/src/Magento/Setup/Model/MarketplaceManager.php 2016-04-27 23:23:14.000000000 -0300
+++ Magento-CE-2.0.6/setup/src/Magento/Setup/Model/MarketplaceManager.php 2016-05-16 13:49:31.000000000 -0300
@@ -313,9 +313,6 @@
return $this->getDirectory()->writeFile(
DirectoryList::COMPOSER_HOME . DIRECTORY_SEPARATOR . $this->pathToAuthFile,
$jsonContent
- ) && $this->getDirectory()->changePermissions(
- DirectoryList::COMPOSER_HOME . DIRECTORY_SEPARATOR . $this->pathToAuthFile,
- \Magento\Framework\Filesystem\DriverInterface::WRITEABLE_FILE_MODE
);
}
--- Magento-CE-2.0.5/setup/src/Magento/Setup/Model/ObjectManagerProvider.php 2016-04-27 23:23:14.000000000 -0300
+++ Magento-CE-2.0.6/setup/src/Magento/Setup/Model/ObjectManagerProvider.php 2016-05-16 13:49:31.000000000 -0300
@@ -51,15 +51,6 @@
$initParams = $this->serviceLocator->get(InitParamListener::BOOTSTRAP_PARAM);
$factory = Bootstrap::createObjectManagerFactory(BP, $initParams);
$this->objectManager = $factory->create($initParams);
- $this->objectManager->configure(
- [
- 'Magento\Framework\Stdlib\DateTime\Timezone' => [
- 'arguments' => [
- 'scopeType' => \Magento\Framework\App\Config\ScopeConfigInterface::SCOPE_TYPE_DEFAULT
- ]
- ]
- ]
- );
}
return $this->objectManager;
}
--- Magento-CE-2.0.5/setup/src/Magento/Setup/Model/UpdatePackagesCache.php 2016-04-27 23:23:14.000000000 -0300
+++ Magento-CE-2.0.6/setup/src/Magento/Setup/Model/UpdatePackagesCache.php 2016-05-16 13:49:31.000000000 -0300
@@ -11,9 +11,12 @@
use Magento\Framework\App\Filesystem\DirectoryList;
use Magento\Framework\Filesystem;
use Magento\Framework\Composer\MagentoComposerApplicationFactory;
+use Magento\Framework\ObjectManagerInterface;
/**
* Class UpdatePackagesCache manages information about available for update packages though the cache file.
+ *
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*/
class UpdatePackagesCache
{
@@ -52,6 +55,11 @@
private $pathToCacheFile = 'update_composer_packages.json';
/**
+ * @var ObjectManagerInterface
+ */
+ private $objectManager;
+
+ /**
* Constructor
*
* @param MagentoComposerApplicationFactory $applicationFactory
@@ -68,11 +76,39 @@
) {
$this->application = $applicationFactory->create();
$this->directory = $filesystem->getDirectoryWrite(DirectoryList::VAR_DIR);
- $this->dateTime = $objectManagerProvider->get()->get('Magento\Framework\Stdlib\DateTime\DateTime');
+ $this->objectManager = $objectManagerProvider->get();
$this->composerInformation = $composerInformation;
}
/**
+ * Get datetime
+ *
+ * @return \Magento\Framework\Stdlib\DateTime\DateTime
+ */
+ private function getDateTime()
+ {
+ if ($this->dateTime === null) {
+ $this->dateTime = $this->objectManager->get('Magento\Setup\Model\DateTime\DateTimeProvider')->get();
+ }
+ return $this->dateTime;
+ }
+
+ /**
+ * Set datetime
+ *
+ * @param \Magento\Framework\Stdlib\DateTime\DateTime $dateTime
+ * @return void
+ * @throws \Exception
+ */
+ public function setDateTime(\Magento\Framework\Stdlib\DateTime\DateTime $dateTime)
+ {
+ if ($this->dateTime !== null) {
+ throw new \Exception('dateTime is already set');
+ }
+ $this->dateTime = $dateTime;
+ }
+
+ /**
* Sync and cache list of available for update versions for packages
*
* @return bool
@@ -172,7 +208,7 @@
private function savePackagesForUpdateToCache($availableVersions)
{
$syncInfo = [];
- $syncInfo['lastSyncDate'] = $this->dateTime->gmtTimestamp();
+ $syncInfo['lastSyncDate'] = $this->getDateTime()->gmtTimestamp();
$syncInfo['packages'] = $availableVersions;
$data = json_encode($syncInfo, JSON_UNESCAPED_SLASHES);
try {
--- Magento-CE-2.0.5/setup/src/Magento/Setup/Module/Di/Compiler/Config/Writer/Filesystem.php 2016-04-27 23:23:14.000000000 -0300
+++ Magento-CE-2.0.6/setup/src/Magento/Setup/Module/Di/Compiler/Config/Writer/Filesystem.php 2016-05-16 13:49:31.000000000 -0300
@@ -51,7 +51,7 @@
private function initialize()
{
if (!file_exists($this->directoryList->getPath(DirectoryList::DI))) {
- mkdir($this->directoryList->getPath(DirectoryList::DI), DriverInterface::WRITEABLE_DIRECTORY_MODE);
+ mkdir($this->directoryList->getPath(DirectoryList::DI));
}
}
}
--- Magento-CE-2.0.5/setup/src/Magento/Setup/Module/I18n/Pack/Writer/File/AbstractFile.php 2016-04-27 23:23:14.000000000 -0300
+++ Magento-CE-2.0.6/setup/src/Magento/Setup/Module/I18n/Pack/Writer/File/AbstractFile.php 2016-05-16 13:49:31.000000000 -0300
@@ -143,7 +143,7 @@
* @param bool $recursive Allows the creation of nested directories specified in the $destinationPath
* @return void
*/
- protected function _createDirectoryIfNotExist($destinationPath, $mode = 0750, $recursive = true)
+ protected function _createDirectoryIfNotExist($destinationPath, $mode = 0777, $recursive = true)
{
if (!is_dir($destinationPath)) {
mkdir($destinationPath, $mode, $recursive);
--- Magento-CE-2.0.5/setup/src/Magento/Setup/Mvc/Bootstrap/InitParamListener.php 2016-04-27 23:23:14.000000000 -0300
+++ Magento-CE-2.0.6/setup/src/Magento/Setup/Mvc/Bootstrap/InitParamListener.php 2016-05-16 13:49:31.000000000 -0300
@@ -8,6 +8,7 @@
use Magento\Framework\App\Bootstrap as AppBootstrap;
use Magento\Framework\App\Filesystem\DirectoryList;
+use Magento\Framework\App\Request\Http;
use Magento\Framework\App\State;
use Magento\Framework\Filesystem;
use Magento\Framework\Shell\ComplexParameter;
@@ -47,9 +48,7 @@
*/
private $controllersToSkip = [
'Magento\Setup\Controller\Session',
- 'Magento\Setup\Controller\Install',
'Magento\Setup\Controller\Success'
-
];
/**
@@ -102,7 +101,7 @@
/**
* Check if user login
*
- * @param object $event
+ * @param \Zend\Mvc\MvcEvent $event
* @return bool
* @throws \Magento\Framework\Exception\LocalizedException
*/
@@ -117,25 +116,31 @@
$application = $event->getApplication();
$serviceManager = $application->getServiceManager();
if ($serviceManager->get('Magento\Framework\App\DeploymentConfig')->isAvailable()) {
+ /** @var \Magento\Setup\Model\ObjectManagerProvider $objectManagerProvider */
$objectManagerProvider = $serviceManager->get('Magento\Setup\Model\ObjectManagerProvider');
/** @var \Magento\Framework\ObjectManagerInterface $objectManager */
$objectManager = $objectManagerProvider->get();
/** @var \Magento\Framework\App\State $adminAppState */
$adminAppState = $objectManager->get('Magento\Framework\App\State');
$adminAppState->setAreaCode(\Magento\Framework\App\Area::AREA_ADMIN);
- $objectManager->create(
- 'Magento\Backend\Model\Auth\Session',
+ /** @var \Magento\Backend\Model\Session\AdminConfig $sessionConfig */
+ $sessionConfig = $objectManager->get(\Magento\Backend\Model\Session\AdminConfig::class);
+ $cookiePath = $this->getSetupCookiePath($objectManager);
+ $sessionConfig->setCookiePath($cookiePath);
+ /** @var \Magento\Backend\Model\Auth\Session $adminSession */
+ $adminSession = $objectManager->create(
+ \Magento\Backend\Model\Auth\Session::class,
[
- 'sessionConfig' => $objectManager->get('Magento\Backend\Model\Session\AdminConfig'),
+ 'sessionConfig' => $sessionConfig,
'appState' => $adminAppState
]
);
-
- if (!$objectManager->get('Magento\Backend\Model\Auth')->isLoggedIn()) {
+ if (!$objectManager->get(\Magento\Backend\Model\Auth::class)->isLoggedIn()) {
+ $adminSession->destroy();
$response = $event->getResponse();
- $response->getHeaders()->addHeaderLine('Location', 'index.php/session/unlogin');
+ $baseUrl = Http::getDistroBaseUrlPath($_SERVER);
+ $response->getHeaders()->addHeaderLine('Location', $baseUrl . 'index.php/session/unlogin');
$response->setStatusCode(302);
-
$event->stopPropagation();
return $response;
}
@@ -145,6 +150,25 @@
}
/**
+ * Get cookie path
+ *
+ * @param \Magento\Framework\ObjectManagerInterface $objectManager
+ * @return string
+ */
+ private function getSetupCookiePath(\Magento\Framework\ObjectManagerInterface $objectManager)
+ {
+ /** @var \Magento\Backend\App\BackendAppList $backendAppList */
+ $backendAppList = $objectManager->get(\Magento\Backend\App\BackendAppList::class);
+ $backendApp = $backendAppList->getBackendApp('setup');
+ /** @var \Magento\Backend\Model\UrlFactory $backendUrlFactory */
+ $backendUrlFactory = $objectManager->get(\Magento\Backend\Model\UrlFactory::class);
+ $baseUrl = parse_url($backendUrlFactory->create()->getBaseUrl(), PHP_URL_PATH);
+ $baseUrl = \Magento\Framework\App\Request\Http::getUrlNoScript($baseUrl);
+ $cookiePath = $baseUrl . $backendApp->getCookiePath();
+ return $cookiePath;
+ }
+
+ /**
* {@inheritdoc}
*/
public function createService(ServiceLocatorInterface $serviceLocator)
--- Magento-CE-2.0.5/setup/src/Magento/Setup/Test/Unit/Console/Command/DiCompileCommandTest.php 2016-04-27 23:23:14.000000000 -0300
+++ Magento-CE-2.0.6/setup/src/Magento/Setup/Test/Unit/Console/Command/DiCompileCommandTest.php 2016-05-16 13:49:31.000000000 -0300
@@ -12,13 +12,13 @@
class DiCompileCommandTest extends \PHPUnit_Framework_TestCase
{
/** @var \Magento\Framework\App\DeploymentConfig|\PHPUnit_Framework_MockObject_MockObject */
- private $deploymentConfig;
+ private $deploymentConfigMock;
/** @var \Magento\Setup\Module\Di\App\Task\Manager|\PHPUnit_Framework_MockObject_MockObject */
- private $manager;
+ private $managerMock;
/** @var \Magento\Framework\ObjectManagerInterface|\PHPUnit_Framework_MockObject_MockObject */
- private $objectManager;
+ private $objectManagerMock;
/** @var DiCompileCommand|\PHPUnit_Framework_MockObject_MockObject */
private $command;
@@ -27,28 +27,28 @@
private $cacheMock;
/** @var \Magento\Framework\Filesystem|\PHPUnit_Framework_MockObject_MockObject */
- private $filesystem;
+ private $filesystemMock;
/** @var \Magento\Framework\Filesystem\Driver\File | \PHPUnit_Framework_MockObject_MockObject*/
- private $fileDriver;
+ private $fileDriverMock;
/** @var \Magento\Framework\App\Filesystem\DirectoryList | \PHPUnit_Framework_MockObject_MockObject*/
- private $directoryList;
+ private $directoryListMock;
/** @var \Magento\Framework\Component\ComponentRegistrar|\PHPUnit_Framework_MockObject_MockObject */
- private $componentRegistrar;
+ private $componentRegistrarMock;
public function setUp()
{
- $this->deploymentConfig = $this->getMock('Magento\Framework\App\DeploymentConfig', [], [], '', false);
- $objectManagerProvider = $this->getMock(
+ $this->deploymentConfigMock = $this->getMock('Magento\Framework\App\DeploymentConfig', [], [], '', false);
+ $objectManagerProviderMock = $this->getMock(
'Magento\Setup\Model\ObjectManagerProvider',
[],
[],
'',
false
);
- $this->objectManager = $this->getMockForAbstractClass(
+ $this->objectManagerMock = $this->getMockForAbstractClass(
'Magento\Framework\ObjectManagerInterface',
[],
'',
@@ -58,91 +58,87 @@
->disableOriginalConstructor()
->getMock();
- $objectManagerProvider->expects($this->once())
+ $objectManagerProviderMock->expects($this->once())
->method('get')
- ->willReturn($this->objectManager);
- $this->manager = $this->getMock('Magento\Setup\Module\Di\App\Task\Manager', [], [], '', false);
- $this->directoryList = $this->getMock('Magento\Framework\App\Filesystem\DirectoryList', [], [], '', false);
- $this->filesystem = $this->getMockBuilder('Magento\Framework\Filesystem')
+ ->willReturn($this->objectManagerMock);
+ $this->managerMock = $this->getMock('Magento\Setup\Module\Di\App\Task\Manager', [], [], '', false);
+ $this->directoryListMock = $this->getMock('Magento\Framework\App\Filesystem\DirectoryList', [], [], '', false);
+ $this->filesystemMock = $this->getMockBuilder('Magento\Framework\Filesystem')
->disableOriginalConstructor()
->getMock();
- $this->fileDriver = $this->getMockBuilder('Magento\Framework\Filesystem\Driver\File')
+ $this->fileDriverMock = $this->getMockBuilder('Magento\Framework\Filesystem\Driver\File')
->disableOriginalConstructor()
->getMock();
- $this->componentRegistrar = $this->getMock(
+ $this->componentRegistrarMock = $this->getMock(
'\Magento\Framework\Component\ComponentRegistrar',
[],
[],
'',
false
);
- $this->componentRegistrar->expects($this->any())->method('getPaths')->willReturnMap([
+ $this->componentRegistrarMock->expects($this->any())->method('getPaths')->willReturnMap([
[ComponentRegistrar::MODULE, ['/path/to/module/one', '/path/to/module/two']],
[ComponentRegistrar::LIBRARY, ['/path/to/library/one', '/path/to/library/two']],
]);
$this->command = new DiCompileCommand(
- $this->deploymentConfig,
- $this->directoryList,
- $this->manager,
- $objectManagerProvider,
- $this->filesystem,
- $this->fileDriver,
- $this->componentRegistrar
+ $this->deploymentConfigMock,
+ $this->directoryListMock,
+ $this->managerMock,
+ $objectManagerProviderMock,
+ $this->filesystemMock,
+ $this->fileDriverMock,
+ $this->componentRegistrarMock
);
}
- public function testExecuteDiExists()
+ public function testExecuteModulesNotEnabled()
{
- $diPath = '/root/magento/var/di';
- $this->deploymentConfig->expects($this->once())->method('isAvailable')->willReturn(true);
- $this->fileDriver->expects($this->atLeastOnce())->method('isExists')->with($diPath)->willReturn(true);
- $this->directoryList->expects($this->atLeastOnce())->method('getPath')->willReturn($diPath);
- $tester = new CommandTester($this->command);
- $tester->execute([]);
- $this->assertContains("delete '/root/magento/var/di'", $tester->getDisplay());
- }
-
- public function testExecuteNotInstalled()
- {
- $this->directoryList->expects($this->atLeastOnce())->method('getPath')->willReturn(null);
- $this->deploymentConfig->expects($this->once())->method('isAvailable')->willReturn(false);
+ $this->directoryListMock->expects($this->atLeastOnce())->method('getPath')->willReturn(null);
+ $this->deploymentConfigMock->expects($this->once())
+ ->method('get')
+ ->with(\Magento\Framework\Config\ConfigOptionsListConstants::KEY_MODULES)
+ ->willReturn(null);
$tester = new CommandTester($this->command);
$tester->execute([]);
$this->assertEquals(
- 'You cannot run this command because the Magento application is not installed.' . PHP_EOL,
+ 'You cannot run this command because modules are not enabled. You can enable modules by running the '
+ . "'module:enable --all' command." . PHP_EOL,
$tester->getDisplay()
);
}
public function testExecute()
{
- $this->directoryList->expects($this->atLeastOnce())->method('getPath')->willReturn(null);
- $this->objectManager->expects($this->once())
+ $this->directoryListMock->expects($this->atLeastOnce())->method('getPath')->willReturn(null);
+ $this->objectManagerMock->expects($this->once())
->method('get')
->with('Magento\Framework\App\Cache')
->willReturn($this->cacheMock);
$this->cacheMock->expects($this->once())->method('clean');
$writeDirectory = $this->getMock('Magento\Framework\Filesystem\Directory\WriteInterface');
$writeDirectory->expects($this->atLeastOnce())->method('delete');
- $this->filesystem->expects($this->atLeastOnce())->method('getDirectoryWrite')->willReturn($writeDirectory);
+ $this->filesystemMock->expects($this->atLeastOnce())->method('getDirectoryWrite')->willReturn($writeDirectory);
- $this->deploymentConfig->expects($this->once())->method('isAvailable')->willReturn(true);
+ $this->deploymentConfigMock->expects($this->once())
+ ->method('get')
+ ->with(\Magento\Framework\Config\ConfigOptionsListConstants::KEY_MODULES)
+ ->willReturn(['Magento_Catalog' => 1]);
$progressBar = $this->getMockBuilder(
'Symfony\Component\Console\Helper\ProgressBar'
)
->disableOriginalConstructor()
->getMock();
- $this->objectManager->expects($this->once())->method('configure');
- $this->objectManager
+ $this->objectManagerMock->expects($this->once())->method('configure');
+ $this->objectManagerMock
->expects($this->once())
->method('create')
->with('Symfony\Component\Console\Helper\ProgressBar')
->willReturn($progressBar);
- $this->manager->expects($this->exactly(7))->method('addOperation');
- $this->manager->expects($this->once())->method('process');
+ $this->managerMock->expects($this->exactly(7))->method('addOperation');
+ $this->managerMock->expects($this->once())->method('process');
$tester = new CommandTester($this->command);
$tester->execute([]);
$this->assertContains(
--- Magento-CE-2.0.5/setup/src/Magento/Setup/Test/Unit/Console/Command/ModuleEnableDisableCommandTest.php 2016-04-27 23:23:14.000000000 -0300
+++ Magento-CE-2.0.6/setup/src/Magento/Setup/Test/Unit/Console/Command/ModuleEnableDisableCommandTest.php 2016-05-16 13:49:31.000000000 -0300
@@ -14,46 +14,58 @@
/**
* @var \Magento\Setup\Model\ObjectManagerProvider|\PHPUnit_Framework_MockObject_MockObject
*/
- private $objectManagerProvider;
+ private $objectManagerProviderMock;
/**
* @var \Magento\Framework\Module\Status|\PHPUnit_Framework_MockObject_MockObject
*/
- private $status;
+ private $statusMock;
/**
* @var \Magento\Framework\App\Cache|\PHPUnit_Framework_MockObject_MockObject
*/
- private $cache;
+ private $cacheMock;
/**
* @var \Magento\Framework\App\State\CleanupFiles|\PHPUnit_Framework_MockObject_MockObject
*/
- private $cleanupFiles;
+ private $cleanupFilesMock;
/**
* @var \Magento\Framework\Module\FullModuleList|\PHPUnit_Framework_MockObject_MockObject
*/
- private $fullModuleList;
+ private $fullModuleListMock;
+
+ /**
+ * @var \Magento\Framework\App\DeploymentConfig|\PHPUnit_Framework_MockObject_MockObject
+ */
+ private $deploymentConfigMock;
protected function setUp()
{
- $this->objectManagerProvider = $this->getMock('Magento\Setup\Model\ObjectManagerProvider', [], [], '', false);
+ $this->objectManagerProviderMock = $this->getMock(
+ 'Magento\Setup\Model\ObjectManagerProvider',
+ [],
+ [],
+ '',
+ false
+ );
$objectManager = $this->getMockForAbstractClass('Magento\Framework\ObjectManagerInterface');
- $this->objectManagerProvider->expects($this->any())
+ $this->objectManagerProviderMock->expects($this->any())
->method('get')
->will($this->returnValue($objectManager));
- $this->status = $this->getMock('Magento\Framework\Module\Status', [], [], '', false);
- $this->cache = $this->getMock('Magento\Framework\App\Cache', [], [], '', false);
- $this->cleanupFiles = $this->getMock('Magento\Framework\App\State\CleanupFiles', [], [], '', false);
- $this->fullModuleList = $this->getMock('Magento\Framework\Module\FullModuleList', [], [], '', false);
+ $this->statusMock = $this->getMock('Magento\Framework\Module\Status', [], [], '', false);
+ $this->cacheMock = $this->getMock('Magento\Framework\App\Cache', [], [], '', false);
+ $this->cleanupFilesMock = $this->getMock('Magento\Framework\App\State\CleanupFiles', [], [], '', false);
+ $this->fullModuleListMock = $this->getMock('Magento\Framework\Module\FullModuleList', [], [], '', false);
+ $this->deploymentConfigMock = $this->getMock(\Magento\Framework\App\DeploymentConfig::class, [], [], '', false);
$objectManager->expects($this->any())
->method('get')
->will($this->returnValueMap([
- ['Magento\Framework\Module\Status', $this->status],
- ['Magento\Framework\App\Cache', $this->cache],
- ['Magento\Framework\App\State\CleanupFiles', $this->cleanupFiles],
- ['Magento\Framework\Module\FullModuleList', $this->fullModuleList],
+ ['Magento\Framework\Module\Status', $this->statusMock],
+ ['Magento\Framework\App\Cache', $this->cacheMock],
+ ['Magento\Framework\App\State\CleanupFiles', $this->cleanupFilesMock],
+ ['Magento\Framework\Module\FullModuleList', $this->fullModuleListMock],
]));
}
@@ -66,35 +78,30 @@
*/
public function testExecute($isEnable, $clearStaticContent, $expectedMessage)
{
- $this->status->expects($this->once())
+ $this->statusMock->expects($this->once())
->method('getModulesToChange')
->with($isEnable, ['Magento_Module1', 'Magento_Module2'])
->will($this->returnValue(['Magento_Module1']));
-
- $this->status->expects($this->any())
+ $this->statusMock->expects($this->any())
->method('checkConstraints')
->will($this->returnValue([]));
-
- $this->status->expects($this->once())
+ $this->statusMock->expects($this->once())
->method('setIsEnabled')
->with($isEnable, ['Magento_Module1']);
-
- $this->cache->expects($this->once())
+ $this->cacheMock->expects($this->once())
->method('clean');
- $this->cleanupFiles->expects($this->once())
+ $this->cleanupFilesMock->expects($this->once())
->method('clearCodeGeneratedClasses');
- $this->cleanupFiles->expects($clearStaticContent ? $this->once() : $this->never())
+ $this->cleanupFilesMock->expects($clearStaticContent ? $this->once() : $this->never())
->method('clearMaterializedViewFiles');
-
- $commandTester = $isEnable
- ? new CommandTester(new ModuleEnableCommand($this->objectManagerProvider))
- : new CommandTester(new ModuleDisableCommand($this->objectManagerProvider));
+ $commandTester = $this->getCommandTester($isEnable);
$input = ['module' => ['Magento_Module1', 'Magento_Module2']];
if ($clearStaticContent) {
$input['--clear-static-content'] = true;
}
$commandTester->execute($input);
- $this->assertStringMatchesFormat($expectedMessage, $commandTester->getDisplay());
+ $display = $commandTester->getDisplay();
+ $this->assertStringMatchesFormat($expectedMessage, $display);
}
/**
@@ -106,14 +113,16 @@
'enable, do not clear static content' => [
true,
false,
- '%amodules have been enabled%aMagento_Module1%a' .
- 'Info: Some modules might require static view files to be cleared.%a'
+ '%amodules have been enabled%aMagento_Module1%a'
+ . "Info: Some modules might require static view files to be cleared. To do this, run "
+ . "'module:enable' with the --clear-static-content%a"
],
'disable, do not clear static content' => [
false,
false,
- '%amodules have been disabled%aMagento_Module1%a' .
- 'Info: Some modules might require static view files to be cleared.%a'
+ '%amodules have been disabled%aMagento_Module1%a'
+ . "Info: Some modules might require static view files to be cleared. To do this, run "
+ . "'module:disable' with the --clear-static-content%a"
],
'enable, clear static content' => [
true,
@@ -124,17 +133,17 @@
false,
true,
'%amodules have been disabled%aMagento_Module1%aGenerated static view files cleared%a'
- ],
+ ]
];
}
public function testExecuteEnableInvalidModule()
{
- $this->status->expects($this->once())
+ $this->statusMock->expects($this->once())
->method('getModulesToChange')
->with(true, ['invalid'])
->willThrowException(new \LogicException('Unknown module(s): invalid'));
- $commandTester = new CommandTester(new ModuleEnableCommand($this->objectManagerProvider));
+ $commandTester = $this->getCommandTester(true);
$input = ['module' => ['invalid']];
$commandTester->execute($input);
$this->assertEquals('Unknown module(s): invalid' . PHP_EOL, $commandTester->getDisplay());
@@ -142,11 +151,11 @@
public function testExecuteDisableInvalidModule()
{
- $this->status->expects($this->once())
+ $this->statusMock->expects($this->once())
->method('getModulesToChange')
->with(false, ['invalid'])
->willThrowException(new \LogicException('Unknown module(s): invalid'));
- $commandTester = new CommandTester(new ModuleDisableCommand($this->objectManagerProvider));
+ $commandTester = $this->getCommandTester(false);
$input = ['module' => ['invalid']];
$commandTester->execute($input);
$this->assertEquals('Unknown module(s): invalid' . PHP_EOL, $commandTester->getDisplay());
@@ -155,34 +164,44 @@
/**
* @param bool $isEnable
* @param string $expectedMessage
+ * @param bool $isInstalled
*
* @dataProvider executeAllDataProvider
*/
public function testExecuteAll($isEnable, $expectedMessage)
{
- $this->fullModuleList->expects($this->once())
+ $setupUpgradeMessage = 'To make sure that the enabled modules are properly registered, run \'setup:upgrade\'.';
+ $this->fullModuleListMock->expects($this->once())
->method('getNames')
->will($this->returnValue(['Magento_Module1', 'Magento_Module2']));
-
- $this->status->expects($this->once())
+ $this->statusMock->expects($this->once())
->method('getModulesToChange')
->with($isEnable, ['Magento_Module1', 'Magento_Module2'])
->will($this->returnValue(['Magento_Module1']));
-
- $this->status->expects($this->any())
+ $this->statusMock->expects($this->any())
->method('checkConstraints')
->will($this->returnValue([]));
-
- $this->status->expects($this->once())
+ $this->statusMock->expects($this->once())
->method('setIsEnabled')
->with($isEnable, ['Magento_Module1']);
-
- $commandTester = $isEnable
- ? new CommandTester(new ModuleEnableCommand($this->objectManagerProvider))
- : new CommandTester(new ModuleDisableCommand($this->objectManagerProvider));
+ if ($isEnable) {
+ $this->deploymentConfigMock->expects($this->once())
+ ->method('isAvailable')
+ ->willReturn(['Magento_Module1']);
+ } else {
+ $this->deploymentConfigMock->expects($this->never())
+ ->method('isAvailable');
+ }
+ $commandTester = $this->getCommandTester($isEnable);
$input = ['--all' => true];
$commandTester->execute($input);
- $this->assertStringMatchesFormat($expectedMessage, $commandTester->getDisplay());
+ $output = $commandTester->getDisplay();
+ $this->assertStringMatchesFormat($expectedMessage, $output);
+ if ($isEnable) {
+ $this->assertContains($setupUpgradeMessage, $output);
+ } else {
+ $this->assertNotContains($setupUpgradeMessage, $output);
+ }
}
/**
@@ -203,21 +222,16 @@
*/
public function testExecuteWithConstraints($isEnable)
{
- $this->status->expects($this->once())
+ $this->statusMock->expects($this->once())
->method('getModulesToChange')
->with($isEnable, ['Magento_Module1', 'Magento_Module2'])
->will($this->returnValue(['Magento_Module1']));
-
- $this->status->expects($this->any())
+ $this->statusMock->expects($this->any())
->method('checkConstraints')
->will($this->returnValue(['constraint1', 'constraint2']));
-
- $this->status->expects($this->never())
+ $this->statusMock->expects($this->never())
->method('setIsEnabled');
-
- $commandTester = $isEnable
- ? new CommandTester(new ModuleEnableCommand($this->objectManagerProvider))
- : new CommandTester(new ModuleDisableCommand($this->objectManagerProvider));
+ $commandTester = $this->getCommandTester($isEnable);
$commandTester->execute(['module' => ['Magento_Module1', 'Magento_Module2']]);
$this->assertStringMatchesFormat(
'Unable to change status of modules%aconstraint1%aconstraint2%a',
@@ -244,21 +258,16 @@
*/
public function testExecuteForce($isEnable, $expectedMessage)
{
- $this->status->expects($this->once())
+ $this->statusMock->expects($this->once())
->method('getModulesToChange')
->with($isEnable, ['Magento_Module1', 'Magento_Module2'])
->will($this->returnValue(['Magento_Module1']));
-
- $this->status->expects($this->never())
+ $this->statusMock->expects($this->never())
->method('checkConstraints');
-
- $this->status->expects($this->once())
+ $this->statusMock->expects($this->once())
->method('setIsEnabled')
->with($isEnable, ['Magento_Module1']);
-
- $commandTester = $isEnable
- ? new CommandTester(new ModuleEnableCommand($this->objectManagerProvider))
- : new CommandTester(new ModuleDisableCommand($this->objectManagerProvider));
+ $commandTester = $this->getCommandTester($isEnable);
$commandTester->execute(['module' => ['Magento_Module1', 'Magento_Module2'], '--force' => true]);
$this->assertStringMatchesFormat(
$expectedMessage . '%amodules might not function properly%a',
@@ -284,21 +293,31 @@
*/
public function testExecuteNoChanges($isEnable)
{
- $this->status->expects($this->once())
+ $this->statusMock->expects($this->once())
->method('getModulesToChange')
->with($isEnable, ['Magento_Module1', 'Magento_Module2'])
->will($this->returnValue([]));
-
- $this->status->expects($this->never())
+ $this->statusMock->expects($this->never())
->method('setIsEnabled');
-
- $commandTester = $isEnable
- ? new CommandTester(new ModuleEnableCommand($this->objectManagerProvider))
- : new CommandTester(new ModuleDisableCommand($this->objectManagerProvider));
+ $commandTester = $this->getCommandTester($isEnable);
$commandTester->execute(['module' => ['Magento_Module1', 'Magento_Module2']]);
$this->assertStringMatchesFormat(
'No modules were changed%a',
$commandTester->getDisplay()
);
}
+
+ /**
+ * @param bool $isEnable
+ * @return CommandTester
+ */
+ private function getCommandTester($isEnable)
+ {
+ $class = $isEnable ? ModuleEnableCommand::class : ModuleDisableCommand::class;
+ $command = new $class($this->objectManagerProviderMock);
+ $deploymentConfigProperty = new \ReflectionProperty($class, 'deploymentConfig');
+ $deploymentConfigProperty->setAccessible(true);
+ $deploymentConfigProperty->setValue($command, $this->deploymentConfigMock);
+ return new CommandTester($command);
+ }
}
--- Magento-CE-2.0.5/setup/src/Magento/Setup/Test/Unit/Controller/ComponentGridTest.php 1969-12-31 21:00:00.000000000 -0300
+++ Magento-CE-2.0.6/setup/src/Magento/Setup/Test/Unit/Controller/ComponentGridTest.php 2016-05-16 13:49:31.000000000 -0300
@@ -0,0 +1,280 @@
+<?php
+/**
+ * Copyright © 2016 Magento. All rights reserved.
+ * See COPYING.txt for license details.
+ */
+
+namespace Magento\Setup\Test\Unit\Controller;
+
+use Magento\Framework\Composer\ComposerInformation;
+use Magento\Framework\Module\PackageInfo;
+use Magento\Framework\Module\PackageInfoFactory;
+use Magento\Setup\Controller\ComponentGrid;
+use Magento\Setup\Model\DateTime\TimezoneProvider;
+use Magento\Setup\Model\ObjectManagerProvider;
+use Magento\Setup\Model\UpdatePackagesCache;
+use Magento\Framework\Module\FullModuleList;
+use Magento\Framework\Module\ModuleList;
+use Magento\Framework\Stdlib\DateTime\TimezoneInterface;
+use Magento\Setup\Model\MarketplaceManager;
+
+class ComponentGridTest extends \PHPUnit_Framework_TestCase
+{
+ /**
+ * @var ComposerInformation|\PHPUnit_Framework_MockObject_MockObject
+ */
+ private $composerInformationMock;
+
+ /**
+ * @var UpdatePackagesCache|\PHPUnit_Framework_MockObject_MockObject
+ */
+ private $updatePackagesCacheMock;
+
+ /**
+ * @var TimezoneInterface|\PHPUnit_Framework_MockObject_MockObject
+ *
+ */
+ private $timezoneMock;
+
+ /**
+ * @var FullModuleList|\PHPUnit_Framework_MockObject_MockObject
+ */
+ private $fullModuleListMock;
+
+ /**
+ * @var ModuleList|\PHPUnit_Framework_MockObject_MockObject
+ */
+ private $enabledModuleListMock;
+
+ /**
+ * @var PackageInfoFactory|\PHPUnit_Framework_MockObject_MockObject
+ */
+ private $packageInfoFactoryMock;
+
+ /**
+ * Module package info
+ *
+ * @var PackageInfo
+ */
+ private $packageInfo;
+
+ /**
+ * Controller
+ *
+ * @var ComponentGrid
+ */
+ private $controller;
+
+ /**
+ * @var MarketplaceManager
+ */
+ private $marketplaceManagerMock;
+
+ /**
+ * @var array
+ */
+ private $componentData = [];
+
+ /**
+ * @var array
+ */
+ private $lastSyncData = [];
+
+ /**
+ * @var array
+ */
+ private $convertedLastSyncDate = [];
+
+ /**#@+
+ * Canned formatted date and time to return from mock
+ */
+ const FORMATTED_DATE = 'Jan 15, 1980';
+ const FORMATTED_TIME = '1:55:55 PM';
+ /**#@-*/
+
+ public function setUp()
+ {
+ $this->convertedLastSyncDate = [
+ 'lastSyncDate' => [
+ 'date' => self::FORMATTED_DATE,
+ 'time' => self::FORMATTED_TIME,
+ ],
+ ];
+
+ $this->lastSyncData = [
+ "lastSyncDate" => "1447271496",
+ "packages" => [
+ 'magento/sample-module-one' => [
+ 'name' => 'magento/sample-module-one',
+ 'type' => 'magento2-module',
+ 'version' => '1.0.0'
+ ]
+ ],
+ 'countOfInstall' => 0,
+ 'countOfUpdate' => 1
+ ];
+ $this->componentData = [
+ 'magento/sample-module-one' => [
+ 'name' => 'magento/sample-module-one',
+ 'type' => 'magento2-module',
+ 'version' => '1.0.0'
+ ]
+ ];
+ $allComponentData = [
+ 'magento/sample-module-two' => [
+ 'name' => 'magento/sample-module-two',
+ 'type' => 'magento2-module',
+ 'version' => '1.0.0'
+ ]
+ ];
+ $allComponentData = array_merge($allComponentData, $this->componentData);
+ $this->composerInformationMock = $this->getMock(
+ 'Magento\Framework\Composer\ComposerInformation',
+ [],
+ [],
+ '',
+ false
+ );
+ /** @var ObjectManagerProvider|\PHPUnit_Framework_MockObject_MockObject $objectManagerProvider */
+ $objectManagerProvider = $this->getMock('Magento\Setup\Model\ObjectManagerProvider', [], [], '', false);
+ $objectManager = $this->getMock('Magento\Framework\ObjectManagerInterface', [], [], '', false);
+ $objectManagerProvider->expects($this->once())
+ ->method('get')
+ ->willReturn($objectManager);
+ $this->packageInfoFactoryMock = $this
+ ->getMock('Magento\Framework\Module\PackageInfoFactory', [], [], '', false);
+ $this->enabledModuleListMock = $this->getMock('Magento\Framework\Module\ModuleList', [], [], '', false);
+ $this->enabledModuleListMock->expects($this->any())->method('has')->willReturn(true);
+ $this->fullModuleListMock = $this->getMock('Magento\Framework\Module\FullModuleList', [], [], '', false);
+ $this->fullModuleListMock->expects($this->any())->method('getNames')->willReturn($allComponentData);
+ $this->timezoneMock = $this->getMock('Magento\Framework\Stdlib\DateTime\TimezoneInterface', [], [], '', false);
+ $objectManager->expects($this->any())
+ ->method('get')
+ ->willReturnMap([
+ ['Magento\Framework\Module\PackageInfoFactory', $this->packageInfoFactoryMock],
+ ['Magento\Framework\Module\FullModuleList', $this->fullModuleListMock],
+ ['Magento\Framework\Module\ModuleList', $this->enabledModuleListMock],
+ ['Magento\Framework\Stdlib\DateTime\TimezoneInterface', $this->timezoneMock]
+ ]);
+
+ /** @var TimezoneProvider|\PHPUnit_Framework_MockObject_MockObject $timezoneProviderMock */
+ $timezoneProviderMock = $this->getMock('\Magento\Setup\Model\DateTime\TimezoneProvider', [], [], '', false);
+ $timezoneProviderMock->expects($this->any())
+ ->method('get')
+ ->willReturn($this->timezoneMock);
+ $this->packageInfo = $this->getMock('Magento\Framework\Module\PackageInfo', [], [], '', false);
+ $this->updatePackagesCacheMock = $this->getMock('Magento\Setup\Model\UpdatePackagesCache', [], [], '', false);
+ $this->marketplaceManagerMock = $this->getMock('Magento\Setup\Model\MarketplaceManager', [], [], '', false);
+ $this->packageInfoFactoryMock->expects($this->once())->method('create')->willReturn($this->packageInfo);
+ $this->controller = new ComponentGrid(
+ $this->composerInformationMock,
+ $objectManagerProvider,
+ $this->updatePackagesCacheMock,
+ $this->marketplaceManagerMock
+ );
+ $this->controller->setTimezone($timezoneProviderMock->get());
+ }
+
+ public function testIndexAction()
+ {
+ $viewModel = $this->controller->indexAction();
+ $this->assertInstanceOf('Zend\View\Model\ViewModel', $viewModel);
+ $this->assertTrue($viewModel->terminate());
+ }
+
+ public function testComponentsAction()
+ {
+ $this->fullModuleListMock->expects($this->once())
+ ->method('getNames')
+ ->willReturn(['magento/sample-module1']);
+ $this->packageInfo->expects($this->once())
+ ->method('getModuleName')
+ ->willReturn('Sample_Module');
+ $this->packageInfo->expects($this->exactly(2))
+ ->method('getPackageName')
+ ->willReturn($this->componentData['magento/sample-module-one']['name']);
+ $this->packageInfo->expects($this->exactly(2))
+ ->method('getVersion')
+ ->willReturn($this->componentData['magento/sample-module-one']['version']);
+ $this->enabledModuleListMock->expects($this->once())
+ ->method('has')
+ ->willReturn(true);
+ $this->composerInformationMock->expects($this->once())
+ ->method('getInstalledMagentoPackages')
+ ->willReturn($this->componentData);
+ $this->composerInformationMock->expects($this->once())
+ ->method('isPackageInComposerJson')
+ ->willReturn(true);
+ $this->updatePackagesCacheMock->expects($this->once())
+ ->method('getPackagesForUpdate')
+ ->willReturn($this->lastSyncData);
+ $this->setupTimezoneMock();
+ $jsonModel = $this->controller->componentsAction();
+ $this->assertInstanceOf('Zend\View\Model\JsonModel', $jsonModel);
+ $variables = $jsonModel->getVariables();
+ $this->assertArrayHasKey('success', $variables);
+ $this->assertTrue($variables['success']);
+ $expected = [[
+ 'name' => 'magento/sample-module-one',
+ 'type' => 'magento2-module',
+ 'version' => '1.0.0',
+ 'update' => false,
+ 'uninstall' => true,
+ 'vendor' => 'magento',
+ 'moduleName' => 'Sample_Module',
+ 'enable' => true,
+ 'disable' => false
+ ]];
+ $this->assertEquals($expected, $variables['components']);
+ $this->assertArrayHasKey('total', $variables);
+ $this->assertEquals(1, $variables['total']);
+ $expectedLastSyncData = array_replace($this->lastSyncData, $this->convertedLastSyncDate);
+ $this->assertEquals($expectedLastSyncData, $variables['lastSyncData']);
+ }
+
+ public function testSyncAction()
+ {
+ $this->updatePackagesCacheMock->expects($this->once())
+ ->method('syncPackagesForUpdate');
+ $this->updatePackagesCacheMock->expects($this->once())
+ ->method('getPackagesForUpdate')
+ ->willReturn($this->lastSyncData);
+ $this->setupTimezoneMock();
+ $jsonModel = $this->controller->syncAction();
+ $this->assertInstanceOf('Zend\View\Model\JsonModel', $jsonModel);
+ $variables = $jsonModel->getVariables();
+ $this->assertArrayHasKey('success', $variables);
+ $this->assertTrue($variables['success']);
+ $expectedLastSyncData = array_replace($this->lastSyncData, $this->convertedLastSyncDate);
+ $this->assertEquals($expectedLastSyncData, $variables['lastSyncData']);
+ }
+
+ /**
+ * Prepare the timezone mock to expect calls and return formatted date and time
+ *
+ * @return none
+ */
+ private function setupTimezoneMock()
+ {
+ $this->timezoneMock->expects($this->at(0))
+ ->method('formatDateTime')
+ ->with(
+ $this->isInstanceOf('\DateTime'),
+ \IntlDateFormatter::MEDIUM,
+ \IntlDateFormatter::NONE,
+ null,
+ null,
+ null
+ )->willReturn(self::FORMATTED_DATE);
+ $this->timezoneMock->expects($this->at(1))
+ ->method('formatDateTime')
+ ->with(
+ $this->isInstanceOf('\DateTime'),
+ \IntlDateFormatter::NONE,
+ \IntlDateFormatter::MEDIUM,
+ null,
+ null,
+ null
+ )->willReturn(self::FORMATTED_TIME);
+ }
+}
--- Magento-CE-2.0.5/setup/src/Magento/Setup/Test/Unit/Controller/InstallTest.php 2016-04-27 23:23:14.000000000 -0300
+++ Magento-CE-2.0.6/setup/src/Magento/Setup/Test/Unit/Controller/InstallTest.php 2016-05-16 13:49:31.000000000 -0300
@@ -35,6 +35,11 @@
*/
private $sampleDataState;
+ /**
+ * @var \Magento\Framework\App\DeploymentConfig|\PHPUnit_Framework_MockObject_MockObject
+ */
+ private $deploymentConfig;
+
public function setUp()
{
$this->webLogger = $this->getMock('\Magento\Setup\Model\WebLogger', [], [], '', false);
@@ -42,6 +47,7 @@
$this->installer = $this->getMock('\Magento\Setup\Model\Installer', [], [], '', false);
$this->progressFactory = $this->getMock('\Magento\Setup\Model\Installer\ProgressFactory', [], [], '', false);
$this->sampleDataState = $this->getMock('\Magento\Framework\Setup\SampleData\State', [], [], '', false);
+ $this->deploymentConfig = $this->getMock('\Magento\Framework\App\DeploymentConfig', [], [], '', false);
$installerFactory->expects($this->once())->method('create')->with($this->webLogger)
->willReturn($this->installer);
@@ -51,6 +57,11 @@
$this->progressFactory,
$this->sampleDataState
);
+
+ $deploymentConfigReflection = new \ReflectionClass(get_class($this->controller));
+ $deploymentConfigReflectionProperty = $deploymentConfigReflection->getProperty('deploymentConfig');
+ $deploymentConfigReflectionProperty->setAccessible(true);
+ $deploymentConfigReflectionProperty->setValue($this->controller, $this->deploymentConfig);
}
public function testIndexAction()
@@ -65,6 +76,7 @@
$this->webLogger->expects($this->once())->method('clear');
$this->installer->expects($this->once())->method('install');
$this->installer->expects($this->exactly(2))->method('getInstallInfo');
+ $this->deploymentConfig->expects($this->once())->method('isAvailable')->willReturn(false);
$jsonModel = $this->controller->startAction();
$this->assertInstanceOf('\Zend\View\Model\JsonModel', $jsonModel);
$variables = $jsonModel->getVariables();
@@ -74,9 +86,23 @@
$this->assertTrue($variables['success']);
}
- public function testStartActionException()
+ public function testStartActionPriorInstallException()
+ {
+ $this->webLogger->expects($this->once())->method('clear');
+ $this->installer->expects($this->never())->method('install');
+ $this->installer->expects($this->never())->method('getInstallInfo');
+ $this->deploymentConfig->expects($this->once())->method('isAvailable')->willReturn(true);
+ $jsonModel = $this->controller->startAction();
+ $this->assertInstanceOf('\Zend\View\Model\JsonModel', $jsonModel);
+ $variables = $jsonModel->getVariables();
+ $this->assertArrayHasKey('success', $variables);
+ $this->assertArrayHasKey('messages', $variables);
+ $this->assertFalse($variables['success']);
+ }
+ public function testStartActionInstallException()
{
$this->webLogger->expects($this->once())->method('clear');
+ $this->deploymentConfig->expects($this->once())->method('isAvailable')->willReturn(false);
$this->installer->expects($this->once())->method('install')
->willThrowException($this->getMock('\Exception'));
$jsonModel = $this->controller->startAction();
@@ -87,6 +113,7 @@
{
$this->webLogger->expects($this->once())->method('clear');
$this->webLogger->expects($this->never())->method('logError');
+ $this->deploymentConfig->expects($this->once())->method('isAvailable')->willReturn(false);
$this->installer->method('install');
$this->sampleDataState->expects($this->once())->method('hasError')->willReturn(true);
$jsonModel = $this->controller->startAction();
--- Magento-CE-2.0.5/setup/src/Magento/Setup/Test/Unit/Model/ConfigOptionsListTest.php 1969-12-31 21:00:00.000000000 -0300
+++ Magento-CE-2.0.6/setup/src/Magento/Setup/Test/Unit/Model/ConfigOptionsListTest.php 2016-05-16 13:49:31.000000000 -0300
@@ -0,0 +1,183 @@
+<?php
+/**
+ * Copyright © 2016 Magento. All rights reserved.
+ * See COPYING.txt for license details.
+ */
+
+namespace Magento\Setup\Test\Unit\Model;
+
+use Magento\Setup\Model\ConfigGenerator;
+use Magento\Setup\Model\ConfigOptionsList;
+use Magento\Setup\Validator\DbValidator;
+use Magento\Framework\Config\ConfigOptionsListConstants;
+
+class ConfigOptionsListTest extends \PHPUnit_Framework_TestCase
+{
+ /**
+ * @var ConfigOptionsList
+ */
+ private $object;
+
+ /**
+ * @var ConfigGenerator|\PHPUnit_Framework_MockObject_MockObject
+ */
+ private $generator;
+
+ /**
+ * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Framework\App\DeploymentConfig
+ */
+ private $deploymentConfig;
+
+ /**
+ * @var DbValidator|\PHPUnit_Framework_MockObject_MockObject
+ */
+ private $dbValidator;
+
+ protected function setUp()
+ {
+ $this->generator = $this->getMock('Magento\Setup\Model\ConfigGenerator', [], [], '', false);
+ $this->deploymentConfig = $this->getMock('Magento\Framework\App\DeploymentConfig', [], [], '', false);
+ $this->dbValidator = $this->getMock('Magento\Setup\Validator\DbValidator', [], [], '', false);
+ $this->object = new ConfigOptionsList($this->generator, $this->dbValidator);
+ }
+
+ public function testGetOptions()
+ {
+ $options = $this->object->getOptions();
+ $this->assertInstanceOf('Magento\Framework\Setup\Option\TextConfigOption', $options[0]);
+ $this->assertSame('Encryption key', $options[0]->getDescription());
+ $this->assertInstanceOf('Magento\Framework\Setup\Option\SelectConfigOption', $options[1]);
+ $this->assertSame('Session save handler', $options[1]->getDescription());
+ $this->assertInstanceOf('Magento\Framework\Setup\Option\SelectConfigOption', $options[2]);
+ $this->assertSame('Type of definitions used by Object Manager', $options[2]->getDescription());
+ $this->assertInstanceOf('Magento\Framework\Setup\Option\TextConfigOption', $options[3]);
+ $this->assertSame('Database server host', $options[3]->getDescription());
+ $this->assertInstanceOf('Magento\Framework\Setup\Option\TextConfigOption', $options[4]);
+ $this->assertSame('Database name', $options[4]->getDescription());
+ $this->assertInstanceOf('Magento\Framework\Setup\Option\TextConfigOption', $options[5]);
+ $this->assertSame('Database server username', $options[5]->getDescription());
+ $this->assertInstanceOf('Magento\Framework\Setup\Option\TextConfigOption', $options[6]);
+ $this->assertSame('Database server engine', $options[6]->getDescription());
+ $this->assertInstanceOf('Magento\Framework\Setup\Option\TextConfigOption', $options[7]);
+ $this->assertSame('Database server password', $options[7]->getDescription());
+ $this->assertInstanceOf('Magento\Framework\Setup\Option\TextConfigOption', $options[8]);
+ $this->assertSame('Database table prefix', $options[8]->getDescription());
+ $this->assertInstanceOf('Magento\Framework\Setup\Option\TextConfigOption', $options[9]);
+ $this->assertSame('Database type', $options[9]->getDescription());
+ $this->assertInstanceOf('Magento\Framework\Setup\Option\TextConfigOption', $options[10]);
+ $this->assertSame('Database initial set of commands', $options[10]->getDescription());
+ $this->assertInstanceOf('Magento\Framework\Setup\Option\FlagConfigOption', $options[11]);
+ $this->assertSame(
+ 'If specified, then db connection validation will be skipped',
+ $options[11]->getDescription()
+ );
+ $this->assertInstanceOf('Magento\Framework\Setup\Option\TextConfigOption', $options[12]);
+ $this->assertSame('http Cache hosts', $options[12]->getDescription());
+ $this->assertEquals(13, count($options));
+ }
+
+ public function testCreateOptions()
+ {
+ $configDataMock = $this->getMock('Magento\Framework\Config\Data\ConfigData', [], [], '', false);
+ $this->generator->expects($this->once())->method('createCryptConfig')->willReturn($configDataMock);
+ $this->generator->expects($this->once())->method('createSessionConfig')->willReturn($configDataMock);
+ $this->generator->expects($this->once())->method('createDefinitionsConfig')->willReturn($configDataMock);
+ $this->generator->expects($this->once())->method('createDbConfig')->willReturn($configDataMock);
+ $this->generator->expects($this->once())->method('createResourceConfig')->willReturn($configDataMock);
+ $this->generator->expects($this->once())->method('createXFrameConfig')->willReturn($configDataMock);
+ $this->generator->expects($this->once())->method('createCacheHostsConfig')->willReturn($configDataMock);
+ $configData = $this->object->createConfig([], $this->deploymentConfig);
+ $this->assertEquals(8, count($configData));
+ }
+
+ public function testCreateOptionsWithOptionalNull()
+ {
+ $configDataMock = $this->getMock('Magento\Framework\Config\Data\ConfigData', [], [], '', false);
+ $this->generator->expects($this->once())->method('createCryptConfig')->willReturn($configDataMock);
+ $this->generator->expects($this->once())->method('createSessionConfig')->willReturn($configDataMock);
+ $this->generator->expects($this->once())->method('createDefinitionsConfig')->willReturn(null);
+ $this->generator->expects($this->once())->method('createDbConfig')->willReturn($configDataMock);
+ $this->generator->expects($this->once())->method('createResourceConfig')->willReturn($configDataMock);
+ $this->generator->expects($this->once())->method('createXFrameConfig')->willReturn($configDataMock);
+ $this->generator->expects($this->once())->method('createCacheHostsConfig')->willReturn($configDataMock);
+ $configData = $this->object->createConfig([], $this->deploymentConfig);
+ $this->assertEquals(7, count($configData));
+ }
+
+ public function testValidateSuccess()
+ {
+ $options = [
+ ConfigOptionsListConstants::INPUT_KEY_DB_PREFIX => 'prefix',
+ ConfigOptionsListConstants::INPUT_KEY_SESSION_SAVE => 'files',
+ ConfigOptionsListConstants::INPUT_KEY_SKIP_DB_VALIDATION => false,
+ ConfigOptionsListConstants::INPUT_KEY_DB_NAME => 'name',
+ ConfigOptionsListConstants::INPUT_KEY_DB_HOST => 'host',
+ ConfigOptionsListConstants::INPUT_KEY_DB_USER => 'user',
+ ConfigOptionsListConstants::INPUT_KEY_DB_PASSWORD => 'pass'
+ ];
+ $this->prepareValidationMocks();
+ $this->assertEquals([], $this->object->validate($options, $this->deploymentConfig));
+ }
+
+ public function testValidateInvalidSessionHandler()
+ {
+ $invalidSaveHandler = 'clay-tablet';
+
+ $options = [
+ ConfigOptionsListConstants::INPUT_KEY_DB_PREFIX => 'prefix',
+ ConfigOptionsListConstants::INPUT_KEY_SESSION_SAVE => $invalidSaveHandler,
+ ConfigOptionsListConstants::INPUT_KEY_SKIP_DB_VALIDATION => false,
+ ConfigOptionsListConstants::INPUT_KEY_DB_NAME => 'name',
+ ConfigOptionsListConstants::INPUT_KEY_DB_HOST => 'host',
+ ConfigOptionsListConstants::INPUT_KEY_DB_USER => 'user',
+ ConfigOptionsListConstants::INPUT_KEY_DB_PASSWORD => 'pass'
+ ];
+ $this->prepareValidationMocks();
+ $this->assertEquals(
+ ["Invalid session handler '$invalidSaveHandler'"],
+ $this->object->validate($options, $this->deploymentConfig)
+ );
+ }
+
+ private function prepareValidationMocks()
+ {
+ $configDataMock = $this->getMockBuilder('Magento\Framework\Config\Data\ConfigData')
+ ->disableOriginalConstructor()
+ ->getMock();
+ $this->dbValidator->expects($this->once())->method('checkDatabaseTablePrefix')->willReturn($configDataMock);
+ $this->dbValidator->expects($this->once())->method('checkDatabaseConnection')->willReturn($configDataMock);
+ }
+
+ /**
+ * @param string $hosts
+ * @param bool $expectedError
+ * @dataProvider validateCacheHostsDataProvider
+ */
+ public function testValidateCacheHosts($hosts, $expectedError)
+ {
+ $options = [
+ ConfigOptionsListConstants::INPUT_KEY_SKIP_DB_VALIDATION => true,
+ ConfigOptionsListConstants::INPUT_KEY_CACHE_HOSTS => $hosts
+ ];
+ $result = $this->object->validate($options, $this->deploymentConfig);
+ if ($expectedError) {
+ $this->assertCount(1, $result);
+ $this->assertEquals("Invalid http cache hosts '$hosts'", $result[0]);
+ } else {
+ $this->assertCount(0, $result);
+ }
+
+ }
+
+ public function validateCacheHostsDataProvider()
+ {
+ return [
+ ['localhost', false],
+ ['122.11.2.34:800', false],
+ ['122.11.2.34:800,localhost', false],
+ ['website.com:9000', false],
+ ['website.com/m2ce:9000', true],
+ ['website.com+:9000', true],
+ ];
+ }
+}
--- Magento-CE-2.0.5/setup/src/Magento/Setup/Test/Unit/Model/DateTime/DateTimeProviderTest.php 1969-12-31 21:00:00.000000000 -0300
+++ Magento-CE-2.0.6/setup/src/Magento/Setup/Test/Unit/Model/DateTime/DateTimeProviderTest.php 2016-05-16 13:49:31.000000000 -0300
@@ -0,0 +1,41 @@
+<?php
+/**
+ * Copyright © 2016 Magento. All rights reserved.
+ * See COPYING.txt for license details.
+ */
+namespace Magento\Setup\Test\Unit\Model\DateTime;
+
+use Magento\Setup\Model\DateTime\DateTimeProvider;
+use Magento\Setup\Model\DateTime\TimezoneProvider;
+use Magento\Setup\Model\ObjectManagerProvider;
+
+class DateTimeProviderTest extends \PHPUnit_Framework_TestCase
+{
+ public function testGet()
+ {
+ $dateTime = $this->getMock('\Magento\Framework\Stdlib\DateTime\DateTime', [], [], '', false);
+ /** @var TimezoneProvider|\PHPUnit_Framework_MockObject_MockObject $timeZoneProvider */
+ $timeZoneProvider = $this->getMock('\Magento\Setup\Model\DateTime\TimezoneProvider', [], [], '', false);
+ $timeZone = $this->getMock('\Magento\Framework\Stdlib\DateTime\Timezone', [], [], '', false);
+ $timeZoneProvider->expects($this->any())
+ ->method('get')
+ ->willReturn($timeZone);
+ $objectManager = $this->getMockForAbstractClass('\Magento\Framework\ObjectManagerInterface', [], '', false);
+ $objectManager->expects($this->once())
+ ->method('create')
+ ->with(
+ 'Magento\Framework\Stdlib\DateTime\DateTime',
+ ['localeDate' => $timeZone]
+ )
+ ->willReturn($dateTime);
+ /** @var ObjectManagerProvider|\PHPUnit_Framework_MockObject_MockObject $objectManagerProvider */
+ $objectManagerProvider = $this->getMock('\Magento\Setup\Model\ObjectManagerProvider', [], [], '', false);
+ $objectManagerProvider->expects($this->any())
+ ->method('get')
+ ->willReturn($objectManager);
+ $object = new DateTimeProvider($timeZoneProvider, $objectManagerProvider);
+ $this->assertSame($dateTime, $object->get());
+ // Assert that the provider always returns the same object
+ $this->assertSame($dateTime, $object->get());
+ }
+}
--- Magento-CE-2.0.5/setup/src/Magento/Setup/Test/Unit/Model/DateTime/TimezoneProviderTest.php 1969-12-31 21:00:00.000000000 -0300
+++ Magento-CE-2.0.6/setup/src/Magento/Setup/Test/Unit/Model/DateTime/TimezoneProviderTest.php 2016-05-16 13:49:31.000000000 -0300
@@ -0,0 +1,35 @@
+<?php
+/**
+ * Copyright © 2016 Magento. All rights reserved.
+ * See COPYING.txt for license details.
+ */
+namespace Magento\Setup\Test\Unit\Model\DateTime;
+
+use Magento\Framework\App\Config\ScopeConfigInterface;
+use Magento\Setup\Model\DateTime\TimezoneProvider;
+use Magento\Setup\Model\ObjectManagerProvider;
+
+class TimezoneProviderTest extends \PHPUnit_Framework_TestCase
+{
+ public function testGet()
+ {
+ $timeZone = $this->getMock('\Magento\Framework\Stdlib\DateTime\Timezone', [], [], '', false);
+ $objectManager = $this->getMockForAbstractClass('\Magento\Framework\ObjectManagerInterface', [], '', false);
+ $objectManager->expects($this->once())
+ ->method('create')
+ ->with(
+ 'Magento\Framework\Stdlib\DateTime\Timezone',
+ ['scopeType' => ScopeConfigInterface::SCOPE_TYPE_DEFAULT]
+ )
+ ->willReturn($timeZone);
+ /** @var ObjectManagerProvider|\PHPUnit_Framework_MockObject_MockObject $objectManagerProvider */
+ $objectManagerProvider = $this->getMock('\Magento\Setup\Model\ObjectManagerProvider', [], [], '', false);
+ $objectManagerProvider->expects($this->any())
+ ->method('get')
+ ->willReturn($objectManager);
+ $object = new TimezoneProvider($objectManagerProvider);
+ $this->assertSame($timeZone, $object->get());
+ // Assert that the provider always returns the same object
+ $this->assertSame($timeZone, $object->get());
+ }
+}
--- Magento-CE-2.0.5/setup/src/Magento/Setup/Test/Unit/Model/InstallerTest.php 2016-04-27 23:23:14.000000000 -0300
+++ Magento-CE-2.0.6/setup/src/Magento/Setup/Test/Unit/Model/InstallerTest.php 2016-05-16 13:49:31.000000000 -0300
@@ -233,7 +233,14 @@
ConfigOptionsListConstants::INPUT_KEY_ENCRYPTION_KEY => 'encryption_key',
ConfigOptionsList::INPUT_KEY_BACKEND_FRONTNAME => 'backend',
];
- $this->config->expects($this->atLeastOnce())->method('isAvailable')->willReturn(true);
+ $this->config->expects($this->atLeastOnce())
+ ->method('get')
+ ->willReturnMap(
+ [
+ [ConfigOptionsListConstants::CONFIG_PATH_DB_CONNECTION_DEFAULT, null, true],
+ [ConfigOptionsListConstants::CONFIG_PATH_CRYPT_KEY, null, true],
+ ]
+ );
$allModules = ['Foo_One' => [], 'Bar_Two' => []];
$this->moduleLoader->expects($this->any())->method('load')->willReturn($allModules);
$setup = $this->getMock('Magento\Setup\Module\Setup', [], [], '', false);
@@ -296,8 +303,9 @@
$this->logger->expects($this->at(34))->method('log')->with('Caches clearing:');
$this->logger->expects($this->at(37))->method('log')->with('Disabling Maintenance Mode:');
$this->logger->expects($this->at(39))->method('log')->with('Post installation file permissions check...');
- $this->logger->expects($this->at(41))->method('logSuccess')->with('Magento installation complete.');
- $this->logger->expects($this->at(43))->method('log')
+ $this->logger->expects($this->at(41))->method('log')->with('Write installation date...');
+ $this->logger->expects($this->at(43))->method('logSuccess')->with('Magento installation complete.');
+ $this->logger->expects($this->at(45))->method('log')
->with('Sample Data is installed with errors. See log file for details');
$this->object->install($request);
}
@@ -368,7 +376,6 @@
public function testUninstall()
{
- $this->config->expects($this->once())->method('isAvailable')->willReturn(false);
$this->configReader->expects($this->once())->method('getFiles')->willReturn(['ConfigOne.php', 'ConfigTwo.php']);
$configDir = $this->getMockForAbstractClass('Magento\Framework\Filesystem\Directory\WriteInterface');
$configDir
@@ -433,7 +440,6 @@
public function testCleanupDb()
{
- $this->config->expects($this->once())->method('isAvailable')->willReturn(true);
$this->config->expects($this->once())
->method('get')
->with(ConfigOptionsListConstants::CONFIG_PATH_DB_CONNECTION_DEFAULT)
@@ -452,7 +458,6 @@
*/
private function prepareForUpdateModulesTests()
{
-
$allModules = [
'Foo_One' => [],
'Bar_Two' => [],
@@ -479,7 +484,10 @@
]
];
- $this->config->expects($this->atLeastOnce())->method('isAvailable')->willReturn(true);
+ $this->config->expects($this->atLeastOnce())
+ ->method('get')
+ ->with(ConfigOptionsListConstants::KEY_MODULES)
+ ->willReturn(true);
$newObject = $this->createObject(false, false);
$this->configReader->expects($this->once())->method('load')
--- Magento-CE-2.0.5/setup/src/Magento/Setup/Test/Unit/Module/ConfigGeneratorTest.php 2016-04-27 23:23:14.000000000 -0300
+++ Magento-CE-2.0.6/setup/src/Magento/Setup/Test/Unit/Module/ConfigGeneratorTest.php 2016-05-16 13:49:31.000000000 -0300
@@ -25,13 +25,6 @@
$this->configGeneratorObject = new ConfigGenerator($random, $deployConfig);
}
- public function testCreateInstallConfig()
- {
- $returnValue = $this->configGeneratorObject->createInstallConfig([]);
- $this->assertInstanceOf('Magento\Framework\Config\Data\ConfigData', $returnValue);
- $this->assertEquals(ConfigFilePool::APP_ENV, $returnValue->getFileKey());
- }
-
public function testCreateCryptConfigWithInput()
{
$testData = [ConfigOptionsListConstants::INPUT_KEY_ENCRYPTION_KEY => 'some-test_key'];
@@ -47,6 +40,16 @@
$this->assertEquals(['crypt' => ['key' => md5('key')]], $returnValue->getData());
}
+ /**
+ * @deprecated
+ */
+ public function testCreateInstallConfig()
+ {
+ $returnValue = $this->configGeneratorObject->createInstallConfig([]);
+ $this->assertInstanceOf('Magento\Framework\Config\Data\ConfigData', $returnValue);
+ $this->assertEquals(ConfigFilePool::APP_ENV, $returnValue->getFileKey());
+ }
+
public function testCreateSessionConfigWithInput()
{
$testData = [ConfigOptionsListConstants::INPUT_KEY_SESSION_SAVE => 'files'];
--- Magento-CE-2.0.5/setup/src/Magento/Setup/Test/Unit/Module/ConfigOptionsListTest.php 2016-04-27 23:23:14.000000000 -0300
+++ Magento-CE-2.0.6/setup/src/Magento/Setup/Test/Unit/Module/ConfigOptionsListTest.php 1969-12-31 21:00:00.000000000 -0300
@@ -1,185 +0,0 @@
-<?php
-/**
- * Copyright © 2016 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-
-namespace Magento\Setup\Test\Unit\Module;
-
-use Magento\Setup\Model\ConfigGenerator;
-use Magento\Setup\Model\ConfigOptionsList;
-use Magento\Setup\Validator\DbValidator;
-use Magento\Framework\Config\ConfigOptionsListConstants;
-
-class ConfigOptionsListTest extends \PHPUnit_Framework_TestCase
-{
- /**
- * @var ConfigOptionsList
- */
- private $object;
-
- /**
- * @var ConfigGenerator|\PHPUnit_Framework_MockObject_MockObject
- */
- private $generator;
-
- /**
- * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Framework\App\DeploymentConfig
- */
- private $deploymentConfig;
-
- /**
- * @var DbValidator|\PHPUnit_Framework_MockObject_MockObject
- */
- private $dbValidator;
-
- protected function setUp()
- {
- $this->generator = $this->getMock('Magento\Setup\Model\ConfigGenerator', [], [], '', false);
- $this->deploymentConfig = $this->getMock('Magento\Framework\App\DeploymentConfig', [], [], '', false);
- $this->dbValidator = $this->getMock('Magento\Setup\Validator\DbValidator', [], [], '', false);
- $this->object = new ConfigOptionsList($this->generator, $this->dbValidator);
- }
-
- public function testGetOptions()
- {
- $options = $this->object->getOptions();
- $this->assertInstanceOf('Magento\Framework\Setup\Option\TextConfigOption', $options[0]);
- $this->assertSame('Encryption key', $options[0]->getDescription());
- $this->assertInstanceOf('Magento\Framework\Setup\Option\SelectConfigOption', $options[1]);
- $this->assertSame('Session save handler', $options[1]->getDescription());
- $this->assertInstanceOf('Magento\Framework\Setup\Option\SelectConfigOption', $options[2]);
- $this->assertSame('Type of definitions used by Object Manager', $options[2]->getDescription());
- $this->assertInstanceOf('Magento\Framework\Setup\Option\TextConfigOption', $options[3]);
- $this->assertSame('Database server host', $options[3]->getDescription());
- $this->assertInstanceOf('Magento\Framework\Setup\Option\TextConfigOption', $options[4]);
- $this->assertSame('Database name', $options[4]->getDescription());
- $this->assertInstanceOf('Magento\Framework\Setup\Option\TextConfigOption', $options[5]);
- $this->assertSame('Database server username', $options[5]->getDescription());
- $this->assertInstanceOf('Magento\Framework\Setup\Option\TextConfigOption', $options[6]);
- $this->assertSame('Database server engine', $options[6]->getDescription());
- $this->assertInstanceOf('Magento\Framework\Setup\Option\TextConfigOption', $options[7]);
- $this->assertSame('Database server password', $options[7]->getDescription());
- $this->assertInstanceOf('Magento\Framework\Setup\Option\TextConfigOption', $options[8]);
- $this->assertSame('Database table prefix', $options[8]->getDescription());
- $this->assertInstanceOf('Magento\Framework\Setup\Option\TextConfigOption', $options[9]);
- $this->assertSame('Database type', $options[9]->getDescription());
- $this->assertInstanceOf('Magento\Framework\Setup\Option\TextConfigOption', $options[10]);
- $this->assertSame('Database initial set of commands', $options[10]->getDescription());
- $this->assertInstanceOf('Magento\Framework\Setup\Option\FlagConfigOption', $options[11]);
- $this->assertSame(
- 'If specified, then db connection validation will be skipped',
- $options[11]->getDescription()
- );
- $this->assertInstanceOf('Magento\Framework\Setup\Option\TextConfigOption', $options[12]);
- $this->assertSame('http Cache hosts', $options[12]->getDescription());
- $this->assertEquals(13, count($options));
- }
-
- public function testCreateOptions()
- {
- $configDataMock = $this->getMock('Magento\Framework\Config\Data\ConfigData', [], [], '', false);
- $this->generator->expects($this->once())->method('createInstallConfig')->willReturn($configDataMock);
- $this->generator->expects($this->once())->method('createCryptConfig')->willReturn($configDataMock);
- $this->generator->expects($this->once())->method('createSessionConfig')->willReturn($configDataMock);
- $this->generator->expects($this->once())->method('createDefinitionsConfig')->willReturn($configDataMock);
- $this->generator->expects($this->once())->method('createDbConfig')->willReturn($configDataMock);
- $this->generator->expects($this->once())->method('createResourceConfig')->willReturn($configDataMock);
- $this->generator->expects($this->once())->method('createXFrameConfig')->willReturn($configDataMock);
- $this->generator->expects($this->once())->method('createCacheHostsConfig')->willReturn($configDataMock);
- $configData = $this->object->createConfig([], $this->deploymentConfig);
- $this->assertEquals(9, count($configData));
- }
-
- public function testCreateOptionsWithOptionalNull()
- {
- $configDataMock = $this->getMock('Magento\Framework\Config\Data\ConfigData', [], [], '', false);
- $this->generator->expects($this->once())->method('createInstallConfig')->willReturn($configDataMock);
- $this->generator->expects($this->once())->method('createCryptConfig')->willReturn($configDataMock);
- $this->generator->expects($this->once())->method('createSessionConfig')->willReturn($configDataMock);
- $this->generator->expects($this->once())->method('createDefinitionsConfig')->willReturn(null);
- $this->generator->expects($this->once())->method('createDbConfig')->willReturn($configDataMock);
- $this->generator->expects($this->once())->method('createResourceConfig')->willReturn($configDataMock);
- $this->generator->expects($this->once())->method('createXFrameConfig')->willReturn($configDataMock);
- $this->generator->expects($this->once())->method('createCacheHostsConfig')->willReturn($configDataMock);
- $configData = $this->object->createConfig([], $this->deploymentConfig);
- $this->assertEquals(8, count($configData));
- }
-
- public function testValidateSuccess()
- {
- $options = [
- ConfigOptionsListConstants::INPUT_KEY_DB_PREFIX => 'prefix',
- ConfigOptionsListConstants::INPUT_KEY_SESSION_SAVE => 'files',
- ConfigOptionsListConstants::INPUT_KEY_SKIP_DB_VALIDATION => false,
- ConfigOptionsListConstants::INPUT_KEY_DB_NAME => 'name',
- ConfigOptionsListConstants::INPUT_KEY_DB_HOST => 'host',
- ConfigOptionsListConstants::INPUT_KEY_DB_USER => 'user',
- ConfigOptionsListConstants::INPUT_KEY_DB_PASSWORD => 'pass'
- ];
- $this->prepareValidationMocks();
- $this->assertEquals([], $this->object->validate($options, $this->deploymentConfig));
- }
-
- public function testValidateInvalidSessionHandler()
- {
- $invalidSaveHandler = 'clay-tablet';
-
- $options = [
- ConfigOptionsListConstants::INPUT_KEY_DB_PREFIX => 'prefix',
- ConfigOptionsListConstants::INPUT_KEY_SESSION_SAVE => $invalidSaveHandler,
- ConfigOptionsListConstants::INPUT_KEY_SKIP_DB_VALIDATION => false,
- ConfigOptionsListConstants::INPUT_KEY_DB_NAME => 'name',
- ConfigOptionsListConstants::INPUT_KEY_DB_HOST => 'host',
- ConfigOptionsListConstants::INPUT_KEY_DB_USER => 'user',
- ConfigOptionsListConstants::INPUT_KEY_DB_PASSWORD => 'pass'
- ];
- $this->prepareValidationMocks();
- $this->assertEquals(
- ["Invalid session handler '$invalidSaveHandler'"],
- $this->object->validate($options, $this->deploymentConfig)
- );
- }
-
- private function prepareValidationMocks()
- {
- $configDataMock = $this->getMockBuilder('Magento\Framework\Config\Data\ConfigData')
- ->disableOriginalConstructor()
- ->getMock();
- $this->dbValidator->expects($this->once())->method('checkDatabaseTablePrefix')->willReturn($configDataMock);
- $this->dbValidator->expects($this->once())->method('checkDatabaseConnection')->willReturn($configDataMock);
- }
-
- /**
- * @param string $hosts
- * @param bool $expectedError
- * @dataProvider validateCacheHostsDataProvider
- */
- public function testValidateCacheHosts($hosts, $expectedError)
- {
- $options = [
- ConfigOptionsListConstants::INPUT_KEY_SKIP_DB_VALIDATION => true,
- ConfigOptionsListConstants::INPUT_KEY_CACHE_HOSTS => $hosts
- ];
- $result = $this->object->validate($options, $this->deploymentConfig);
- if ($expectedError) {
- $this->assertCount(1, $result);
- $this->assertEquals("Invalid http cache hosts '$hosts'", $result[0]);
- } else {
- $this->assertCount(0, $result);
- }
-
- }
-
- public function validateCacheHostsDataProvider()
- {
- return [
- ['localhost', false],
- ['122.11.2.34:800', false],
- ['122.11.2.34:800,localhost', false],
- ['website.com:9000', false],
- ['website.com/m2ce:9000', true],
- ['website.com+:9000', true],
- ];
- }
-}
--- Magento-CE-2.0.5/update/app/code/Magento/Update/CronReadinessCheck.php 2016-04-28 06:15:02.000000000 -0300
+++ Magento-CE-2.0.6/update/app/code/Magento/Update/CronReadinessCheck.php 2016-05-16 20:18:24.000000000 -0300
@@ -26,6 +26,18 @@
/**#@-*/
/**
+ * Setup cron job status file name
+ */
+ const SETUP_CRON_JOB_STATUS_FILE = '.setup_cronjob_status';
+
+ /**#@+
+ * Keys from .setup_cronjob_status file
+ */
+ const KEY_FILE_PATHS = 'file_paths';
+ const KEY_LIST = 'list';
+ /**#@-*/
+
+ /**
* Run Cron job readiness check
*
* @return bool
@@ -35,12 +47,21 @@
$resultJsonRawData = ['readiness_checks' => []];
$success = true;
- $nonWritablePaths = $this->checkPermissionsRecursively();
+ $permissionInfo = $this->checkPermissionsRecursively();
- if (!empty($nonWritablePaths)) {
+ if ($permissionInfo->containsPaths())
+ {
+ $error = '';
+ if (!empty($permissionInfo->getNonWritablePaths())) {
+ $error .= '<br/>Found non-writable path(s):<br/>' .
+ implode('<br/>', $permissionInfo->getNonWritablePaths());
+ }
+ if (!empty($permissionInfo->getNonReadablePaths())) {
+ $error .= '<br/>Found non-readable path(s):<br/>' .
+ implode('<br/>', $permissionInfo->getNonReadablePaths());
+ }
+ $resultJsonRawData[self::KEY_READINESS_CHECKS][self::KEY_ERROR] = $error;
$resultJsonRawData[self::KEY_READINESS_CHECKS][self::KEY_FILE_PERMISSIONS_VERIFIED] = false;
- $resultJsonRawData[self::KEY_READINESS_CHECKS][self::KEY_ERROR] =
- 'Found non-writable path(s):<br/>' . implode('<br/>', $nonWritablePaths);
$success = false;
} else {
$resultJsonRawData[self::KEY_READINESS_CHECKS][self::KEY_FILE_PERMISSIONS_VERIFIED] = true;
@@ -63,13 +84,31 @@
/**
* Check file permissions recursively
*
- * @return string[]
+ * @return PermissionInfo
*/
private function checkPermissionsRecursively()
{
+ // For backward compatibility, initialize the list wth magento root directory.
+ $dirAndFileList[] = '';
+
+ // Get the list of magento specific directories and files
+ $setupCronJobStatusFilePath = MAGENTO_BP . '/var/' . self::SETUP_CRON_JOB_STATUS_FILE;
+ if (is_readable($setupCronJobStatusFilePath)) {
+ $fileContents = json_decode(file_get_contents($setupCronJobStatusFilePath), true);
+
+ if (isset($fileContents[self::KEY_FILE_PATHS][self::KEY_LIST])) {
+ $dirAndFileList = $fileContents[self::KEY_FILE_PATHS][self::KEY_LIST];
+ }
+ }
+
$nonWritablePaths = [];
+ $nonReadablePaths = [];
+ foreach ($dirAndFileList as $path) {
+ $path = MAGENTO_BP . '/' . $path;
+ if (is_dir($path)) {
+ try {
$filesystemIterator = new \RecursiveIteratorIterator(
- new \RecursiveDirectoryIterator(MAGENTO_BP),
+ new \RecursiveDirectoryIterator($path),
\RecursiveIteratorIterator::SELF_FIRST
);
$filesystemIterator = new ExcludeFilter(
@@ -87,6 +126,15 @@
$nonWritablePaths[] = $path;
}
}
- return $nonWritablePaths;
+ } catch (\UnexpectedValueException $e) {
+ $nonReadablePaths[] = $path;
+ }
+ } else {
+ if (!is_writable($path)) {
+ $nonWritablePaths[] = $path;
+ }
+ }
+ }
+ return new PermissionInfo($nonWritablePaths, $nonReadablePaths);
}
}
--- Magento-CE-2.0.5/update/app/code/Magento/Update/PermissionInfo.php 1969-12-31 21:00:00.000000000 -0300
+++ Magento-CE-2.0.6/update/app/code/Magento/Update/PermissionInfo.php 2016-05-16 20:18:24.000000000 -0300
@@ -0,0 +1,59 @@
+<?php
+/**
+ * Copyright © 2016 Magento. All rights reserved.
+ * See COPYING.txt for license details.
+ */
+namespace Magento\Update;
+
+/**
+ * Class PermissionInfo
+ *
+ * Data object for returning lists of non-writable, non-readable paths found by cron readiness permission's check
+ */
+class PermissionInfo
+{
+
+ /** @var string[] */
+ private $nonWritablePaths;
+
+ /** @var string[] */
+ private $nonReadablePaths;
+
+ /**
+ * PermissionInfo constructor.
+ *
+ * @param string[] $nonWritablePaths List of paths which are not writable
+ * @param string[] $nonReadablePaths List of paths which are not readable
+ */
+ public function __construct($nonWritablePaths, $nonReadablePaths)
+ {
+ $this->nonWritablePaths = $nonWritablePaths;
+ $this->nonReadablePaths = $nonReadablePaths;
+ }
+
+ /**
+ * Get array of non-writable paths
+ *
+ * @return \string[]
+ */
+ public function getNonWritablePaths() {
+ return $this->nonWritablePaths;
+ }
+
+ /**
+ * Get array of non-readable paths
+ *
+ * @return \string[]
+ */
+ public function getNonReadablePaths() {
+ return $this->nonReadablePaths;
+ }
+
+ /**
+ * See if there are any non-writable or non-readable
+ * @return bool
+ */
+ public function containsPaths() {
+ return !empty($this->nonWritablePaths) || !empty($this->nonReadablePaths);
+ }
+}
\ No hay ningún carácter de nueva línea al final del archivo
--- Magento-CE-2.0.5/update/cron.php 2016-04-28 06:15:02.000000000 -0300
+++ Magento-CE-2.0.6/update/cron.php 2016-05-16 20:18:24.000000000 -0300
@@ -10,15 +10,15 @@
$cronReadinessChecker = new \Magento\Update\CronReadinessCheck();
if (!$cronReadinessChecker->runReadinessCheck()) {
- exit('Cron readiness check failed');
+ exit('Cron readiness check failed' . PHP_EOL);
}
if ($status->isUpdateInProgress()) {
- exit('Cron is already in progress...');
+ exit('Cron is already in progress...' . PHP_EOL);
}
if ($status->isUpdateError()) {
- exit('There was an error in previous Updater jobs...');
+ exit('There was an error in previous Updater jobs...' . PHP_EOL);
}
$backupDirectory = BACKUP_DIR;
--- Magento-CE-2.0.5/update/dev/tests/integration/testsuite/Magento/Update/CronReadinessCheckTest.php 2016-04-28 06:15:02.000000000 -0300
+++ Magento-CE-2.0.6/update/dev/tests/integration/testsuite/Magento/Update/CronReadinessCheckTest.php 2016-05-16 20:18:24.000000000 -0300
@@ -71,10 +71,14 @@
return true;
}
-function file_get_contents()
+function file_get_contents($filename)
{
+ if ($filename === MAGENTO_BP . '/var/' . CronReadinessCheck::SETUP_CRON_JOB_STATUS_FILE) {
+ return json_encode([CronReadinessCheck::KEY_FILE_PATHS => [CronReadinessCheck::KEY_LIST => [__FILE__]]]);
+ } else {
return json_encode([CronReadinessCheck::KEY_CURRENT_TIMESTAMP => 150]);
}
+}
function is_writable()
{
--- Magento-CE-2.0.5/update/vendor/autoload.php 2016-04-28 06:15:02.000000000 -0300
+++ Magento-CE-2.0.6/update/vendor/autoload.php 2016-05-16 20:18:24.000000000 -0300
@@ -4,4 +4,4 @@
require_once __DIR__ . '/composer' . '/autoload_real.php';
-return ComposerAutoloaderInit130d3cdd0bff2c206483eba27bffd611::getLoader();
+return ComposerAutoloaderInit1f7a59188c2a6a5bfa8db0185ea358b2::getLoader();
--- Magento-CE-2.0.5/update/vendor/composer/autoload_real.php 2016-04-28 06:15:02.000000000 -0300
+++ Magento-CE-2.0.6/update/vendor/composer/autoload_real.php 2016-05-16 20:18:24.000000000 -0300
@@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer
-class ComposerAutoloaderInit130d3cdd0bff2c206483eba27bffd611
+class ComposerAutoloaderInit1f7a59188c2a6a5bfa8db0185ea358b2
{
private static $loader;
@@ -19,9 +19,9 @@
return self::$loader;
}
- spl_autoload_register(array('ComposerAutoloaderInit130d3cdd0bff2c206483eba27bffd611', 'loadClassLoader'), true, true);
+ spl_autoload_register(array('ComposerAutoloaderInit1f7a59188c2a6a5bfa8db0185ea358b2', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
- spl_autoload_unregister(array('ComposerAutoloaderInit130d3cdd0bff2c206483eba27bffd611', 'loadClassLoader'));
+ spl_autoload_unregister(array('ComposerAutoloaderInit1f7a59188c2a6a5bfa8db0185ea358b2', 'loadClassLoader'));
$map = require __DIR__ . '/autoload_namespaces.php';
foreach ($map as $namespace => $path) {
--- Magento-CE-2.0.5/vendor/autoload.php 2016-04-27 23:23:12.000000000 -0300
+++ Magento-CE-2.0.6/vendor/autoload.php 2016-05-16 13:49:29.000000000 -0300
@@ -4,4 +4,4 @@
require_once __DIR__ . '/composer' . '/autoload_real.php';
-return ComposerAutoloaderInit51d8e4e0d25132bf74ae7fd9905edadb::getLoader();
+return ComposerAutoloaderInit9c500efd4dbc15ca27cc77bd51919bc2::getLoader();
--- Magento-CE-2.0.5/vendor/colinmollenhour/credis/Client.php 1969-12-31 21:00:00.000000000 -0300
+++ Magento-CE-2.0.6/vendor/colinmollenhour/credis/Client.php 2015-11-27 22:20:04.000000000 -0300
@@ -0,0 +1,1283 @@
+<?php
+/**
+ * Credis_Client (a fork of Redisent)
+ *
+ * Most commands are compatible with phpredis library:
+ * - use "pipeline()" to start a pipeline of commands instead of multi(Redis::PIPELINE)
+ * - any arrays passed as arguments will be flattened automatically
+ * - setOption and getOption are not supported in standalone mode
+ * - order of arguments follows redis-cli instead of phpredis where they differ (lrem)
+ *
+ * - Uses phpredis library if extension is installed for better performance.
+ * - Establishes connection lazily.
+ * - Supports tcp and unix sockets.
+ * - Reconnects automatically unless a watch or transaction is in progress.
+ * - Can set automatic retry connection attempts for iffy Redis connections.
+ *
+ * @author Colin Mollenhour <colin@mollenhour.com>
+ * @copyright 2011 Colin Mollenhour <colin@mollenhour.com>
+ * @license http://www.opensource.org/licenses/mit-license.php The MIT License
+ * @package Credis_Client
+ */
+
+if( ! defined('CRLF')) define('CRLF', sprintf('%s%s', chr(13), chr(10)));
+
+/**
+ * Credis-specific errors, wraps native Redis errors
+ */
+class CredisException extends Exception
+{
+
+ const CODE_TIMED_OUT = 1;
+ const CODE_DISCONNECTED = 2;
+
+ public function __construct($message, $code = 0, $exception = NULL)
+ {
+ if ($exception && get_class($exception) == 'RedisException' && $message == 'read error on connection') {
+ $code = CredisException::CODE_DISCONNECTED;
+ }
+ parent::__construct($message, $code, $exception);
+ }
+
+}
+
+/**
+ * Credis_Client, a lightweight Redis PHP standalone client and phpredis wrapper
+ *
+ * Server/Connection:
+ * @method Credis_Client pipeline()
+ * @method Credis_Client multi()
+ * @method array exec()
+ * @method string flushAll()
+ * @method string flushDb()
+ * @method array info()
+ * @method bool|array config(string $setGet, string $key, string $value = null)
+ *
+ * Keys:
+ * @method int del(string $key)
+ * @method int exists(string $key)
+ * @method int expire(string $key, int $seconds)
+ * @method int expireAt(string $key, int $timestamp)
+ * @method array keys(string $key)
+ * @method int persist(string $key)
+ * @method bool rename(string $key, string $newKey)
+ * @method bool renameNx(string $key, string $newKey)
+ * @method array sort(string $key, string $arg1, string $valueN = null)
+ * @method int ttl(string $key)
+ * @method string type(string $key)
+ * @method bool|array scan(int &$iterator, string $pattern = null, int count = null)
+ * @method bool|array sscan(int &$iterator, string $pattern = null, int count = null)
+ * @method bool|array hscan(int &$iterator, string $pattern = null, int count = null)
+ * @method bool|array zscan(int &$iterator, string $pattern = null, int count = null)
+ *
+ * Scalars:
+ * @method int append(string $key, string $value)
+ * @method int decr(string $key)
+ * @method int decrBy(string $key, int $decrement)
+ * @method bool|string get(string $key)
+ * @method int getBit(string $key, int $offset)
+ * @method string getRange(string $key, int $start, int $end)
+ * @method string getSet(string $key, string $value)
+ * @method int incr(string $key)
+ * @method int incrBy(string $key, int $decrement)
+ * @method array mGet(array $keys)
+ * @method bool mSet(array $keysValues)
+ * @method int mSetNx(array $keysValues)
+ * @method bool set(string $key, string $value)
+ * @method int setBit(string $key, int $offset, int $value)
+ * @method bool setEx(string $key, int $seconds, string $value)
+ * @method int setNx(string $key, string $value)
+ * @method int setRange(string $key, int $offset, int $value)
+ * @method int strLen(string $key)
+ *
+ * Sets:
+ * @method int sAdd(string $key, mixed $value, string $valueN = null)
+ * @method int sRem(string $key, mixed $value, string $valueN = null)
+ * @method array sMembers(string $key)
+ * @method array sUnion(mixed $keyOrArray, string $valueN = null)
+ * @method array sInter(mixed $keyOrArray, string $valueN = null)
+ * @method array sDiff(mixed $keyOrArray, string $valueN = null)
+ * @method string sPop(string $key)
+ * @method int sCard(string $key)
+ * @method int sIsMember(string $key, string $member)
+ * @method int sMove(string $source, string $dest, string $member)
+ * @method string|array sRandMember(string $key, int $count = null)
+ * @method int sUnionStore(string $dest, string $key1, string $key2 = null)
+ * @method int sInterStore(string $dest, string $key1, string $key2 = null)
+ * @method int sDiffStore(string $dest, string $key1, string $key2 = null)
+ *
+ * Hashes:
+ * @method bool|int hSet(string $key, string $field, string $value)
+ * @method bool hSetNx(string $key, string $field, string $value)
+ * @method bool|string hGet(string $key, string $field)
+ * @method bool|int hLen(string $key)
+ * @method bool hDel(string $key, string $field)
+ * @method array hKeys(string $key, string $field)
+ * @method array hVals(string $key)
+ * @method array hGetAll(string $key)
+ * @method bool hExists(string $key, string $field)
+ * @method int hIncrBy(string $key, string $field, int $value)
+ * @method bool hMSet(string $key, array $keysValues)
+ * @method array hMGet(string $key, array $fields)
+ *
+ * Lists:
+ * @method array|null blPop(string $keyN, int $timeout)
+ * @method array|null brPop(string $keyN, int $timeout)
+ * @method array|null brPoplPush(string $source, string $destination, int $timeout)
+ * @method string|null lIndex(string $key, int $index)
+ * @method int lInsert(string $key, string $beforeAfter, string $pivot, string $value)
+ * @method int lLen(string $key)
+ * @method string|null lPop(string $key)
+ * @method int lPush(string $key, mixed $value, mixed $valueN = null)
+ * @method int lPushX(string $key, mixed $value)
+ * @method array lRange(string $key, int $start, int $stop)
+ * @method int lRem(string $key, int $count, mixed $value)
+ * @method bool lSet(string $key, int $index, mixed $value)
+ * @method bool lTrim(string $key, int $start, int $stop)
+ * @method string|null rPop(string $key)
+ * @method string|null rPoplPush(string $source, string $destination)
+ * @method int rPush(string $key, mixed $value, mixed $valueN = null)
+ * @method int rPushX(string $key, mixed $value)
+ *
+ * Sorted Sets:
+ * @method array zrangebyscore(string $key, mixed $start, mixed $stop, array $args = null)
+ * TODO
+ *
+ * Pub/Sub
+ * @method int publish(string $channel, string $message)
+ * @method int|array pubsub(string $subCommand, $arg = NULL)
+ *
+ * Scripting:
+ * @method string|int script(string $command, string $arg1 = null)
+ * @method string|int|array|bool eval(string $script, array $keys = NULL, array $args = NULL)
+ * @method string|int|array|bool evalSha(string $script, array $keys = NULL, array $args = NULL)
+ */
+class Credis_Client {
+
+ const TYPE_STRING = 'string';
+ const TYPE_LIST = 'list';
+ const TYPE_SET = 'set';
+ const TYPE_ZSET = 'zset';
+ const TYPE_HASH = 'hash';
+ const TYPE_NONE = 'none';
+ const FREAD_BLOCK_SIZE = 8192;
+
+ /**
+ * Socket connection to the Redis server or Redis library instance
+ * @var resource|Redis
+ */
+ protected $redis;
+ protected $redisMulti;
+
+ /**
+ * Host of the Redis server
+ * @var string
+ */
+ protected $host;
+
+ /**
+ * Port on which the Redis server is running
+ * @var integer
+ */
+ protected $port;
+
+ /**
+ * Timeout for connecting to Redis server
+ * @var float
+ */
+ protected $timeout;
+
+ /**
+ * Timeout for reading response from Redis server
+ * @var float
+ */
+ protected $readTimeout;
+
+ /**
+ * Unique identifier for persistent connections
+ * @var string
+ */
+ protected $persistent;
+
+ /**
+ * @var bool
+ */
+ protected $closeOnDestruct = TRUE;
+
+ /**
+ * @var bool
+ */
+ protected $connected = FALSE;
+
+ /**
+ * @var bool
+ */
+ protected $standalone;
+
+ /**
+ * @var int
+ */
+ protected $maxConnectRetries = 0;
+
+ /**
+ * @var int
+ */
+ protected $connectFailures = 0;
+
+ /**
+ * @var bool
+ */
+ protected $usePipeline = FALSE;
+
+ /**
+ * @var array
+ */
+ protected $commandNames;
+
+ /**
+ * @var string
+ */
+ protected $commands;
+
+ /**
+ * @var bool
+ */
+ protected $isMulti = FALSE;
+
+ /**
+ * @var bool
+ */
+ protected $isWatching = FALSE;
+
+ /**
+ * @var string
+ */
+ protected $authPassword;
+
+ /**
+ * @var int
+ */
+ protected $selectedDb = 0;
+
+ /**
+ * Aliases for backwards compatibility with phpredis
+ * @var array
+ */
+ protected $wrapperMethods = array('delete' => 'del', 'getkeys' => 'keys', 'sremove' => 'srem');
+
+ /**
+ * @var array
+ */
+ protected $renamedCommands;
+
+ /**
+ * @var int
+ */
+ protected $requests = 0;
+
+ /**
+ * @var bool
+ */
+ protected $subscribed = false;
+
+
+ /**
+ * Creates a Redisent connection to the Redis server on host {@link $host} and port {@link $port}.
+ * $host may also be a path to a unix socket or a string in the form of tcp://[hostname]:[port] or unix://[path]
+ *
+ * @param string $host The hostname of the Redis server
+ * @param integer $port The port number of the Redis server
+ * @param float $timeout Timeout period in seconds
+ * @param string $persistent Flag to establish persistent connection
+ * @param int $db The selected datbase of the Redis server
+ * @param string $password The authentication password of the Redis server
+ */
+ public function __construct($host = '127.0.0.1', $port = 6379, $timeout = null, $persistent = '', $db = 0, $password = null)
+ {
+ $this->host = (string) $host;
+ $this->port = (int) $port;
+ $this->timeout = $timeout;
+ $this->persistent = (string) $persistent;
+ $this->standalone = ! extension_loaded('redis');
+ $this->authPassword = $password;
+ $this->selectedDb = (int)$db;
+ $this->convertHost();
+ }
+
+ public function __destruct()
+ {
+ if ($this->closeOnDestruct) {
+ $this->close();
+ }
+ }
+
+ /**
+ * @return bool
+ */
+ public function isSubscribed()
+ {
+ return $this->subscribed;
+ }
+
+ /**
+ * Return the host of the Redis instance
+ * @return string
+ */
+ public function getHost()
+ {
+ return $this->host;
+ }
+ /**
+ * Return the port of the Redis instance
+ * @return int
+ */
+ public function getPort()
+ {
+ return $this->port;
+ }
+
+ /**
+ * Return the selected database
+ * @return int
+ */
+ public function getSelectedDb()
+ {
+ return $this->selectedDb;
+ }
+ /**
+ * @return string
+ */
+ public function getPersistence()
+ {
+ return $this->persistent;
+ }
+ /**
+ * @throws CredisException
+ * @return Credis_Client
+ */
+ public function forceStandalone()
+ {
+ if($this->connected) {
+ throw new CredisException('Cannot force Credis_Client to use standalone PHP driver after a connection has already been established.');
+ }
+ $this->standalone = TRUE;
+ return $this;
+ }
+
+ /**
+ * @param int $retries
+ * @return Credis_Client
+ */
+ public function setMaxConnectRetries($retries)
+ {
+ $this->maxConnectRetries = $retries;
+ return $this;
+ }
+
+ /**
+ * @param bool $flag
+ * @return Credis_Client
+ */
+ public function setCloseOnDestruct($flag)
+ {
+ $this->closeOnDestruct = $flag;
+ return $this;
+ }
+ protected function convertHost()
+ {
+ if (preg_match('#^(tcp|unix)://(.*)$#', $this->host, $matches)) {
+ if($matches[1] == 'tcp') {
+ if ( ! preg_match('#^([^:]+)(:([0-9]+))?(/(.+))?$#', $matches[2], $matches)) {
+ throw new CredisException('Invalid host format; expected tcp://host[:port][/persistence_identifier]');
+ }
+ $this->host = $matches[1];
+ $this->port = (int) (isset($matches[3]) ? $matches[3] : 6379);
+ $this->persistent = isset($matches[5]) ? $matches[5] : '';
+ } else {
+ $this->host = $matches[2];
+ $this->port = NULL;
+ if (substr($this->host,0,1) != '/') {
+ throw new CredisException('Invalid unix socket format; expected unix:///path/to/redis.sock');
+ }
+ }
+ }
+ if ($this->port !== NULL && substr($this->host,0,1) == '/') {
+ $this->port = NULL;
+ }
+ }
+ /**
+ * @throws CredisException
+ * @return Credis_Client
+ */
+ public function connect()
+ {
+ if ($this->connected) {
+ return $this;
+ }
+ if ($this->standalone) {
+ $flags = STREAM_CLIENT_CONNECT;
+ $remote_socket = $this->port === NULL
+ ? 'unix://'.$this->host
+ : 'tcp://'.$this->host.':'.$this->port;
+ if ($this->persistent) {
+ if ($this->port === NULL) { // Unix socket
+ throw new CredisException('Persistent connections to UNIX sockets are not supported in standalone mode.');
+ }
+ $remote_socket .= '/'.$this->persistent;
+ $flags = $flags | STREAM_CLIENT_PERSISTENT;
+ }
+ $result = $this->redis = @stream_socket_client($remote_socket, $errno, $errstr, $this->timeout !== null ? $this->timeout : 2.5, $flags);
+ }
+ else {
+ if ( ! $this->redis) {
+ $this->redis = new Redis;
+ }
+ $result = $this->persistent
+ ? $this->redis->pconnect($this->host, $this->port, $this->timeout, $this->persistent)
+ : $this->redis->connect($this->host, $this->port, $this->timeout);
+ }
+
+ // Use recursion for connection retries
+ if ( ! $result) {
+ $this->connectFailures++;
+ if ($this->connectFailures <= $this->maxConnectRetries) {
+ return $this->connect();
+ }
+ $failures = $this->connectFailures;
+ $this->connectFailures = 0;
+ throw new CredisException("Connection to Redis failed after $failures failures." . (isset($errno) && isset($errstr) ? "Last Error : ({$errno}) {$errstr}" : ""));
+ }
+
+ $this->connectFailures = 0;
+ $this->connected = TRUE;
+
+ // Set read timeout
+ if ($this->readTimeout) {
+ $this->setReadTimeout($this->readTimeout);
+ }
+
+ if($this->authPassword !== null) {
+ $this->auth($this->authPassword);
+ }
+ if($this->selectedDb !== 0) {
+ $this->select($this->selectedDb);
+ }
+ return $this;
+ }
+ /**
+ * @return bool
+ */
+ public function isConnected()
+ {
+ return $this->connected;
+ }
+ /**
+ * Set the read timeout for the connection. Use 0 to disable timeouts entirely (or use a very long timeout
+ * if not supported).
+ *
+ * @param int $timeout 0 (or -1) for no timeout, otherwise number of seconds
+ * @throws CredisException
+ * @return Credis_Client
+ */
+ public function setReadTimeout($timeout)
+ {
+ if ($timeout < -1) {
+ throw new CredisException('Timeout values less than -1 are not accepted.');
+ }
+ $this->readTimeout = $timeout;
+ if ($this->connected) {
+ if ($this->standalone) {
+ $timeout = $timeout <= 0 ? 315360000 : $timeout; // Ten-year timeout
+ stream_set_blocking($this->redis, TRUE);
+ stream_set_timeout($this->redis, (int) floor($timeout), ($timeout - floor($timeout)) * 1000000);
+ } else if (defined('Redis::OPT_READ_TIMEOUT')) {
+ // supported in phpredis 2.2.3
+ // a timeout value of -1 means reads will not timeout
+ $timeout = $timeout == 0 ? -1 : $timeout;
+ $this->redis->setOption(Redis::OPT_READ_TIMEOUT, $timeout);
+ }
+ }
+ return $this;
+ }
+
+ /**
+ * @return bool
+ */
+ public function close()
+ {
+ $result = TRUE;
+ if ($this->connected && ! $this->persistent) {
+ try {
+ $result = $this->standalone ? fclose($this->redis) : $this->redis->close();
+ $this->connected = FALSE;
+ } catch (Exception $e) {
+ ; // Ignore exceptions on close
+ }
+ }
+ return $result;
+ }
+
+ /**
+ * Enabled command renaming and provide mapping method. Supported methods are:
+ *
+ * 1. renameCommand('foo') // Salted md5 hash for all commands -> md5('foo'.$command)
+ * 2. renameCommand(function($command){ return 'my'.$command; }); // Callable
+ * 3. renameCommand('get', 'foo') // Single command -> alias
+ * 4. renameCommand(['get' => 'foo', 'set' => 'bar']) // Full map of [command -> alias]
+ *
+ * @param string|callable|array $command
+ * @param string|null $alias
+ * @return $this
+ */
+ public function renameCommand($command, $alias = NULL)
+ {
+ if ( ! $this->standalone) {
+ $this->forceStandalone();
+ }
+ if ($alias === NULL) {
+ $this->renamedCommands = $command;
+ } else {
+ if ( ! $this->renamedCommands) {
+ $this->renamedCommands = array();
+ }
+ $this->renamedCommands[$command] = $alias;
+ }
+ return $this;
+ }
+
+ /**
+ * @param $command
+ */
+ public function getRenamedCommand($command)
+ {
+ static $map;
+
+ // Command renaming not enabled
+ if ($this->renamedCommands === NULL) {
+ return $command;
+ }
+
+ // Initialize command map
+ if ($map === NULL) {
+ if (is_array($this->renamedCommands)) {
+ $map = $this->renamedCommands;
+ } else {
+ $map = array();
+ }
+ }
+
+ // Generate and return cached result
+ if ( ! isset($map[$command])) {
+ // String means all commands are hashed with salted md5
+ if (is_string($this->renamedCommands)) {
+ $map[$command] = md5($this->renamedCommands.$command);
+ }
+ // Would already be set in $map if it was intended to be renamed
+ else if (is_array($this->renamedCommands)) {
+ return $command;
+ }
+ // User-supplied function
+ else if (is_callable($this->renamedCommands)) {
+ $map[$command] = call_user_func($this->renamedCommands, $command);
+ }
+ }
+ return $map[$command];
+ }
+
+ /**
+ * @param string $password
+ * @return bool
+ */
+ public function auth($password)
+ {
+ $response = $this->__call('auth', array($password));
+ $this->authPassword = $password;
+ return $response;
+ }
+
+ /**
+ * @param int $index
+ * @return bool
+ */
+ public function select($index)
+ {
+ $response = $this->__call('select', array($index));
+ $this->selectedDb = (int) $index;
+ return $response;
+ }
+
+ /**
+ * @param string|array $pattern
+ * @return array
+ */
+ public function pUnsubscribe()
+ {
+ list($command, $channel, $subscribedChannels) = $this->__call('punsubscribe', func_get_args());
+ $this->subscribed = $subscribedChannels > 0;
+ return array($command, $channel, $subscribedChannels);
+ }
+
+ /**
+ * @param int $Iterator
+ * @param string $pattern
+ * @param int $Iterator
+ * @return bool | Array
+ */
+ public function scan(&$Iterator, $pattern = null, $count = null)
+ {
+ return $this->__call('scan', array(&$Iterator, $pattern, $count));
+ }
+
+ /**
+ * @param int $Iterator
+ * @param string $pattern
+ * @param int $Iterator
+ * @return bool | Array
+ */
+ public function hscan(&$Iterator, $pattern = null, $count = null)
+ {
+ return $this->__call('hscan', array(&$Iterator, $pattern, $count));
+ }
+
+ /**
+ * @param int $Iterator
+ * @param string $pattern
+ * @param int $Iterator
+ * @return bool | Array
+ */
+ public function sscan(&$Iterator, $pattern = null, $count = null)
+ {
+ return $this->__call('sscan', array(&$Iterator, $pattern, $count));
+ }
+
+ /**
+ * @param int $Iterator
+ * @param string $pattern
+ * @param int $Iterator
+ * @return bool | Array
+ */
+ public function zscan(&$Iterator, $pattern = null, $count = null)
+ {
+ return $this->__call('zscan', array(&$Iterator, $pattern, $count));
+ }
+
+ /**
+ * @param string|array $patterns
+ * @param $callback
+ * @return $this|array|bool|Credis_Client|mixed|null|string
+ * @throws CredisException
+ */
+ public function pSubscribe($patterns, $callback)
+ {
+ if ( ! $this->standalone) {
+ return $this->__call('pSubscribe', array((array)$patterns, $callback));
+ }
+
+ // Standalone mode: use infinite loop to subscribe until timeout
+ $patternCount = is_array($patterns) ? count($patterns) : 1;
+ while ($patternCount--) {
+ if (isset($status)) {
+ list($command, $pattern, $status) = $this->read_reply();
+ } else {
+ list($command, $pattern, $status) = $this->__call('psubscribe', array($patterns));
+ }
+ $this->subscribed = $status > 0;
+ if ( ! $status) {
+ throw new CredisException('Invalid pSubscribe response.');
+ }
+ }
+ try {
+ while ($this->subscribed) {
+ list($type, $pattern, $channel, $message) = $this->read_reply();
+ if ($type != 'pmessage') {
+ throw new CredisException('Received non-pmessage reply.');
+ }
+ $callback($this, $pattern, $channel, $message);
+ }
+ } catch (CredisException $e) {
+ if ($e->getCode() == CredisException::CODE_TIMED_OUT) {
+ try {
+ list($command, $pattern, $status) = $this->pUnsubscribe($patterns);
+ while ($status !== 0) {
+ list($command, $pattern, $status) = $this->read_reply();
+ }
+ } catch (CredisException $e2) {
+ throw $e2;
+ }
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * @param string|array $pattern
+ * @return array
+ */
+ public function unsubscribe()
+ {
+ list($command, $channel, $subscribedChannels) = $this->__call('unsubscribe', func_get_args());
+ $this->subscribed = $subscribedChannels > 0;
+ return array($command, $channel, $subscribedChannels);
+ }
+
+ /**
+ * @param string|array $channels
+ * @param $callback
+ * @throws CredisException
+ * @return $this|array|bool|Credis_Client|mixed|null|string
+ */
+ public function subscribe($channels, $callback)
+ {
+ if ( ! $this->standalone) {
+ return $this->__call('subscribe', array((array)$channels, $callback));
+ }
+
+ // Standalone mode: use infinite loop to subscribe until timeout
+ $channelCount = is_array($channels) ? count($channels) : 1;
+ while ($channelCount--) {
+ if (isset($status)) {
+ list($command, $channel, $status) = $this->read_reply();
+ } else {
+ list($command, $channel, $status) = $this->__call('subscribe', array($channels));
+ }
+ $this->subscribed = $status > 0;
+ if ( ! $status) {
+ throw new CredisException('Invalid subscribe response.');
+ }
+ }
+ try {
+ while ($this->subscribed) {
+ list($type, $channel, $message) = $this->read_reply();
+ if ($type != 'message') {
+ throw new CredisException('Received non-message reply.');
+ }
+ $callback($this, $channel, $message);
+ }
+ } catch (CredisException $e) {
+ if ($e->getCode() == CredisException::CODE_TIMED_OUT) {
+ try {
+ list($command, $channel, $status) = $this->unsubscribe($channels);
+ while ($status !== 0) {
+ list($command, $channel, $status) = $this->read_reply();
+ }
+ } catch (CredisException $e2) {
+ throw $e2;
+ }
+ }
+ throw $e;
+ }
+ }
+
+ public function __call($name, $args)
+ {
+ // Lazy connection
+ $this->connect();
+
+ $name = strtolower($name);
+
+ // Send request via native PHP
+ if($this->standalone)
+ {
+ switch ($name) {
+ case 'eval':
+ case 'evalsha':
+ $script = array_shift($args);
+ $keys = (array) array_shift($args);
+ $eArgs = (array) array_shift($args);
+ $args = array($script, count($keys), $keys, $eArgs);
+ break;
+ case 'set':
+ // The php redis module has different behaviour with ttl
+ // https://github.com/phpredis/phpredis#set
+ if (count($args) === 3 && is_int($args[2])) {
+ $args = array($args[0], $args[1], array('EX', $args[2]));
+ } elseif (count($args) === 3 && is_array($args[2])) {
+ $tmp_args = $args;
+ $args = array($tmp_args[0], $tmp_args[1]);
+ foreach ($tmp_args[2] as $k=>$v) {
+ if (is_string($k)) {
+ $args[] = array($k,$v);
+ } elseif (is_int($k)) {
+ $args[] = $v;
+ }
+ }
+ unset($tmp_args);
+ }
+ break;
+ case 'scan':
+ case 'sscan':
+ case 'hscan':
+ case 'zscan':
+ $ref =& $args[0];
+ if (empty($ref))
+ {
+ $ref = 0;
+ }
+ $eArgs = array($ref);
+ if (!empty($args[1]))
+ {
+ $eArgs[] = 'MATCH';
+ $eArgs[] = $args[1];
+ }
+ if (!empty($args[2]))
+ {
+ $eArgs[] = 'COUNT';
+ $eArgs[] = $args[2];
+ }
+ $args = $eArgs;
+ break;
+ case 'zrangebyscore':
+ if (isset($args[3]) && is_array($args[3])) {
+ // map options
+ $cArgs = array();
+ if (!empty($args[3]['withscores'])) {
+ $cArgs[] = 'withscores';
+ }
+ if (array_key_exists('limit', $args[3])) {
+ $cArgs[] = array('limit' => $args[3]['limit']);
+ }
+ $args[3] = $cArgs;
+ }
+ break;
+ }
+ // Flatten arguments
+ $args = self::_flattenArguments($args);
+
+ // In pipeline mode
+ if($this->usePipeline)
+ {
+ if($name == 'pipeline') {
+ throw new CredisException('A pipeline is already in use and only one pipeline is supported.');
+ }
+ else if($name == 'exec') {
+ if($this->isMulti) {
+ $this->commandNames[] = $name;
+ $this->commands .= self::_prepare_command(array($this->getRenamedCommand($name)));
+ }
+
+ // Write request
+ if($this->commands) {
+ $this->write_command($this->commands);
+ }
+ $this->commands = NULL;
+
+ // Read response
+ $response = array();
+ foreach($this->commandNames as $command) {
+ $response[] = $this->read_reply($command);
+ }
+ $this->commandNames = NULL;
+
+ if($this->isMulti) {
+ $response = array_pop($response);
+ }
+ $this->usePipeline = $this->isMulti = FALSE;
+ return $response;
+ }
+ else {
+ if($name == 'multi') {
+ $this->isMulti = TRUE;
+ }
+ array_unshift($args, $this->getRenamedCommand($name));
+ $this->commandNames[] = $name;
+ $this->commands .= self::_prepare_command($args);
+ return $this;
+ }
+ }
+
+ // Start pipeline mode
+ if($name == 'pipeline')
+ {
+ $this->usePipeline = TRUE;
+ $this->commandNames = array();
+ $this->commands = '';
+ return $this;
+ }
+
+ // If unwatching, allow reconnect with no error thrown
+ if($name == 'unwatch') {
+ $this->isWatching = FALSE;
+ }
+
+ // Non-pipeline mode
+ array_unshift($args, $this->getRenamedCommand($name));
+ $command = self::_prepare_command($args);
+ $this->write_command($command);
+ $response = $this->read_reply($name);
+
+ switch($name)
+ {
+ case 'scan':
+ case 'sscan':
+ case 'hscan':
+ case 'zscan':
+ $ref = array_shift($response);
+ if (empty($ref))
+ {
+ $response = false;
+ }
+ break;
+ case 'zrangebyscore';
+ if (in_array('withscores', $args, true)) {
+ // Map array of values into key=>score list like phpRedis does
+ $item = null;
+ $out = array();
+ foreach ($response as $value) {
+ if ($item == null) {
+ $item = $value;
+ } else {
+ // 2nd value is the score
+ $out[$item] = (float) $value;
+ $item = null;
+ }
+ }
+ $response = $out;
+ }
+ break;
+ }
+
+ // Watch mode disables reconnect so error is thrown
+ if($name == 'watch') {
+ $this->isWatching = TRUE;
+ }
+ // Transaction mode
+ else if($this->isMulti && ($name == 'exec' || $name == 'discard')) {
+ $this->isMulti = FALSE;
+ }
+ // Started transaction
+ else if($this->isMulti || $name == 'multi') {
+ $this->isMulti = TRUE;
+ $response = $this;
+ }
+ }
+
+ // Send request via phpredis client
+ else
+ {
+ // Tweak arguments
+ switch($name) {
+ case 'get': // optimize common cases
+ case 'set':
+ case 'hget':
+ case 'hset':
+ case 'setex':
+ case 'mset':
+ case 'msetnx':
+ case 'hmset':
+ case 'hmget':
+ case 'del':
+ case 'zrangebyscore':
+ break;
+ case 'mget':
+ if(isset($args[0]) && ! is_array($args[0])) {
+ $args = array($args);
+ }
+ break;
+ case 'lrem':
+ $args = array($args[0], $args[2], $args[1]);
+ break;
+ case 'eval':
+ case 'evalsha':
+ if (isset($args[1]) && is_array($args[1])) {
+ $cKeys = $args[1];
+ } elseif (isset($args[1]) && is_string($args[1])) {
+ $cKeys = array($args[1]);
+ } else {
+ $cKeys = array();
+ }
+ if (isset($args[2]) && is_array($args[2])) {
+ $cArgs = $args[2];
+ } elseif (isset($args[2]) && is_string($args[2])) {
+ $cArgs = array($args[2]);
+ } else {
+ $cArgs = array();
+ }
+ $args = array($args[0], array_merge($cKeys, $cArgs), count($cKeys));
+ break;
+ case 'subscribe':
+ case 'psubscribe':
+ break;
+ case 'scan':
+ case 'sscan':
+ case 'hscan':
+ case 'zscan':
+ // allow phpredis to see the caller's reference
+ //$param_ref =& $args[0];
+ break;
+ default:
+ // Flatten arguments
+ $args = self::_flattenArguments($args);
+ }
+
+ try {
+ // Proxy pipeline mode to the phpredis library
+ if($name == 'pipeline' || $name == 'multi') {
+ if($this->isMulti) {
+ return $this;
+ } else {
+ $this->isMulti = TRUE;
+ $this->redisMulti = call_user_func_array(array($this->redis, $name), $args);
+ }
+ }
+ else if($name == 'exec' || $name == 'discard') {
+ $this->isMulti = FALSE;
+ $response = $this->redisMulti->$name();
+ $this->redisMulti = NULL;
+ #echo "> $name : ".substr(print_r($response, TRUE),0,100)."\n";
+ return $response;
+ }
+
+ // Use aliases to be compatible with phpredis wrapper
+ if(isset($this->wrapperMethods[$name])) {
+ $name = $this->wrapperMethods[$name];
+ }
+
+ // Multi and pipeline return self for chaining
+ if($this->isMulti) {
+ call_user_func_array(array($this->redisMulti, $name), $args);
+ return $this;
+ }
+
+ // Send request, retry one time when using persistent connections on the first request only
+ $this->requests++;
+ try {
+ $response = call_user_func_array(array($this->redis, $name), $args);
+ } catch (RedisException $e) {
+ if ($this->persistent && $this->requests == 1 && $e->getMessage() == 'read error on connection') {
+ $this->connected = FALSE;
+ $this->connect();
+ $response = call_user_func_array(array($this->redis, $name), $args);
+ } else {
+ throw $e;
+ }
+ }
+ }
+ // Wrap exceptions
+ catch(RedisException $e) {
+ $code = 0;
+ if ( ! ($result = $this->redis->IsConnected())) {
+ $this->connected = FALSE;
+ $code = CredisException::CODE_DISCONNECTED;
+ }
+ throw new CredisException($e->getMessage(), $code, $e);
+ }
+
+ #echo "> $name : ".substr(print_r($response, TRUE),0,100)."\n";
+
+ // change return values where it is too difficult to minim in standalone mode
+ switch($name)
+ {
+ case 'hmget':
+ $response = array_values($response);
+ break;
+
+ case 'type':
+ $typeMap = array(
+ self::TYPE_NONE,
+ self::TYPE_STRING,
+ self::TYPE_SET,
+ self::TYPE_LIST,
+ self::TYPE_ZSET,
+ self::TYPE_HASH,
+ );
+ $response = $typeMap[$response];
+ break;
+
+ // Handle scripting errors
+ case 'eval':
+ case 'evalsha':
+ case 'script':
+ $error = $this->redis->getLastError();
+ $this->redis->clearLastError();
+ if ($error && substr($error,0,8) == 'NOSCRIPT') {
+ $response = NULL;
+ } else if ($error) {
+ throw new CredisException($error);
+ }
+ break;
+ default:
+ $error = $this->redis->getLastError();
+ $this->redis->clearLastError();
+ if ($error) {
+ throw new CredisException($error);
+ }
+ break;
+ }
+ }
+
+ return $response;
+ }
+
+ protected function write_command($command)
+ {
+ // Reconnect on lost connection (Redis server "timeout" exceeded since last command)
+ if(feof($this->redis)) {
+ $this->close();
+ // If a watch or transaction was in progress and connection was lost, throw error rather than reconnect
+ // since transaction/watch state will be lost.
+ if(($this->isMulti && ! $this->usePipeline) || $this->isWatching) {
+ $this->isMulti = $this->isWatching = FALSE;
+ throw new CredisException('Lost connection to Redis server during watch or transaction.');
+ }
+ $this->connected = FALSE;
+ $this->connect();
+ if($this->authPassword) {
+ $this->auth($this->authPassword);
+ }
+ if($this->selectedDb != 0) {
+ $this->select($this->selectedDb);
+ }
+ }
+
+ $commandLen = strlen($command);
+ for ($written = 0; $written < $commandLen; $written += $fwrite) {
+ $fwrite = fwrite($this->redis, substr($command, $written));
+ if ($fwrite === FALSE || $fwrite == 0 ) {
+ $this->connected = FALSE;
+ throw new CredisException('Failed to write entire command to stream');
+ }
+ }
+ }
+
+ protected function read_reply($name = '')
+ {
+ $reply = fgets($this->redis);
+ if($reply === FALSE) {
+ $info = stream_get_meta_data($this->redis);
+ if ($info['timed_out']) {
+ throw new CredisException('Read operation timed out.', CredisException::CODE_TIMED_OUT);
+ } else {
+ $this->connected = FALSE;
+ throw new CredisException('Lost connection to Redis server.', CredisException::CODE_DISCONNECTED);
+ }
+ }
+ $reply = rtrim($reply, CRLF);
+ #echo "> $name: $reply\n";
+ $replyType = substr($reply, 0, 1);
+ switch ($replyType) {
+ /* Error reply */
+ case '-':
+ if($this->isMulti || $this->usePipeline) {
+ $response = FALSE;
+ } else if ($name == 'evalsha' && substr($reply,0,9) == '-NOSCRIPT') {
+ $response = NULL;
+ } else {
+ throw new CredisException(substr($reply,0,4) == '-ERR' ? substr($reply, 5) : substr($reply,1));
+ }
+ break;
+ /* Inline reply */
+ case '+':
+ $response = substr($reply, 1);
+ if($response == 'OK' || $response == 'QUEUED') {
+ return TRUE;
+ }
+ break;
+ /* Bulk reply */
+ case '$':
+ if ($reply == '$-1') return FALSE;
+ $size = (int) substr($reply, 1);
+ $response = stream_get_contents($this->redis, $size + 2);
+ if( ! $response) {
+ $this->connected = FALSE;
+ throw new CredisException('Error reading reply.');
+ }
+ $response = substr($response, 0, $size);
+ break;
+ /* Multi-bulk reply */
+ case '*':
+ $count = substr($reply, 1);
+ if ($count == '-1') return FALSE;
+
+ $response = array();
+ for ($i = 0; $i < $count; $i++) {
+ $response[] = $this->read_reply();
+ }
+ break;
+ /* Integer reply */
+ case ':':
+ $response = intval(substr($reply, 1));
+ break;
+ default:
+ throw new CredisException('Invalid response: '.print_r($reply, TRUE));
+ break;
+ }
+
+ // Smooth over differences between phpredis and standalone response
+ switch($name)
+ {
+ case '': // Minor optimization for multi-bulk replies
+ break;
+ case 'config':
+ case 'hgetall':
+ $keys = $values = array();
+ while($response) {
+ $keys[] = array_shift($response);
+ $values[] = array_shift($response);
+ }
+ $response = count($keys) ? array_combine($keys, $values) : array();
+ break;
+ case 'info':
+ $lines = explode(CRLF, trim($response,CRLF));
+ $response = array();
+ foreach($lines as $line) {
+ if ( ! $line || substr($line, 0, 1) == '#') {
+ continue;
+ }
+ list($key, $value) = explode(':', $line, 2);
+ $response[$key] = $value;
+ }
+ break;
+ case 'ttl':
+ if($response === -1) {
+ $response = FALSE;
+ }
+ break;
+ }
+
+ return $response;
+ }
+
+ /**
+ * Build the Redis unified protocol command
+ *
+ * @param array $args
+ * @return string
+ */
+ private static function _prepare_command($args)
+ {
+ return sprintf('*%d%s%s%s', count($args), CRLF, implode(array_map(array('self', '_map'), $args), CRLF), CRLF);
+ }
+
+ private static function _map($arg)
+ {
+ return sprintf('$%d%s%s', strlen($arg), CRLF, $arg);
+ }
+
+ /**
+ * Flatten arguments
+ *
+ * If an argument is an array, the key is inserted as argument followed by the array values
+ * array('zrangebyscore', '-inf', 123, array('limit' => array('0', '1')))
+ * becomes
+ * array('zrangebyscore', '-inf', 123, 'limit', '0', '1')
+ *
+ * @param array $in
+ * @return array
+ */
+ private static function _flattenArguments(array $arguments, &$out = array())
+ {
+ foreach ($arguments as $key => $arg) {
+ if (!is_int($key)) {
+ $out[] = $key;
+ }
+
+ if (is_array($arg)) {
+ self::_flattenArguments($arg, $out);
+ } else {
+ $out[] = $arg;
+ }
+ }
+
+ return $out;
+ }
+}
--- Magento-CE-2.0.5/vendor/colinmollenhour/credis/Cluster.php 1969-12-31 21:00:00.000000000 -0300
+++ Magento-CE-2.0.6/vendor/colinmollenhour/credis/Cluster.php 2015-11-27 22:20:04.000000000 -0300
@@ -0,0 +1,317 @@
+<?php
+/**
+ * Credis, a Redis interface for the modest
+ *
+ * @author Justin Poliey <jdp34@njit.edu>
+ * @copyright 2009 Justin Poliey <jdp34@njit.edu>
+ * @license http://www.opensource.org/licenses/mit-license.php The MIT License
+ * @package Credis
+ */
+
+/**
+ * A generalized Credis_Client interface for a cluster of Redis servers
+ */
+class Credis_Cluster
+{
+ /**
+ * Collection of Credis_Client objects attached to Redis servers
+ * @var Credis_Client[]
+ */
+ protected $clients;
+ /**
+ * If a server is set as master, all write commands go to that one
+ * @var Credis_Client
+ */
+ protected $masterClient;
+ /**
+ * Aliases of Credis_Client objects attached to Redis servers, used to route commands to specific servers
+ * @see Credis_Cluster::to
+ * @var array
+ */
+ protected $aliases;
+
+ /**
+ * Hash ring of Redis server nodes
+ * @var array
+ */
+ protected $ring;
+
+ /**
+ * Individual nodes of pointers to Redis servers on the hash ring
+ * @var array
+ */
+ protected $nodes;
+
+ /**
+ * The commands that are not subject to hashing
+ * @var array
+ * @access protected
+ */
+ protected $dont_hash;
+
+ /**
+ * Creates an interface to a cluster of Redis servers
+ * Each server should be in the format:
+ * array(
+ * 'host' => hostname,
+ * 'port' => port,
+ * 'db' => db,
+ * 'password' => password,
+ * 'timeout' => timeout,
+ * 'alias' => alias,
+ * 'persistent' => persistence_identifier,
+ * 'master' => master
+ * 'write_only'=> true/false
+ * )
+ *
+ * @param array $servers The Redis servers in the cluster.
+ * @param int $replicas
+ * @param bool $standAlone
+ */
+ public function __construct($servers, $replicas = 128, $standAlone = false)
+ {
+ $this->clients = array();
+ $this->masterClient = null;
+ $this->aliases = array();
+ $this->ring = array();
+ $this->replicas = (int)$replicas;
+ $client = null;
+ foreach ($servers as $server)
+ {
+ if(is_array($server)){
+ $client = new Credis_Client(
+ $server['host'],
+ $server['port'],
+ isset($server['timeout']) ? $server['timeout'] : 2.5,
+ isset($server['persistent']) ? $server['persistent'] : '',
+ isset($server['db']) ? $server['db'] : 0,
+ isset($server['password']) ? $server['password'] : null
+ );
+ if (isset($server['alias'])) {
+ $this->aliases[$server['alias']] = $client;
+ }
+ if(isset($server['master']) && $server['master'] === true){
+ $this->masterClient = $client;
+ if(isset($server['write_only']) && $server['write_only'] === true){
+ continue;
+ }
+ }
+ } elseif($server instanceof Credis_Client){
+ $client = $server;
+ } else {
+ throw new CredisException('Server should either be an array or an instance of Credis_Client');
+ }
+ if($standAlone) {
+ $client->forceStandalone();
+ }
+ $this->clients[] = $client;
+ for ($replica = 0; $replica <= $this->replicas; $replica++) {
+ $md5num = hexdec(substr(md5($client->getHost().':'.$client->getPort().'-'.$replica),0,7));
+ $this->ring[$md5num] = count($this->clients)-1;
+ }
+ }
+ ksort($this->ring, SORT_NUMERIC);
+ $this->nodes = array_keys($this->ring);
+ $this->dont_hash = array_flip(array(
+ 'RANDOMKEY', 'DBSIZE', 'PIPELINE', 'EXEC',
+ 'SELECT', 'MOVE', 'FLUSHDB', 'FLUSHALL',
+ 'SAVE', 'BGSAVE', 'LASTSAVE', 'SHUTDOWN',
+ 'INFO', 'MONITOR', 'SLAVEOF'
+ ));
+ if($this->masterClient !== null && count($this->clients()) == 0){
+ $this->clients[] = $this->masterClient;
+ for ($replica = 0; $replica <= $this->replicas; $replica++) {
+ $md5num = hexdec(substr(md5($this->masterClient->getHost().':'.$this->masterClient->getHost().'-'.$replica),0,7));
+ $this->ring[$md5num] = count($this->clients)-1;
+ }
+ $this->nodes = array_keys($this->ring);
+ }
+ }
+
+ /**
+ * @param Credis_Client $masterClient
+ * @param bool $writeOnly
+ * @return Credis_Cluster
+ */
+ public function setMasterClient(Credis_Client $masterClient, $writeOnly=false)
+ {
+ if(!$masterClient instanceof Credis_Client){
+ throw new CredisException('Master client should be an instance of Credis_Client');
+ }
+ $this->masterClient = $masterClient;
+ if (!isset($this->aliases['master'])) {
+ $this->aliases['master'] = $masterClient;
+ }
+ if(!$writeOnly){
+ $this->clients[] = $this->masterClient;
+ for ($replica = 0; $replica <= $this->replicas; $replica++) {
+ $md5num = hexdec(substr(md5($this->masterClient->getHost().':'.$this->masterClient->getHost().'-'.$replica),0,7));
+ $this->ring[$md5num] = count($this->clients)-1;
+ }
+ $this->nodes = array_keys($this->ring);
+ }
+ return $this;
+ }
+ /**
+ * Get a client by index or alias.
+ *
+ * @param string|int $alias
+ * @throws CredisException
+ * @return Credis_Client
+ */
+ public function client($alias)
+ {
+ if (is_int($alias) && isset($this->clients[$alias])) {
+ return $this->clients[$alias];
+ }
+ else if (isset($this->aliases[$alias])) {
+ return $this->aliases[$alias];
+ }
+ throw new CredisException("Client $alias does not exist.");
+ }
+
+ /**
+ * Get an array of all clients
+ *
+ * @return array|Credis_Client[]
+ */
+ public function clients()
+ {
+ return $this->clients;
+ }
+
+ /**
+ * Execute a command on all clients
+ *
+ * @return array
+ */
+ public function all()
+ {
+ $args = func_get_args();
+ $name = array_shift($args);
+ $results = array();
+ foreach($this->clients as $client) {
+ $results[] = $client->__call($name, $args);
+ }
+ return $results;
+ }
+
+ /**
+ * Get the client that the key would hash to.
+ *
+ * @param string $key
+ * @return \Credis_Client
+ */
+ public function byHash($key)
+ {
+ return $this->clients[$this->hash($key)];
+ }
+
+ /**
+ * Execute a Redis command on the cluster with automatic consistent hashing and read/write splitting
+ *
+ * @param string $name
+ * @param array $args
+ * @return mixed
+ */
+ public function __call($name, $args)
+ {
+ if($this->masterClient !== null && !$this->isReadOnlyCommand($name)){
+ $client = $this->masterClient;
+ }elseif (count($this->clients()) == 1 || isset($this->dont_hash[strtoupper($name)]) || !isset($args[0])) {
+ $client = $this->clients[0];
+ }
+ else {
+ $client = $this->byHash($args[0]);
+ }
+ return $client->__call($name, $args);
+ }
+
+ /**
+ * Get client index for a key by searching ring with binary search
+ *
+ * @param string $key The key to hash
+ * @return int The index of the client object associated with the hash of the key
+ */
+ public function hash($key)
+ {
+ $needle = hexdec(substr(md5($key),0,7));
+ $server = $min = 0;
+ $max = count($this->nodes) - 1;
+ while ($max >= $min) {
+ $position = (int) (($min + $max) / 2);
+ $server = $this->nodes[$position];
+ if ($needle < $server) {
+ $max = $position - 1;
+ }
+ else if ($needle > $server) {
+ $min = $position + 1;
+ }
+ else {
+ break;
+ }
+ }
+ return $this->ring[$server];
+ }
+
+ public function isReadOnlyCommand($command)
+ {
+ $readOnlyCommands = array(
+ 'DBSIZE',
+ 'INFO',
+ 'MONITOR',
+ 'EXISTS',
+ 'TYPE',
+ 'KEYS',
+ 'SCAN',
+ 'RANDOMKEY',
+ 'TTL',
+ 'GET',
+ 'MGET',
+ 'SUBSTR',
+ 'STRLEN',
+ 'GETRANGE',
+ 'GETBIT',
+ 'LLEN',
+ 'LRANGE',
+ 'LINDEX',
+ 'SCARD',
+ 'SISMEMBER',
+ 'SINTER',
+ 'SUNION',
+ 'SDIFF',
+ 'SMEMBERS',
+ 'SSCAN',
+ 'SRANDMEMBER',
+ 'ZRANGE',
+ 'ZREVRANGE',
+ 'ZRANGEBYSCORE',
+ 'ZREVRANGEBYSCORE',
+ 'ZCARD',
+ 'ZSCORE',
+ 'ZCOUNT',
+ 'ZRANK',
+ 'ZREVRANK',
+ 'ZSCAN',
+ 'HGET',
+ 'HMGET',
+ 'HEXISTS',
+ 'HLEN',
+ 'HKEYS',
+ 'HVALS',
+ 'HGETALL',
+ 'HSCAN',
+ 'PING',
+ 'AUTH',
+ 'SELECT',
+ 'ECHO',
+ 'QUIT',
+ 'OBJECT',
+ 'BITCOUNT',
+ 'TIME',
+ 'SORT'
+ );
+ return in_array(strtoupper($command),$readOnlyCommands);
+ }
+}
+
--- Magento-CE-2.0.5/vendor/colinmollenhour/credis/composer.json 1969-12-31 21:00:00.000000000 -0300
+++ Magento-CE-2.0.6/vendor/colinmollenhour/credis/composer.json 2015-11-27 22:20:04.000000000 -0300
@@ -0,0 +1,23 @@
+{
+ "name": "colinmollenhour/credis",
+ "type": "library",
+ "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",
+ "license": "MIT",
+ "authors": [
+ {
+ "name": "Colin Mollenhour",
+ "email": "colin@mollenhour.com"
+ }
+ ],
+ "require": {
+ "php": ">=5.3.0"
+ },
+ "autoload": {
+ "classmap": [
+ "Client.php",
+ "Cluster.php",
+ "Sentinel.php"
+ ]
+ }
+}
--- Magento-CE-2.0.5/vendor/colinmollenhour/credis/.gitignore 1969-12-31 21:00:00.000000000 -0300
+++ Magento-CE-2.0.6/vendor/colinmollenhour/credis/.gitignore 2015-11-27 22:20:04.000000000 -0300
@@ -0,0 +1,2 @@
+.idea
+phpunit.phar
\ No hay ningún carácter de nueva línea al final del archivo
--- Magento-CE-2.0.5/vendor/colinmollenhour/credis/LICENSE 1969-12-31 21:00:00.000000000 -0300
+++ Magento-CE-2.0.6/vendor/colinmollenhour/credis/LICENSE 2015-11-27 22:20:04.000000000 -0300
@@ -0,0 +1,23 @@
+Copyright (c) 2009 Justin Poliey <jdp34@njit.edu>
+Copyright (c) 2011 Colin Mollenhour <colin@mollenhour.com>
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the "Software"), to deal in the Software without
+restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
--- Magento-CE-2.0.5/vendor/colinmollenhour/credis/phpunit.xml 1969-12-31 21:00:00.000000000 -0300
+++ Magento-CE-2.0.6/vendor/colinmollenhour/credis/phpunit.xml 2015-11-27 22:20:04.000000000 -0300
@@ -0,0 +1,21 @@
+<?xml version="1.0"?>
+<phpunit colors="true" verbose="true">
+ <testsuites>
+ <testsuite name="Cm_Cache_Backend_Redis testsuite">
+ <file>tests/SetUpBefore.php</file>
+ <file>tests/CredisTest.php</file>
+ <file>tests/CredisStandaloneTest.php</file>
+ <file>tests/CredisClusterTest.php</file>
+ <file>tests/CredisStandaloneClusterTest.php</file>
+ <file>tests/CredisSentinelTest.php</file>
+ <file>tests/CredisStandaloneSentinelTest.php</file>
+ <file>tests/TearDownAfter.php</file>
+ </testsuite>
+ </testsuites>
+ <logging>
+ <log type="coverage-html" target="tests/_reports/coverage/" charset="UTF-8" yui="true" highlight="false" lowUpperBound="35" highLowerBound="70"/>
+ <log type="testdox-text" target="tests/_reports/testdox/tests.txt"/>
+ <log type="testdox-html" target="tests/_reports/testdox/tests.html"/>
+ <log type="json" target="tests/_reports/logfile.json"/>
+ </logging>
+</phpunit>
\ No hay ningún carácter de nueva línea al final del archivo
--- Magento-CE-2.0.5/vendor/colinmollenhour/credis/README.markdown 1969-12-31 21:00:00.000000000 -0300
+++ Magento-CE-2.0.6/vendor/colinmollenhour/credis/README.markdown 2015-11-27 22:20:04.000000000 -0300
@@ -0,0 +1,171 @@
+# Credis
+
+Credis is a lightweight interface to the [Redis](http://redis.io/) key-value store which wraps the [phpredis](https://github.com/nicolasff/phpredis)
+library when available for better performance. This project was forked from one of the many redisent forks.
+
+## Getting Started
+
+Credis_Client uses methods named the same as Redis commands, and translates return values to the appropriate
+PHP equivalents.
+
+```php
+require 'Credis/Client.php';
+$redis = new Credis_Client('localhost');
+$redis->set('awesome', 'absolutely');
+echo sprintf('Is Credis awesome? %s.\n', $redis->get('awesome'));
+
+// When arrays are given as arguments they are flattened automatically
+$redis->rpush('particles', array('proton','electron','neutron'));
+$particles = $redis->lrange('particles', 0, -1);
+```
+Redis error responses will be wrapped in a CredisException class and thrown.
+
+Credis_Client also supports transparent command renaming. Write code using the original command names and the
+client will send the aliased commands to the server transparently. Specify the renamed commands using a prefix
+for md5, a callable function, individual aliases, or an array map of aliases. See "Redis Security":http://redis.io/topics/security for more info.
+
+## Clustering your servers
+
+Credis also includes a way for developers to fully utilize the scalability of Redis with multiple servers and [consistent hashing](http://en.wikipedia.org/wiki/Consistent_hashing).
+Using the [Credis_Cluster](Cluster.php) class, you can use Credis the same way, except that keys will be hashed across multiple servers.
+Here is how to set up a cluster:
+
+### Basic clustering example
+```php
+<?php
+require 'Credis/Client.php';
+require 'Credis/Cluster.php';
+
+$cluster = new Credis_Cluster(array(
+ array('host' => '127.0.0.1', 'port' => 6379, 'alias'=>'alpha'),
+ array('host' => '127.0.0.1', 'port' => 6380, 'alias'=>'beta')
+));
+$cluster->set('key','value');
+echo "Alpha: ".$cluster->client('alpha')->get('key').PHP_EOL;
+echo "Beta: ".$cluster->client('beta')->get('key').PHP_EOL;
+```
+
+### Explicit definition of replicas
+
+The consistent hashing strategy stores keys on a so called "ring". The position of each key is relative to the position of its target node. The target node that has the closest position will be the selected node for that specific key.
+
+To avoid an uneven distribution of keys (especially on small clusters), it is common to duplicate target nodes. Based on the number of replicas, each target node will exist *n times* on the "ring".
+
+The following example explicitly sets the number of replicas to 5. Both Redis instances will have 5 copies. The default value is 128.
+
+```php
+<?php
+require 'Credis/Client.php';
+require 'Credis/Cluster.php';
+
+$cluster = new Credis_Cluster(
+ array(
+ array('host' => '127.0.0.1', 'port' => 6379, 'alias'=>'alpha'),
+ array('host' => '127.0.0.1', 'port' => 6380, 'alias'=>'beta')
+ ), 5
+);
+$cluster->set('key','value');
+echo "Alpha: ".$cluster->client('alpha')->get('key').PHP_EOL;
+echo "Beta: ".$cluster->client('beta')->get('key').PHP_EOL;
+```
+
+## Master/slave replication
+
+The [Credis_Cluster](Cluster.php) class can also be used for [master/slave replication](http://redis.io/topics/replication).
+Credis_Cluster will automatically perform *read/write splitting* and send the write requests exclusively to the master server.
+Read requests will be handled by all servers unless you set the *write_only* flag to true in the connection string of the master server.
+
+### Redis server settings for master/slave replication
+
+Setting up master/slave replication is simple and only requires adding the following line to the config of the slave server:
+
+```
+slaveof 127.0.0.1 6379
+```
+
+### Basic master/slave example
+```php
+<?php
+require 'Credis/Client.php';
+require 'Credis/Cluster.php';
+
+$cluster = new Credis_Cluster(array(
+ array('host' => '127.0.0.1', 'port' => 6379, 'alias'=>'master', 'master'=>true),
+ array('host' => '127.0.0.1', 'port' => 6380, 'alias'=>'slave')
+));
+$cluster->set('key','value');
+echo $cluster->get('key').PHP_EOL;
+echo $cluster->client('slave')->get('key').PHP_EOL;
+
+$cluster->client('master')->set('key2','value');
+echo $cluster->client('slave')->get('key2').PHP_EOL;
+```
+
+### No read on master
+
+The following example illustrates how to disable reading on the master server. This will cause the master server only to be used for writing.
+This should only happen when you have enough write calls to create a certain load on the master server. Otherwise this is an inefficient usage of server resources.
+
+```php
+<?php
+require 'Credis/Client.php';
+require 'Credis/Cluster.php';
+
+$cluster = new Credis_Cluster(array(
+ array('host' => '127.0.0.1', 'port' => 6379, 'alias'=>'master', 'master'=>true, 'write_only'=>true),
+ array('host' => '127.0.0.1', 'port' => 6380, 'alias'=>'slave')
+));
+$cluster->set('key','value');
+echo $cluster->get('key').PHP_EOL;
+```
+## Automatic failover with Sentinel
+
+[Redis Sentinel](http://redis.io/topics/sentinel) is a system that can monitor Redis instances. You register master servers and Sentinel automatically detects its slaves.
+
+When a master server dies, Sentinel will make sure one of the slaves is promoted to be the new master. This autofailover mechanism will also demote failed masters to avoid data inconsistency.
+
+The [Credis_Sentinel](Sentinel.php) class interacts with the *Redis Sentinel* instance(s) and acts as a proxy. Sentinel will automatically create [Credis_Cluster](Cluster.php) objects and will set the master and slaves accordingly.
+
+Sentinel uses the same protocol as Redis. In the example below we register the Sentinel server running on port *26379* and assign it to the [Credis_Sentinel](Sentinel.php) object.
+We then ask Sentinel the hostname and port for the master server known as *mymaster*. By calling the *getCluster* method we immediately get a [Credis_Cluster](Cluster.php) object that allows us to perform basic Redis calls.
+
+```php
+<?php
+require 'Credis/Client.php';
+require 'Credis/Cluster.php';
+require 'Credis/Sentinel.php';
+
+$sentinel = new Credis_Sentinel(new Credis_Client('127.0.0.1',26379));
+$masterAddress = $sentinel->getMasterAddressByName('mymaster');
+$cluster = $sentinel->getCluster('mymaster');
+
+echo 'Writing to master: '.$masterAddress[0].' on port '.$masterAddress[1].PHP_EOL;
+$cluster->set('key','value');
+echo $cluster->get('key').PHP_EOL;
+```
+### Additional parameters
+
+Because [Credis_Sentinel](Sentinel.php) will create [Credis_Cluster](Cluster.php) objects using the *"getCluster"* or *"createCluster"* methods, additional parameters can be passed.
+
+First of all there's the *"write_only"* flag. You can also define the selected database and the number of replicas. And finally there's a *"selectRandomSlave"* option.
+
+The *"selectRandomSlave"* flag is used in setups for masters that have multiple slaves. The Credis_Sentinel will either select one random slave to be used when creating the Credis_Cluster object or to pass them all and use the built-in hashing.
+
+The example below shows how to use these 3 options. It selects database 2, sets the number of replicas to 10, it doesn't select a random slave and doesn't allow reading on the master server.
+
+```php
+<?php
+require 'Credis/Client.php';
+require 'Credis/Cluster.php';
+require 'Credis/Sentinel.php';
+
+$sentinel = new Credis_Sentinel(new Credis_Client('127.0.0.1',26379));
+$cluster = $sentinel->getCluster('mymaster',2,10,false,true);
+$cluster->set('key','value');
+echo $cluster->get('key').PHP_EOL;
+```
+
+## About
+
+&copy; 2011 [Colin Mollenhour](http://colin.mollenhour.com)
+&copy; 2009 [Justin Poliey](http://justinpoliey.com)
--- Magento-CE-2.0.5/vendor/colinmollenhour/credis/Sentinel.php 1969-12-31 21:00:00.000000000 -0300
+++ Magento-CE-2.0.6/vendor/colinmollenhour/credis/Sentinel.php 2015-11-27 22:20:04.000000000 -0300
@@ -0,0 +1,255 @@
+<?php
+/**
+ * Credis_Sentinel
+ *
+ * Implements the Sentinel API as mentioned on http://redis.io/topics/sentinel.
+ * Sentinel is aware of master and slave nodes in a cluster and returns instances of Credis_Client accordingly.
+ *
+ * The complexity of read/write splitting can also be abstract by calling the createCluster() method which returns a
+ * Credis_Cluster object that contains both the master server and a random slave. Credis_Cluster takes care of the
+ * read/write splitting
+ *
+ * @author Thijs Feryn <thijs@feryn.eu>
+ * @license http://www.opensource.org/licenses/mit-license.php The MIT License
+ * @package Credis_Sentinel
+ */
+class Credis_Sentinel
+{
+ /**
+ * Contains a client that connects to a Sentinel node.
+ * Sentinel uses the same protocol as Redis which makes using Credis_Client convenient.
+ * @var Credis_Client
+ */
+ protected $_client;
+ /**
+ * Contains an active instance of Credis_Cluster per master pool
+ * @var Array
+ */
+ protected $_cluster = array();
+ /**
+ * Contains an active instance of Credis_Client representing a master
+ * @var Array
+ */
+ protected $_master = array();
+ /**
+ * Contains an array Credis_Client objects representing all slaves per master pool
+ * @var Array
+ */
+ protected $_slaves = array();
+ /**
+ * Use the phpredis extension or the standalone implementation
+ * @var bool
+ */
+ protected $_standAlone = false;
+ /**
+ * Connect with a Sentinel node. Sentinel will do the master and slave discovery
+ * @param Credis_Client $client
+ */
+ public function __construct(Credis_Client $client)
+ {
+ if(!$client instanceof Credis_Client){
+ throw new CredisException('Sentinel client should be an instance of Credis_Client');
+ }
+ $client->forceStandalone();
+ $this->_client = $client;
+ }
+ /**
+ * @return Credis_Sentinel
+ */
+ public function forceStandalone()
+ {
+ $this->_standAlone = true;
+ return $this;
+ }
+ /**
+ * Discover the master node automatically and return an instance of Credis_Client that connects to the master
+ * @param string $name
+ * @return Credis_Client
+ */
+ public function createMasterClient($name)
+ {
+ $master = $this->getMasterAddressByName($name);
+ if(!isset($master[0]) || !isset($master[1])){
+ throw new CredisException('Master not found');
+ }
+ return new Credis_Client($master[0],$master[1]);
+ }
+ /**
+ * If a Credis_Client object exists for a master, return it. Otherwise create one and return it
+ * @param string $name
+ * @return Credis_Client
+ */
+ public function getMasterClient($name)
+ {
+ if(!isset($this->_master[$name])){
+ $this->_master[$name] = $this->createMasterClient($name);
+ }
+ return $this->_master[$name];
+ }
+ /**
+ * Discover the slave nodes automatically and return an array of Credis_Client objects
+ * @param string $name
+ * @return Credis_Client[]
+ */
+ public function createSlaveClients($name)
+ {
+ $slaves = $this->slaves($name);
+ $workingSlaves = array();
+ foreach($slaves as $slave) {
+ if(!isset($slave[9])){
+ throw new CredisException('Can\' retrieve slave status');
+ }
+ if(!strstr($slave[9],'s_down') && !strstr($slave[9],'disconnected')) {
+ $workingSlaves[] = new Credis_Client($slave[3],$slave[5]);
+ }
+ }
+ return $workingSlaves;
+ }
+ /**
+ * If an array of Credis_Client objects exist for a set of slaves, return them. Otherwise create and return them
+ * @param string $name
+ * @return Credis_Client[]
+ */
+ public function getSlaveClients($name)
+ {
+ if(!isset($this->_slaves[$name])){
+ $this->_slaves[$name] = $this->createSlaveClients($name);
+ }
+ return $this->_slaves[$name];
+ }
+ /**
+ * Returns a Redis cluster object containing a random slave and the master
+ * When $selectRandomSlave is true, only one random slave is passed.
+ * When $selectRandomSlave is false, all clients are passed and hashing is applied in Credis_Cluster
+ * When $writeOnly is false, the master server will also be used for read commands.
+ * @param string $name
+ * @param int $db
+ * @param int $replicas
+ * @param bool $selectRandomSlave
+ * @param bool $writeOnly
+ * @return Credis_Cluster
+ */
+ public function createCluster($name, $db=0, $replicas=128, $selectRandomSlave=true, $writeOnly=false)
+ {
+ $clients = array();
+ $workingClients = array();
+ $master = $this->master($name);
+ if(strstr($master[9],'s_down') || strstr($master[9],'disconnected')) {
+ throw new CredisException('The master is down');
+ }
+ $slaves = $this->slaves($name);
+ foreach($slaves as $slave){
+ if(!strstr($slave[9],'s_down') && !strstr($slave[9],'disconnected')) {
+ $workingClients[] = array('host'=>$slave[3],'port'=>$slave[5],'master'=>false,'db'=>$db);
+ }
+ }
+ if(count($workingClients)>0){
+ if($selectRandomSlave){
+ if(!$writeOnly){
+ $workingClients[] = array('host'=>$master[3],'port'=>$master[5],'master'=>false,'db'=>$db);
+ }
+ $clients[] = $workingClients[rand(0,count($workingClients)-1)];
+ } else {
+ $clients = $workingClients;
+ }
+ }
+ $clients[] = array('host'=>$master[3],'port'=>$master[5], 'db'=>$db ,'master'=>true,'write_only'=>$writeOnly);
+ return new Credis_Cluster($clients,$replicas,$this->_standAlone);
+ }
+ /**
+ * If a Credis_Cluster object exists, return it. Otherwise create one and return it.
+ * @param string $name
+ * @param int $db
+ * @param int $replicas
+ * @param bool $selectRandomSlave
+ * @param bool $writeOnly
+ * @return Credis_Cluster
+ */
+ public function getCluster($name, $db=0, $replicas=128, $selectRandomSlave=true, $writeOnly=false)
+ {
+ if(!isset($this->_cluster[$name])){
+ $this->_cluster[$name] = $this->createCluster($name, $db, $replicas, $selectRandomSlave, $writeOnly);
+ }
+ return $this->_cluster[$name];
+ }
+ /**
+ * Catch-all method
+ * @param string $name
+ * @param array $args
+ * @return mixed
+ */
+ public function __call($name, $args)
+ {
+ array_unshift($args,$name);
+ return call_user_func(array($this->_client,'sentinel'),$args);
+ }
+ /**
+ * Return information about all registered master servers
+ * @return mixed
+ */
+ public function masters()
+ {
+ return $this->_client->sentinel('masters');
+ }
+ /**
+ * Return all information for slaves that are associated with a single master
+ * @param string $name
+ * @return mixed
+ */
+ public function slaves($name)
+ {
+ return $this->_client->sentinel('slaves',$name);
+ }
+ /**
+ * Get the information for a specific master
+ * @param string $name
+ * @return mixed
+ */
+ public function master($name)
+ {
+ return $this->_client->sentinel('master',$name);
+ }
+ /**
+ * Get the hostname and port for a specific master
+ * @param string $name
+ * @return mixed
+ */
+ public function getMasterAddressByName($name)
+ {
+ return $this->_client->sentinel('get-master-addr-by-name',$name);
+ }
+ /**
+ * Check if the Sentinel is still responding
+ * @param string $name
+ * @return mixed
+ */
+ public function ping()
+ {
+ return $this->_client->ping();
+ }
+ /**
+ * Perform an auto-failover which will re-elect another master and make the current master a slave
+ * @param string $name
+ * @return mixed
+ */
+ public function failover($name)
+ {
+ return $this->_client->sentinel('failover',$name);
+ }
+
+ /**
+ * @return string
+ */
+ public function getHost()
+ {
+ return $this->_client->getHost();
+ }
+
+ /**
+ * @return int
+ */
+ public function getPort()
+ {
+ return $this->_client->getPort();
+ }
+}
\ No hay ningún carácter de nueva línea al final del archivo
--- Magento-CE-2.0.5/vendor/colinmollenhour/credis/tests/CredisClusterTest.php 1969-12-31 21:00:00.000000000 -0300
+++ Magento-CE-2.0.6/vendor/colinmollenhour/credis/tests/CredisClusterTest.php 2015-11-27 22:20:04.000000000 -0300
@@ -0,0 +1,224 @@
+<?php
+
+require_once dirname(__FILE__).'/../Client.php';
+require_once dirname(__FILE__).'/../Cluster.php';
+
+class CredisClusterTest extends PHPUnit_Framework_TestCase
+{
+
+ /** @var Credis_Cluster */
+ protected $cluster;
+
+ protected $config;
+
+ protected $useStandalone = FALSE;
+
+ protected function setUp()
+ {
+ if($this->config === NULL) {
+ $configFile = dirname(__FILE__).'/redis_config.json';
+ if( ! file_exists($configFile) || ! ($config = file_get_contents($configFile))) {
+ $this->markTestSkipped('Could not load '.$configFile);
+ return;
+ }
+ $this->config = json_decode($config);
+ $arrayConfig = array();
+ foreach($this->config as $config) {
+ $arrayConfig[] = (array)$config;
+ }
+ $this->config = $arrayConfig;
+ if(count($this->config) < 6) {
+ $this->markTestSkipped('Config file '.$configFile.' should contain at least 6 entries');
+ return;
+ }
+ }
+
+ if($this->useStandalone && !extension_loaded('redis')) {
+ $this->fail('The Redis extension is not loaded.');
+ }
+ $clients = array_slice($this->config,0,4);
+ $this->cluster = new Credis_Cluster($clients,2,$this->useStandalone);
+ }
+
+ protected function tearDown()
+ {
+ if($this->cluster) {
+ foreach($this->cluster->clients() as $client){
+ if($client->isConnected()) {
+ $client->flushAll();
+ $client->close();
+ }
+ }
+ $this->cluster = NULL;
+ }
+ }
+
+ public function testKeyHashing()
+ {
+ $this->tearDown();
+ $this->cluster = new Credis_Cluster(array_slice($this->config,0,3),2,$this->useStandalone);
+ $keys = array();
+ $lines = explode("\n", file_get_contents("keys.test"));
+ foreach ($lines as $line) {
+ $pair = explode(':', trim($line));
+ if (count($pair) >= 2) {
+ $keys[$pair[0]] = $pair[1];
+ }
+ }
+ foreach ($keys as $key => $value) {
+ $this->assertTrue($this->cluster->set($key, $value));
+ }
+ $this->cluster = new Credis_Cluster(array_slice($this->config,0,4),2,true,$this->useStandalone);
+ $hits = 0;
+ foreach ($keys as $key => $value) {
+ if ($this->cluster->all('get',$key)) {
+ $hits++;
+ }
+ }
+ $this->assertEquals(count($keys),$hits);
+ }
+ public function testAlias()
+ {
+ $slicedConfig = array_slice($this->config,0,4);
+ foreach($slicedConfig as $config) {
+ $this->assertEquals($config['port'],$this->cluster->client($config['alias'])->getPort());
+ }
+ foreach($slicedConfig as $offset => $config) {
+ $this->assertEquals($config['port'],$this->cluster->client($offset)->getPort());
+ }
+ $alias = "non-existent-alias";
+ $this->setExpectedException('CredisException',"Client $alias does not exist.");
+ $this->cluster->client($alias);
+ }
+ public function testMasterSlave()
+ {
+ $this->tearDown();
+ $this->cluster = new Credis_Cluster(array($this->config[0],$this->config[6]),2,$this->useStandalone);
+ $this->assertTrue($this->cluster->client('master')->set('key','value'));
+ $this->assertEquals('value',$this->cluster->client('slave')->get('key'));
+ $this->assertEquals('value',$this->cluster->get('key'));
+ $this->assertFalse($this->cluster->client('slave')->set('key2','value'));
+
+ $this->tearDown();
+ $writeOnlyConfig = $this->config[0];
+ $writeOnlyConfig['write_only'] = true;
+ $this->cluster = new Credis_Cluster(array($writeOnlyConfig,$this->config[6]),2,$this->useStandalone);
+ $this->assertTrue($this->cluster->client('master')->set('key','value'));
+ $this->assertEquals('value',$this->cluster->client('slave')->get('key'));
+ $this->assertFalse($this->cluster->client('slave')->set('key2','value'));
+ $this->assertEquals('value',$this->cluster->get('key'));
+ }
+ public function testMasterWithoutSlavesAndWriteOnlyFlag()
+ {
+ $this->tearDown();
+ $writeOnlyConfig = $this->config[0];
+ $writeOnlyConfig['write_only'] = true;
+ $this->cluster = new Credis_Cluster(array($writeOnlyConfig),2,$this->useStandalone);
+ $this->assertTrue($this->cluster->set('key','value'));
+ $this->assertEquals('value',$this->cluster->get('key'));
+ }
+ public function testDontHashForCodeCoverage()
+ {
+ $this->assertInternalType('array',$this->cluster->info());
+ }
+ public function testByHash()
+ {
+ $this->cluster->set('key','value');
+ $this->assertEquals(6379,$this->cluster->byHash('key')->getPort());
+ }
+ public function testRwsplit()
+ {
+ $readOnlyCommands = array(
+ 'EXISTS',
+ 'TYPE',
+ 'KEYS',
+ 'SCAN',
+ 'RANDOMKEY',
+ 'TTL',
+ 'GET',
+ 'MGET',
+ 'SUBSTR',
+ 'STRLEN',
+ 'GETRANGE',
+ 'GETBIT',
+ 'LLEN',
+ 'LRANGE',
+ 'LINDEX',
+ 'SCARD',
+ 'SISMEMBER',
+ 'SINTER',
+ 'SUNION',
+ 'SDIFF',
+ 'SMEMBERS',
+ 'SSCAN',
+ 'SRANDMEMBER',
+ 'ZRANGE',
+ 'ZREVRANGE',
+ 'ZRANGEBYSCORE',
+ 'ZREVRANGEBYSCORE',
+ 'ZCARD',
+ 'ZSCORE',
+ 'ZCOUNT',
+ 'ZRANK',
+ 'ZREVRANK',
+ 'ZSCAN',
+ 'HGET',
+ 'HMGET',
+ 'HEXISTS',
+ 'HLEN',
+ 'HKEYS',
+ 'HVALS',
+ 'HGETALL',
+ 'HSCAN',
+ 'PING',
+ 'AUTH',
+ 'SELECT',
+ 'ECHO',
+ 'QUIT',
+ 'OBJECT',
+ 'BITCOUNT',
+ 'TIME',
+ 'SORT'
+ );
+ foreach($readOnlyCommands as $command){
+ $this->assertTrue($this->cluster->isReadOnlyCommand($command));
+ }
+ $this->assertFalse($this->cluster->isReadOnlyCommand("SET"));
+ $this->assertFalse($this->cluster->isReadOnlyCommand("HDEL"));
+ $this->assertFalse($this->cluster->isReadOnlyCommand("RPUSH"));
+ $this->assertFalse($this->cluster->isReadOnlyCommand("SMOVE"));
+ $this->assertFalse($this->cluster->isReadOnlyCommand("ZADD"));
+ }
+ public function testCredisClientInstancesInConstructor()
+ {
+ $this->tearDown();
+ $two = new Credis_Client($this->config[1]['host'],$this->config[1]['port']);
+ $three = new Credis_Client($this->config[2]['host'],$this->config[2]['port']);
+ $four = new Credis_Client($this->config[3]['host'],$this->config[3]['port']);
+ $this->cluster = new Credis_Cluster(array($two,$three,$four),2,$this->useStandalone);
+ $this->assertTrue($this->cluster->set('key','value'));
+ $this->assertEquals('value',$this->cluster->get('key'));
+ $this->setExpectedException('CredisException','Server should either be an array or an instance of Credis_Client');
+ new Credis_Cluster(array(new stdClass()),2,$this->useStandalone);
+ }
+ public function testSetMasterClient()
+ {
+ $this->tearDown();
+ $master = new Credis_Client($this->config[0]['host'],$this->config[0]['port']);
+ $slave = new Credis_Client($this->config[6]['host'],$this->config[6]['port']);
+
+ $this->cluster = new Credis_Cluster(array($slave),2,$this->useStandalone);
+ $this->assertInstanceOf('Credis_Cluster',$this->cluster->setMasterClient($master));
+ $this->assertCount(2,$this->cluster->clients());
+ $this->assertEquals($this->config[6]['port'],$this->cluster->client(0)->getPort());
+ $this->assertEquals($this->config[0]['port'],$this->cluster->client('master')->getPort());
+
+ $this->cluster = new Credis_Cluster(array($this->config[0]),2,$this->useStandalone);
+ $this->assertInstanceOf('Credis_Cluster',$this->cluster->setMasterClient(new Credis_Client($this->config[1]['host'],$this->config[1]['port'])));
+ $this->assertEquals($this->config[0]['port'],$this->cluster->client('master')->getPort());
+
+ $this->cluster = new Credis_Cluster(array($slave),2,$this->useStandalone);
+ $this->assertInstanceOf('Credis_Cluster',$this->cluster->setMasterClient($master,true));
+ $this->assertCount(1,$this->cluster->clients());
+ }
+}
--- Magento-CE-2.0.5/vendor/colinmollenhour/credis/tests/CredisSentinelTest.php 1969-12-31 21:00:00.000000000 -0300
+++ Magento-CE-2.0.6/vendor/colinmollenhour/credis/tests/CredisSentinelTest.php 2015-11-27 22:20:04.000000000 -0300
@@ -0,0 +1,188 @@
+<?php
+
+require_once dirname(__FILE__).'/../Client.php';
+require_once dirname(__FILE__).'/../Cluster.php';
+require_once dirname(__FILE__).'/../Sentinel.php';
+
+class CredisSentinelTest extends PHPUnit_Framework_TestCase
+{
+
+ /** @var Credis_Sentinel */
+ protected $sentinel;
+
+ protected $sentinelConfig;
+ protected $redisConfig;
+
+ protected $useStandalone = FALSE;
+
+ protected function setUp()
+ {
+ if($this->sentinelConfig === NULL) {
+ $configFile = dirname(__FILE__).'/sentinel_config.json';
+ if( ! file_exists($configFile) || ! ($config = file_get_contents($configFile))) {
+ $this->markTestSkipped('Could not load '.$configFile);
+ return;
+ }
+ $this->sentinelConfig = json_decode($config);
+ }
+
+ if($this->redisConfig === NULL) {
+ $configFile = dirname(__FILE__).'/redis_config.json';
+ if( ! file_exists($configFile) || ! ($config = file_get_contents($configFile))) {
+ $this->markTestSkipped('Could not load '.$configFile);
+ return;
+ }
+ $this->redisConfig = json_decode($config);
+ $arrayConfig = array();
+ foreach($this->redisConfig as $config) {
+ $arrayConfig[] = (array)$config;
+ }
+ $this->redisConfig = $arrayConfig;
+ }
+ $sentinelClient = new Credis_Client($this->sentinelConfig->host, $this->sentinelConfig->port);
+ $this->sentinel = new Credis_Sentinel($sentinelClient);
+ if($this->useStandalone) {
+ $this->sentinel->forceStandalone();
+ } else if ( ! extension_loaded('redis')) {
+ $this->fail('The Redis extension is not loaded.');
+ }
+ }
+ protected function tearDown()
+ {
+ if($this->sentinel) {
+ $this->sentinel = NULL;
+ }
+ }
+ public function testMasterClient()
+ {
+ $master = $this->sentinel->getMasterClient($this->sentinelConfig->clustername);
+ $this->assertInstanceOf('Credis_Client',$master);
+ $this->assertEquals($this->redisConfig[0]['port'],$master->getPort());
+ $this->setExpectedException('CredisException','Master not found');
+ $this->sentinel->getMasterClient('non-existing-cluster');
+ }
+ public function testMasters()
+ {
+ $masters = $this->sentinel->masters();
+ $this->assertInternalType('array',$masters);
+ $this->assertCount(2,$masters);
+ $this->assertArrayHasKey(0,$masters);
+ $this->assertArrayHasKey(1,$masters);
+ $this->assertArrayHasKey(1,$masters[0]);
+ $this->assertArrayHasKey(1,$masters[1]);
+ $this->assertArrayHasKey(5,$masters[1]);
+ if($masters[0][1] == 'masterdown'){
+ $this->assertEquals($this->sentinelConfig->clustername,$masters[1][1]);
+ $this->assertEquals($this->redisConfig[0]['port'],$masters[1][5]);
+ } else {
+ $this->assertEquals('masterdown',$masters[1][1]);
+ $this->assertEquals($this->sentinelConfig->clustername,$masters[0][1]);
+ $this->assertEquals($this->redisConfig[0]['port'],$masters[0][5]);
+ }
+ }
+ public function testMaster()
+ {
+ $master = $this->sentinel->master($this->sentinelConfig->clustername);
+ $this->assertInternalType('array',$master);
+ $this->assertArrayHasKey(1,$master);
+ $this->assertArrayHasKey(5,$master);
+ $this->assertEquals($this->sentinelConfig->clustername,$master[1]);
+ $this->assertEquals($this->redisConfig[0]['port'],$master[5]);
+
+ $this->setExpectedException('CredisException','No such master with that name');
+ $this->sentinel->master('non-existing-cluster');
+ }
+ public function testSlaveClient()
+ {
+ $slaves = $this->sentinel->getSlaveClients($this->sentinelConfig->clustername);
+ $this->assertInternalType('array',$slaves);
+ $this->assertCount(1,$slaves);
+ foreach($slaves as $slave){
+ $this->assertInstanceOf('Credis_Client',$slave);
+ }
+ $this->setExpectedException('CredisException','No such master with that name');
+ $this->sentinel->getSlaveClients('non-existing-cluster');
+ }
+ public function testSlaves()
+ {
+ $slaves = $this->sentinel->slaves($this->sentinelConfig->clustername);
+ $this->assertInternalType('array',$slaves);
+ $this->assertCount(1,$slaves);
+ $this->assertArrayHasKey(0,$slaves);
+ $this->assertArrayHasKey(5,$slaves[0]);
+ $this->assertEquals(6385,$slaves[0][5]);
+
+ $slaves = $this->sentinel->slaves('masterdown');
+ $this->assertInternalType('array',$slaves);
+ $this->assertCount(0,$slaves);
+
+ $this->setExpectedException('CredisException','No such master with that name');
+ $this->sentinel->slaves('non-existing-cluster');
+ }
+ public function testNonExistingClusterNameWhenCreatingSlaves()
+ {
+ $this->setExpectedException('CredisException','No such master with that name');
+ $this->sentinel->createSlaveClients('non-existing-cluster');
+ }
+ public function testCreateCluster()
+ {
+ $cluster = $this->sentinel->createCluster($this->sentinelConfig->clustername);
+ $this->assertInstanceOf('Credis_Cluster',$cluster);
+ $this->assertCount(2,$cluster->clients());
+ $cluster = $this->sentinel->createCluster($this->sentinelConfig->clustername,0,1,false);
+ $this->assertInstanceOf('Credis_Cluster',$cluster);
+ $this->assertCount(2,$cluster->clients());
+ $this->setExpectedException('CredisException','The master is down');
+ $this->sentinel->createCluster($this->sentinelConfig->downclustername);
+ }
+ public function testGetCluster()
+ {
+ $cluster = $this->sentinel->getCluster($this->sentinelConfig->clustername);
+ $this->assertInstanceOf('Credis_Cluster',$cluster);
+ $this->assertCount(2,$cluster->clients());
+ }
+ public function testGetClusterOnDbNumber2()
+ {
+ $cluster = $this->sentinel->getCluster($this->sentinelConfig->clustername,2);
+ $this->assertInstanceOf('Credis_Cluster',$cluster);
+ $this->assertCount(2,$cluster->clients());
+ $clients = $cluster->clients();
+ $this->assertEquals(2,$clients[0]->getSelectedDb());
+ $this->assertEquals(2,$clients[1]->getSelectedDb());
+ }
+ public function testGetMasterAddressByName()
+ {
+ $address = $this->sentinel->getMasterAddressByName($this->sentinelConfig->clustername);
+ $this->assertInternalType('array',$address);
+ $this->assertCount(2,$address);
+ $this->assertArrayHasKey(0,$address);
+ $this->assertArrayHasKey(1,$address);
+ $this->assertEquals($this->redisConfig[0]['host'],$address[0]);
+ $this->assertEquals($this->redisConfig[0]['port'],$address[1]);
+ }
+ public function testPing()
+ {
+ $pong = $this->sentinel->ping();
+ $this->assertEquals("PONG",$pong);
+ }
+
+ public function testGetHostAndPort()
+ {
+ $host = 'localhost';
+ $port = '123456';
+
+ $client = $this->getMock('\Credis_Client');
+ $sentinel = new Credis_Sentinel($client);
+
+ $client->expects($this->once())->method('getHost')->willReturn($host);
+ $client->expects($this->once())->method('getPort')->willReturn($port);
+
+ $this->assertEquals($host, $sentinel->getHost());
+ $this->assertEquals($port, $sentinel->getPort());
+ }
+ public function testNonExistingMethod()
+ {
+ $this->setExpectedException('CredisException','Unknown sentinel subcommand \'bla\'');
+ $this->sentinel->bla();
+ }
+}
--- Magento-CE-2.0.5/vendor/colinmollenhour/credis/tests/CredisStandaloneClusterTest.php 1969-12-31 21:00:00.000000000 -0300
+++ Magento-CE-2.0.6/vendor/colinmollenhour/credis/tests/CredisStandaloneClusterTest.php 2015-11-27 22:20:04.000000000 -0300
@@ -0,0 +1,29 @@
+<?php
+
+require_once dirname(__FILE__).'/CredisClusterTest.php';
+
+class CredisStandaloneClusterTest extends CredisClusterTest
+{
+ protected $useStandalone = TRUE;
+ protected function tearDown()
+ {
+ if($this->cluster) {
+ foreach($this->cluster->clients() as $client){
+ if($client->isConnected()) {
+ $client->close();
+ }
+ }
+ $this->cluster = NULL;
+ }
+ }
+ public function testMasterSlave()
+ {
+ $this->tearDown();
+ $this->cluster = new Credis_Cluster(array($this->config[0],$this->config[6]),2,$this->useStandalone);
+ $this->assertTrue($this->cluster->client('master')->set('key','value'));
+ $this->assertEquals('value',$this->cluster->client('slave')->get('key'));
+ $this->assertEquals('value',$this->cluster->get('key'));
+ $this->setExpectedException('CredisException','READONLY You can\'t write against a read only slave.');
+ $this->cluster->client('slave')->set('key2','value');
+ }
+}
--- Magento-CE-2.0.5/vendor/colinmollenhour/credis/tests/CredisStandaloneSentinelTest.php 1969-12-31 21:00:00.000000000 -0300
+++ Magento-CE-2.0.6/vendor/colinmollenhour/credis/tests/CredisStandaloneSentinelTest.php 2015-11-27 22:20:04.000000000 -0300
@@ -0,0 +1,8 @@
+<?php
+
+require_once dirname(__FILE__).'/CredisSentinelTest.php';
+
+class CredisStandaloneSentinelTest extends CredisSentinelTest
+{
+ protected $useStandalone = TRUE;
+}
--- Magento-CE-2.0.5/vendor/colinmollenhour/credis/tests/CredisStandaloneTest.php 1969-12-31 21:00:00.000000000 -0300
+++ Magento-CE-2.0.6/vendor/colinmollenhour/credis/tests/CredisStandaloneTest.php 2015-11-27 22:20:04.000000000 -0300
@@ -0,0 +1,37 @@
+<?php
+
+require_once dirname(__FILE__).'/CredisTest.php';
+
+class CredisStandaloneTest extends CredisTest
+{
+
+ protected $useStandalone = TRUE;
+
+ public function testInvalidPersistentConnectionOnUnixSocket()
+ {
+ $this->credis->close();
+ $this->credis = new Credis_Client('unix://'.realpath(__DIR__).'/redis.sock',0,null,'persistent');
+ $this->credis->forceStandalone();
+ $this->setExpectedException('CredisException','Persistent connections to UNIX sockets are not supported in standalone mode.');
+ $this->credis->connect();
+ }
+ public function testPersistentConnectionsOnStandAloneTcpConnection()
+ {
+ $this->credis->close();
+ $this->credis = new Credis_Client('tcp://'.$this->config[0]->host.':'.$this->config[0]->port.'/persistent');
+ $this->credis->forceStandalone();
+ $this->credis->set('key','value');
+ $this->assertEquals('value',$this->credis->get('key'));
+ }
+ public function testPersistentvsNonPersistent() {}
+ public function testStandAloneArgumentsExtra()
+ {
+ $this->assertTrue($this->credis->hMSet('hash', array('field1' => 'value1', 'field2' => 'value2'), 'field3', 'value3'));
+ $this->assertEquals(array('value1','value2','value3'), $this->credis->hMGet('hash', array('field1','field2','field3')));
+ }
+ public function testStandAloneMultiPipelineThrowsException()
+ {
+ $this->setExpectedException('CredisException','A pipeline is already in use and only one pipeline is supported.');
+ $this->credis->pipeline()->pipeline();
+ }
+}
--- Magento-CE-2.0.5/vendor/colinmollenhour/credis/tests/CredisTest.php 1969-12-31 21:00:00.000000000 -0300
+++ Magento-CE-2.0.6/vendor/colinmollenhour/credis/tests/CredisTest.php 2015-11-27 22:20:04.000000000 -0300
@@ -0,0 +1,391 @@
+<?php
+
+require_once dirname(__FILE__).'/../Client.php';
+
+class CredisTest extends PHPUnit_Framework_TestCase
+{
+
+ /** @var Credis_Client */
+ protected $credis;
+
+ protected $config;
+
+ protected $useStandalone = FALSE;
+
+ protected function setUp()
+ {
+ if($this->config === NULL) {
+ $configFile = dirname(__FILE__).'/redis_config.json';
+ if( ! file_exists($configFile) || ! ($config = file_get_contents($configFile))) {
+ $this->markTestSkipped('Could not load '.$configFile);
+ return;
+ }
+ $this->config = json_decode($config);
+ if(count($this->config) < 6) {
+ $this->markTestSkipped('Config file '.$configFile.' should contain at least 6 entries');
+ return;
+ }
+ }
+ $this->credis = new Credis_Client($this->config[0]->host, $this->config[0]->port, $this->config[0]->timeout);
+ if($this->useStandalone) {
+ $this->credis->forceStandalone();
+ } else if ( ! extension_loaded('redis')) {
+ $this->fail('The Redis extension is not loaded.');
+ }
+ $this->credis->flushDb();
+ }
+ protected function tearDown()
+ {
+ if($this->credis) {
+ $this->credis->close();
+ $this->credis = NULL;
+ }
+ }
+ public function testFlush()
+ {
+ $this->credis->set('foo','FOO');
+ $this->assertTrue($this->credis->flushDb());
+ $this->assertFalse($this->credis->get('foo'));
+ }
+
+ public function testReadTimeout()
+ {
+ $this->credis->setReadTimeout(0.0001);
+ try {
+ $this->credis->save();
+ $this->fail('Expected exception (read should timeout since disk sync should take longer than 0.0001 seconds).');
+ } catch(CredisException $e) {
+ }
+ $this->credis->setReadTimeout(10);
+ }
+
+ public function testPHPRedisReadTimeout()
+ {
+ try {
+ $this->credis->setReadTimeout(-1);
+ } catch(CredisException $e) {
+ $this->fail('setReadTimeout should accept -1 as timeout value');
+ }
+ try {
+ $this->credis->setReadTimeout(-2);
+ $this->fail('setReadTimeout should not accept values less than -1');
+ } catch(CredisException $e) {
+ }
+ }
+
+ public function testScalars()
+ {
+ // Basic get/set
+ $this->credis->set('foo','FOO');
+ $this->assertEquals('FOO', $this->credis->get('foo'));
+ $this->assertFalse($this->credis->get('nil'));
+
+ // Empty string
+ $this->credis->set('empty','');
+ $this->assertEquals('', $this->credis->get('empty'));
+
+ // UTF-8 characters
+ $utf8str = str_repeat("quarter: ¼, micro: µ, thorn: Þ, ", 500);
+ $this->credis->set('utf8',$utf8str);
+ $this->assertEquals($utf8str, $this->credis->get('utf8'));
+
+ // Array
+ $this->assertTrue($this->credis->mSet(array('bar' => 'BAR', 'apple' => 'red')));
+ $mGet = $this->credis->mGet(array('foo','bar','empty'));
+ $this->assertTrue(in_array('FOO', $mGet));
+ $this->assertTrue(in_array('BAR', $mGet));
+ $this->assertTrue(in_array('', $mGet));
+
+ // Non-array
+ $mGet = $this->credis->mGet('foo','bar');
+ $this->assertTrue(in_array('FOO', $mGet));
+ $this->assertTrue(in_array('BAR', $mGet));
+
+ // Delete strings, null response
+ $this->assertEquals(2, $this->credis->del('foo','bar'));
+ $this->assertFalse($this->credis->get('foo'));
+ $this->assertFalse($this->credis->get('bar'));
+
+ // Long string
+ $longString = str_repeat(md5('asd'), 4096); // 128k (redis.h REDIS_INLINE_MAX_SIZE = 64k)
+ $this->assertTrue($this->credis->set('long', $longString));
+ $this->assertEquals($longString, $this->credis->get('long'));
+ }
+
+ public function testSets()
+ {
+ // Multiple arguments
+ $this->assertEquals(2, $this->credis->sAdd('myset', 'Hello', 'World'));
+
+ // Array Arguments
+ $this->assertEquals(1, $this->credis->sAdd('myset', array('Hello','Cruel','World')));
+
+ // Non-empty set
+ $members = $this->credis->sMembers('myset');
+ $this->assertEquals(3, count($members));
+ $this->assertTrue(in_array('Hello', $members));
+
+ // Empty set
+ $this->assertEquals(array(), $this->credis->sMembers('noexist'));
+ }
+
+ public function testSortedSets()
+ {
+ $this->assertEquals(1, $this->credis->zAdd('myset', 1, 'Hello'));
+ $this->assertEquals(1, $this->credis->zAdd('myset', 2.123, 'World'));
+ $this->assertEquals(1, $this->credis->zAdd('myset', 10, 'And'));
+ $this->assertEquals(1, $this->credis->zAdd('myset', 11, 'Goodbye'));
+
+ $this->assertEquals(4, count($this->credis->zRangeByScore('myset', '-inf', '+inf')));
+ $this->assertEquals(2, count($this->credis->zRangeByScore('myset', '1', '9')));
+
+ $range = $this->credis->zRangeByScore('myset', '-inf', '+inf', array('limit' => array(1, 2)));
+ $this->assertEquals(2, count($range));
+ $this->assertEquals('World', $range[0]);
+ $this->assertEquals('And', $range[1]);
+
+ $range = $this->credis->zRangeByScore('myset', '-inf', '+inf', array('withscores' => true, 'limit' => array(1, 2)));
+ $this->assertEquals(2, count($range));
+ $this->assertTrue(array_key_exists('World', $range));
+ $this->assertEquals(2.123, $range['World']);
+ $this->assertTrue(array_key_exists('And', $range));
+ $this->assertEquals(10, $range['And']);
+
+ $range = $this->credis->zRangeByScore('myset', 10, '+inf', array('withscores' => true));
+ $this->assertEquals(2, count($range));
+ $this->assertTrue(array_key_exists('And', $range));
+ $this->assertEquals(10, $range['And']);
+ $this->assertTrue(array_key_exists('Goodbye', $range));
+ $this->assertEquals(11, $range['Goodbye']);
+
+ // withscores-option is off
+ $range = $this->credis->zRangeByScore('myset', '-inf', '+inf', array('withscores'));
+ $this->assertEquals(4, count($range));
+ $this->assertEquals(range(0, 3), array_keys($range)); // expecting numeric array without scores
+
+ $range = $this->credis->zRangeByScore('myset', '-inf', '+inf', array('withscores' => false));
+ $this->assertEquals(4, count($range));
+ $this->assertEquals(range(0, 3), array_keys($range));
+
+ }
+
+ public function testHashes()
+ {
+ $this->assertEquals(1, $this->credis->hSet('hash','field1','foo'));
+ $this->assertEquals(0, $this->credis->hSet('hash','field1','foo'));
+ $this->assertEquals('foo', $this->credis->hGet('hash','field1'));
+ $this->assertEquals(NULL, $this->credis->hGet('hash','x'));
+ $this->assertTrue($this->credis->hMSet('hash', array('field2' => 'Hello', 'field3' => 'World')));
+ $this->assertEquals(array('foo','Hello',FALSE), $this->credis->hMGet('hash', array('field1','field2','nilfield')));
+ $this->assertEquals(array(), $this->credis->hGetAll('nohash'));
+ $this->assertEquals(array('field1' => 'foo', 'field2' => 'Hello', 'field3' => 'World'), $this->credis->hGetAll('hash'));
+
+ // Test long hash values
+ $longString = str_repeat(md5('asd'), 4096); // 128k (redis.h REDIS_INLINE_MAX_SIZE = 64k)
+ $this->assertEquals(1, $this->credis->hMSet('long_hash', array('count' => 1, 'data' => $longString)), 'Set long hash value');
+ $this->assertEquals($longString, $this->credis->hGet('long_hash', 'data'), 'Get long hash value');
+ }
+
+ public function testFalsey()
+ {
+ $this->assertEquals(Credis_Client::TYPE_NONE, $this->credis->type('foo'));
+ }
+
+ public function testPipeline()
+ {
+ $longString = str_repeat(md5('asd')."\r\n", 500);
+ $reply = $this->credis->pipeline()
+ ->set('a', 123)
+ ->get('a')
+ ->sAdd('b', 123)
+ ->sMembers('b')
+ ->set('empty','')
+ ->get('empty')
+ ->set('big', $longString)
+ ->get('big')
+ ->exec();
+ $this->assertEquals(array(
+ TRUE, 123, 1, array(123), TRUE, '', TRUE, $longString
+ ), $reply);
+
+ $this->assertEquals(array(), $this->credis->pipeline()->exec());
+ }
+
+ public function testTransaction()
+ {
+ $reply = $this->credis->multi()
+ ->incr('foo')
+ ->incr('bar')
+ ->exec();
+ $this->assertEquals(array(1,1), $reply);
+
+ $reply = $this->credis->pipeline()->multi()
+ ->incr('foo')
+ ->incr('bar')
+ ->exec();
+ $this->assertEquals(array(2,2), $reply);
+
+ $reply = $this->credis->multi()->pipeline()
+ ->incr('foo')
+ ->incr('bar')
+ ->exec();
+ $this->assertEquals(array(3,3), $reply);
+
+ $reply = $this->credis->multi()
+ ->set('a', 3)
+ ->lpop('a')
+ ->exec();
+ $this->assertEquals(2, count($reply));
+ $this->assertEquals(TRUE, $reply[0]);
+ $this->assertFalse($reply[1]);
+ }
+
+ public function testServer()
+ {
+ $this->assertArrayHasKey('used_memory', $this->credis->info());
+ $this->assertArrayHasKey('maxmemory', $this->credis->config('GET', 'maxmemory'));
+ }
+
+ public function testScripts()
+ {
+ $this->assertNull($this->credis->evalSha('1111111111111111111111111111111111111111'));
+ $this->assertEquals(3, $this->credis->eval('return 3'));
+ $this->assertEquals('09d3822de862f46d784e6a36848b4f0736dda47a', $this->credis->script('load', 'return 3'));
+ $this->assertEquals(3, $this->credis->evalSha('09d3822de862f46d784e6a36848b4f0736dda47a'));
+
+ $this->credis->set('foo','FOO');
+ $this->assertEquals('FOOBAR', $this->credis->eval("return redis.call('get', KEYS[1])..ARGV[1]", 'foo', 'BAR'));
+
+ $this->assertEquals(array(1,2,'three'), $this->credis->eval("return {1,2,'three'}"));
+ try {
+ $this->credis->eval('this-is-not-lua');
+ $this->fail('Expected exception on invalid script.');
+ } catch(CredisException $e) {
+ }
+ }
+ public function testPubsub()
+ {
+ $timeout = 2;
+ $time = time();
+ $this->credis->setReadTimeout($timeout);
+ try {
+ $testCase = $this;
+ $this->credis->pSubscribe(array('foobar','test*'), function ($credis, $pattern, $channel, $message) use ($testCase, &$time) {
+ $time = time(); // Reset timeout
+ // Test using: redis-cli publish foobar blah
+ $testCase->assertEquals('blah', $message);
+ });
+ $this->fail('pSubscribe should not return.');
+ } catch (CredisException $e) {
+ $this->assertEquals($timeout, time() - $time);
+ if ($this->useStandalone) { // phpredis does not distinguish between timed out and disconnected
+ $this->assertEquals($e->getCode(), CredisException::CODE_TIMED_OUT);
+ } else {
+ $this->assertEquals($e->getCode(), CredisException::CODE_DISCONNECTED);
+ }
+ }
+
+ // Perform a new subscription. Client should have either unsubscribed or disconnected
+ $timeout = 2;
+ $time = time();
+ $this->credis->setReadTimeout($timeout);
+ try {
+ $testCase = $this;
+ $this->credis->subscribe('foobar', function ($credis, $channel, $message) use ($testCase, &$time) {
+ $time = time(); // Reset timeout
+ // Test using: redis-cli publish foobar blah
+ $testCase->assertEquals('blah', $message);
+ });
+ $this->fail('subscribe should not return.');
+ } catch (CredisException $e) {
+ $this->assertEquals($timeout, time() - $time);
+ if ($this->useStandalone) { // phpredis does not distinguish between timed out and disconnected
+ $this->assertEquals($e->getCode(), CredisException::CODE_TIMED_OUT);
+ } else {
+ $this->assertEquals($e->getCode(), CredisException::CODE_DISCONNECTED);
+ }
+ }
+ }
+ public function testDb()
+ {
+ $this->tearDown();
+ $this->credis = new Credis_Client($this->config[0]->host, $this->config[0]->port, $this->config[0]->timeout,false,1);
+ $this->assertTrue($this->credis->set('database',1));
+ $this->credis->close();
+ $this->credis = new Credis_Client($this->config[0]->host, $this->config[0]->port, $this->config[0]->timeout,false,0);
+ $this->assertFalse($this->credis->get('database'));
+ $this->credis = new Credis_Client($this->config[0]->host, $this->config[0]->port, $this->config[0]->timeout,false,1);
+ $this->assertEquals(1,$this->credis->get('database'));
+
+ }
+
+ public function testPassword()
+ {
+ $this->tearDown();
+ $this->assertObjectHasAttribute('password',$this->config[4]);
+ $this->credis = new Credis_Client($this->config[4]->host, $this->config[4]->port, $this->config[4]->timeout,false,0,$this->config[4]->password);
+ $this->assertInstanceOf('Credis_Client',$this->credis->connect());
+ $this->assertTrue($this->credis->set('key','value'));
+ $this->credis->close();
+ $this->credis = new Credis_Client($this->config[4]->host, $this->config[4]->port, $this->config[4]->timeout,false,0,'wrongpassword');
+ $this->credis->connect();
+ $this->assertFalse($this->credis->set('key','value'));
+ $this->assertFalse($this->credis->auth('anotherwrongpassword'));
+ $this->assertTrue($this->credis->auth('thepassword'));
+ $this->assertTrue($this->credis->set('key','value'));
+ }
+ public function testGettersAndSetters()
+ {
+ $this->assertEquals($this->credis->getHost(),$this->config[0]->host);
+ $this->assertEquals($this->credis->getPort(),$this->config[0]->port);
+ $this->assertEquals($this->credis->getSelectedDb(),0);
+ $this->assertTrue($this->credis->select(2));
+ $this->assertEquals($this->credis->getSelectedDb(),2);
+ $this->assertTrue($this->credis->isConnected());
+ $this->credis->close();
+ $this->assertFalse($this->credis->isConnected());
+ $this->credis = new Credis_Client($this->config[0]->host,$this->config[0]->port,null,'persistenceId');
+ $this->assertEquals('persistenceId',$this->credis->getPersistence());
+ $this->credis = new Credis_Client('localhost', 12345);
+ $this->credis->setMaxConnectRetries(1);
+ $this->setExpectedException('CredisException','Connection to Redis failed after 2 failures.');
+ $this->credis->connect();
+ }
+
+ public function testConnectionStrings()
+ {
+ $this->credis->close();
+ $this->credis = new Credis_Client('tcp://'.$this->config[0]->host.':'.$this->config[0]->port);
+ $this->assertEquals($this->credis->getHost(),$this->config[0]->host);
+ $this->assertEquals($this->credis->getPort(),$this->config[0]->port);
+ $this->credis = new Credis_Client('tcp://'.$this->config[0]->host);
+ $this->assertEquals($this->credis->getPort(),$this->config[0]->port);
+ $this->credis = new Credis_Client('tcp://'.$this->config[0]->host.':'.$this->config[0]->port.'/abc123');
+ $this->assertEquals('abc123',$this->credis->getPersistence());
+ $this->credis = new Credis_Client(realpath(__DIR__).'/redis.sock',0,null,'persistent');
+ $this->credis->connect();
+ $this->credis->set('key','value');
+ $this->assertEquals('value',$this->credis->get('key'));
+ }
+
+ public function testInvalidTcpConnectionstring()
+ {
+ $this->credis->close();
+ $this->setExpectedException('CredisException','Invalid host format; expected tcp://host[:port][/persistence_identifier]');
+ $this->credis = new Credis_Client('tcp://'.$this->config[0]->host.':abc');
+ }
+
+ public function testInvalidUnixSocketConnectionstring()
+ {
+ $this->credis->close();
+ $this->setExpectedException('CredisException','Invalid unix socket format; expected unix:///path/to/redis.sock');
+ $this->credis = new Credis_Client('unix://path/to/redis.sock');
+ }
+
+ public function testForceStandAloneAfterEstablishedConnection()
+ {
+ $this->credis->connect();
+ $this->setExpectedException('CredisException','Cannot force Credis_Client to use standalone PHP driver after a connection has already been established.');
+ $this->credis->forceStandalone();
+ }
+}
\ No hay ningún carácter de nueva línea al final del archivo
--- Magento-CE-2.0.5/vendor/colinmollenhour/credis/tests/.gitignore 1969-12-31 21:00:00.000000000 -0300
+++ Magento-CE-2.0.6/vendor/colinmollenhour/credis/tests/.gitignore 2015-11-27 22:20:04.000000000 -0300
@@ -0,0 +1,3 @@
+*.pid
+*.rdb
+_reports/*
--- Magento-CE-2.0.5/vendor/colinmollenhour/credis/tests/keys.test 1969-12-31 21:00:00.000000000 -0300
+++ Magento-CE-2.0.6/vendor/colinmollenhour/credis/tests/keys.test 2015-11-27 22:20:04.000000000 -0300
@@ -0,0 +1,100 @@
+4a51973817aa0:4a51973817ab6
+4a51973817b1b:4a51973817b29
+4a51973817b43:4a51973817b50
+4a51973817b61:4a51973817b6e
+4a51973817b8a:4a51973817b96
+4a51973817bad:4a51973817bba
+4a51973817bd2:4a51973817bde
+4a51973817bf6:4a51973817c01
+4a51973817c19:4a51973817c24
+4a51973817c3d:4a51973817c48
+4a51973817c60:4a51973817c6b
+4a51973817c83:4a51973817c8e
+4a51973817ca7:4a51973817cb2
+4a51973817cca:4a51973817cd5
+4a51973817ced:4a51973817cf8
+4a51973817d10:4a51973817d1c
+4a51973817d33:4a51973817d3f
+4a51973817d56:4a51973817d62
+4a51973817d7a:4a51973817d86
+4a51973817d9d:4a51973817da9
+4a51973817dc1:4a51973817dcd
+4a51973817de5:4a51973817df0
+4a51973817e08:4a51973817e13
+4a51973817e2b:4a51973817e37
+4a51973817e4f:4a51973817e5a
+4a51973817e72:4a51973817e7d
+4a51973817e95:4a51973817ea1
+4a51973817eb8:4a51973817ec4
+4a51973817edb:4a51973817ee7
+4a51973817eff:4a51973817f0b
+4a51973817f22:4a51973817f2e
+4a51973817f45:4a51973817f51
+4a51973817f69:4a51973817f74
+4a51973817f8c:4a51973817f98
+4a51973817faf:4a51973817fbc
+4a51973817fd4:4a51973817fdf
+4a51973817ff7:4a51973818002
+4a5197381801a:4a51973818026
+4a5197381803d:4a51973818049
+4a51973818060:4a5197381806c
+4a51973818084:4a51973818090
+4a519738180a7:4a519738180b3
+4a519738180ca:4a519738180d6
+4a519738180ee:4a519738180f9
+4a51973818111:4a5197381811c
+4a51973818134:4a5197381813f
+4a51973818158:4a51973818163
+4a5197381817b:4a51973818186
+4a5197381819e:4a519738181a9
+4a519738181c2:4a519738181cd
+4a519738181e5:4a519738181f0
+4a51973818208:4a51973818214
+4a5197381822c:4a51973818237
+4a5197381824f:4a5197381825a
+4a51973818272:4a5197381827e
+4a51973818296:4a519738182a1
+4a519738182b9:4a519738182c4
+4a519738182dc:4a519738182e8
+4a519738182ff:4a5197381830b
+4a51973818322:4a5197381832e
+4a51973818346:4a51973818351
+4a51973818369:4a51973818374
+4a5197381838c:4a51973818397
+4a519738183b0:4a519738183bc
+4a519738183d3:4a519738183df
+4a519738183f6:4a51973818403
+4a5197381841b:4a51973818426
+4a5197381843d:4a51973818449
+4a51973818461:4a5197381846d
+4a51973818484:4a51973818490
+4a519738184a7:4a519738184b3
+4a519738184cb:4a519738184d7
+4a519738184ee:4a519738184fa
+4a51973818511:4a5197381851d
+4a51973818535:4a51973818540
+4a51973818558:4a51973818563
+4a5197381857b:4a51973818586
+4a5197381859e:4a519738185aa
+4a519738185c2:4a519738185ce
+4a519738185e5:4a519738185f2
+4a51973818609:4a51973818615
+4a5197381862c:4a51973818637
+4a51973818650:4a5197381865b
+4a51973818673:4a5197381867e
+4a51973818696:4a519738186a1
+4a519738186b9:4a519738186c5
+4a519738186dd:4a519738186e8
+4a519738186ff:4a5197381870f
+4a51973818721:4a51973818730
+4a51973818747:4a51973818753
+4a5197381876a:4a51973818776
+4a5197381878e:4a5197381879a
+4a519738187b1:4a519738187bd
+4a519738187d5:4a519738187e1
+4a519738187f9:4a51973818804
+4a5197381881c:4a51973818827
+4a51973818840:4a5197381884b
+4a51973818863:4a5197381886e
+4a51973818886:4a51973818892
+4a519738188aa:4a519738188b5
\ No hay ningún carácter de nueva línea al final del archivo
--- Magento-CE-2.0.5/vendor/colinmollenhour/credis/tests/redis-2.conf 1969-12-31 21:00:00.000000000 -0300
+++ Magento-CE-2.0.6/vendor/colinmollenhour/credis/tests/redis-2.conf 2015-11-27 22:20:04.000000000 -0300
@@ -0,0 +1,5 @@
+daemonize yes
+port 6380
+dir ./
+pidfile redis-2.pid
+timeout 300
\ No hay ningún carácter de nueva línea al final del archivo
--- Magento-CE-2.0.5/vendor/colinmollenhour/credis/tests/redis-3.conf 1969-12-31 21:00:00.000000000 -0300
+++ Magento-CE-2.0.6/vendor/colinmollenhour/credis/tests/redis-3.conf 2015-11-27 22:20:04.000000000 -0300
@@ -0,0 +1,5 @@
+daemonize yes
+port 6381
+dir ./
+pidfile redis-3.pid
+timeout 300
\ No hay ningún carácter de nueva línea al final del archivo
--- Magento-CE-2.0.5/vendor/colinmollenhour/credis/tests/redis-4.conf 1969-12-31 21:00:00.000000000 -0300
+++ Magento-CE-2.0.6/vendor/colinmollenhour/credis/tests/redis-4.conf 2015-11-27 22:20:04.000000000 -0300
@@ -0,0 +1,5 @@
+daemonize yes
+port 6382
+dir ./
+pidfile redis-4.pid
+timeout 300
\ No hay ningún carácter de nueva línea al final del archivo
--- Magento-CE-2.0.5/vendor/colinmollenhour/credis/tests/redis-auth.conf 1969-12-31 21:00:00.000000000 -0300
+++ Magento-CE-2.0.6/vendor/colinmollenhour/credis/tests/redis-auth.conf 2015-11-27 22:20:04.000000000 -0300
@@ -0,0 +1,6 @@
+daemonize yes
+port 6383
+dir ./
+pidfile redis-auth.pid
+timeout 300
+requirepass "thepassword"
\ No hay ningún carácter de nueva línea al final del archivo
--- Magento-CE-2.0.5/vendor/colinmollenhour/credis/tests/redis_config.json 1969-12-31 21:00:00.000000000 -0300
+++ Magento-CE-2.0.6/vendor/colinmollenhour/credis/tests/redis_config.json 2015-11-27 22:20:04.000000000 -0300
@@ -0,0 +1,9 @@
+[
+ {"host":"127.0.0.1","port":6379,"timeout":2.5,"alias":"master","master":true},
+ {"host":"127.0.0.1","port":6380,"timeout":2.5,"alias":"second"},
+ {"host":"127.0.0.1","port":6381,"timeout":2.5,"alias":"third"},
+ {"host":"127.0.0.1","port":6382,"timeout":2.5,"alias":"fourth"},
+ {"host":"127.0.0.1","port":6383,"timeout":2.5,"alias":"auth", "password": "thepassword"},
+ {"host":"127.0.0.1","port":6384,"timeout":2.5,"alias":"socket"},
+ {"host":"127.0.0.1","port":6385,"timeout":2.5,"alias":"slave"}
+]
\ No hay ningún carácter de nueva línea al final del archivo
--- Magento-CE-2.0.5/vendor/colinmollenhour/credis/tests/redis-master.conf 1969-12-31 21:00:00.000000000 -0300
+++ Magento-CE-2.0.6/vendor/colinmollenhour/credis/tests/redis-master.conf 2015-11-27 22:20:04.000000000 -0300
@@ -0,0 +1,5 @@
+daemonize yes
+port 6379
+dir ./
+pidfile redis-master.pid
+timeout 300
--- Magento-CE-2.0.5/vendor/colinmollenhour/credis/tests/redis-sentinel.conf 1969-12-31 21:00:00.000000000 -0300
+++ Magento-CE-2.0.6/vendor/colinmollenhour/credis/tests/redis-sentinel.conf 2015-11-27 22:20:04.000000000 -0300
@@ -0,0 +1,6 @@
+daemonize yes
+dir ./
+pidfile redis-sentinel.pid
+port 26379
+sentinel monitor mymaster 127.0.0.1 6379 1
+sentinel monitor masterdown 127.0.0.1 6399 1
\ No hay ningún carácter de nueva línea al final del archivo
--- Magento-CE-2.0.5/vendor/colinmollenhour/credis/tests/redis-slave.conf 1969-12-31 21:00:00.000000000 -0300
+++ Magento-CE-2.0.6/vendor/colinmollenhour/credis/tests/redis-slave.conf 2015-11-27 22:20:04.000000000 -0300
@@ -0,0 +1,6 @@
+daemonize yes
+port 6385
+dir ./
+pidfile redis-slave.pid
+timeout 300
+slaveof 127.0.0.1 6379
\ No hay ningún carácter de nueva línea al final del archivo
--- Magento-CE-2.0.5/vendor/colinmollenhour/credis/tests/redis-socket.conf 1969-12-31 21:00:00.000000000 -0300
+++ Magento-CE-2.0.6/vendor/colinmollenhour/credis/tests/redis-socket.conf 2015-11-27 22:20:04.000000000 -0300
@@ -0,0 +1,6 @@
+daemonize yes
+port 6384
+dir ./
+unixsocket redis.sock
+unixsocketperm 755
+pidfile redis-socket.pid
\ No hay ningún carácter de nueva línea al final del archivo
--- Magento-CE-2.0.5/vendor/colinmollenhour/credis/tests/sentinel_config.json 1969-12-31 21:00:00.000000000 -0300
+++ Magento-CE-2.0.6/vendor/colinmollenhour/credis/tests/sentinel_config.json 2015-11-27 22:20:04.000000000 -0300
@@ -0,0 +1 @@
+{"host":"127.0.0.1","port":26379,"clustername":"mymaster","downclustername":"masterdown"}
\ No hay ningún carácter de nueva línea al final del archivo
--- Magento-CE-2.0.5/vendor/colinmollenhour/credis/tests/SetUpBefore.php 1969-12-31 21:00:00.000000000 -0300
+++ Magento-CE-2.0.6/vendor/colinmollenhour/credis/tests/SetUpBefore.php 2015-11-27 22:20:04.000000000 -0300
@@ -0,0 +1,35 @@
+<?php
+class SetUpBefore extends PHPUnit_Framework_TestCase
+{
+ public static function setUpBeforeClass()
+ {
+ if(preg_match('/^WIN/',strtoupper(PHP_OS))){
+ echo "Unit tests will not work automatically on Windows. Please setup all Redis instances manually:".PHP_EOL;
+ echo "\tredis-server redis-master.conf".PHP_EOL;
+ echo "\tredis-server redis-slave.conf".PHP_EOL;
+ echo "\tredis-server redis-2.conf".PHP_EOL;
+ echo "\tredis-server redis-3.conf".PHP_EOL;
+ echo "\tredis-server redis-4.conf".PHP_EOL;
+ echo "\tredis-server redis-auth.conf".PHP_EOL;
+ echo "\tredis-server redis-socket.conf".PHP_EOL;
+ echo "\tredis-sentinel redis-sentinel.conf".PHP_EOL.PHP_EOL;
+ } else {
+ chdir(__DIR__);
+ $directoryIterator = new DirectoryIterator(__DIR__);
+ foreach($directoryIterator as $item){
+ if(!$item->isfile() || !preg_match('/^redis\-(.+)\.conf$/',$item->getFilename()) || $item->getFilename() == 'redis-sentinel.conf'){
+ continue;
+ }
+ exec('redis-server '.$item->getFilename());
+ }
+ copy('redis-master.conf','redis-master.conf.bak');
+ copy('redis-slave.conf','redis-slave.conf.bak');
+ copy('redis-sentinel.conf','redis-sentinel.conf.bak');
+ exec('redis-sentinel redis-sentinel.conf');
+ }
+ }
+ public function testFoo()
+ {
+ $this->assertTrue(true);
+ }
+}
\ No hay ningún carácter de nueva línea al final del archivo
--- Magento-CE-2.0.5/vendor/colinmollenhour/credis/tests/TearDownAfter.php 1969-12-31 21:00:00.000000000 -0300
+++ Magento-CE-2.0.6/vendor/colinmollenhour/credis/tests/TearDownAfter.php 2015-11-27 22:20:04.000000000 -0300
@@ -0,0 +1,35 @@
+<?php
+class TearDownAfter extends PHPUnit_Framework_TestCase
+{
+ public static function tearDownAfterClass()
+ {
+ if(preg_match('/^WIN/',strtoupper(PHP_OS))){
+ echo "Please kill all Redis instances manually:".PHP_EOL;
+ } else {
+ chdir(__DIR__);
+ $directoryIterator = new DirectoryIterator(__DIR__);
+ foreach($directoryIterator as $item){
+ if(!$item->isfile() || !preg_match('/^redis\-(.+)\.pid$/',$item->getFilename())){
+ continue;
+ }
+ $pid = trim(file_get_contents($item->getFilename()));
+ if(function_exists('posix_kill')){
+ posix_kill($pid,15);
+ } else {
+ exec('kill '.$pid);
+ }
+ }
+ unlink('dump.rdb');
+ unlink('redis-master.conf');
+ unlink('redis-slave.conf');
+ unlink('redis-sentinel.conf');
+ rename('redis-master.conf.bak','redis-master.conf');
+ rename('redis-slave.conf.bak','redis-slave.conf');
+ rename('redis-sentinel.conf.bak','redis-sentinel.conf');
+ }
+ }
+ public function testFoo()
+ {
+ $this->assertTrue(true);
+ }
+}
\ No hay ningún carácter de nueva línea al final del archivo
--- Magento-CE-2.0.5/vendor/colinmollenhour/php-redis-session-abstract/composer.json 1969-12-31 21:00:00.000000000 -0300
+++ Magento-CE-2.0.6/vendor/colinmollenhour/php-redis-session-abstract/composer.json 2016-02-03 15:13:49.000000000 -0300
@@ -0,0 +1,23 @@
+{
+ "name":"colinmollenhour/php-redis-session-abstract",
+ "type":"library",
+ "license":"BSD-3-Clause",
+ "homepage":"https://github.com/colinmollenhour/php-redis-session-abstract",
+ "description":"A Redis-based session handler with optimistic locking",
+ "authors":[
+ {
+ "name":"Colin Mollenhour"
+ }
+ ],
+ "require":{
+ "php": "~5.5.0|~5.6.0|~7.0.0",
+ "magento/zendframework1": "1.12.16",
+ "colinmollenhour/credis":"1.6"
+
+ },
+ "autoload": {
+ "psr-0": {
+ "Cm\\RedisSession\\": "src/"
+ }
+ }
+}
--- Magento-CE-2.0.5/vendor/colinmollenhour/php-redis-session-abstract/README.md 1969-12-31 21:00:00.000000000 -0300
+++ Magento-CE-2.0.6/vendor/colinmollenhour/php-redis-session-abstract/README.md 2016-02-03 15:13:49.000000000 -0300
@@ -0,0 +1,68 @@
+# php-redis-session-abstract #
+
+### A Redis-based session handler with optimistic locking. ###
+
+#### Features: ####
+- When a session's data size exceeds the compression threshold the session data will be compressed.
+- Compression libraries supported are 'gzip', 'lzf', 'lz4', and 'snappy'.
+-- Gzip is the slowest but offers the best compression ratios.
+-- Lzf can be installed easily via PECL.
+-- Lz4 is supported by HHVM.
+- Compression can be enabled, disabled, or reconfigured on the fly with no loss of session data.
+- Expiration is handled by Redis; no garbage collection needed.
+- Logs when sessions are not written due to not having or losing their lock.
+- Limits the number of concurrent lock requests.
+- Detects inactive waiting processes to prevent false-positives in concurrency throttling.
+- Detects crashed processes to prevent session deadlocks (Linux only).
+- Gives shorter session lifetimes to bots and crawlers to reduce wasted resources.
+- Locking can be disabled entirely
+- Requires PHP >= 5.3. Yes, this is a feature. You're welcome. ;)
+
+#### Locking Algorithm Properties: ####
+- Only one process may get a write lock on a session.
+- A process may lose it's lock if another process breaks it, in which case the session will not be written.
+- The lock may be broken after `BREAK_AFTER` seconds and the process that gets the lock is indeterminate.
+- Only `MAX_CONCURRENCY` processes may be waiting for a lock for the same session or else a ConcurrentConnectionsExceededException will be thrown.
+
+### Compression ##
+
+Session data compresses very well so using compression is a great way to increase your capacity without
+dedicating a ton of RAM to Redis. Compression can be disabled by setting the `compression_threshold` to 0.
+The default `compression threshold` is 2048 bytes so any session data equal to or larger than this size
+will be compressed with the chosen `compression_lib` which is 'gzip' by default. However, both lzf and
+snappy offer much faster compression with comparable compression ratios so I definitely recommend using
+one of these if you have root. lzf is easy to install via pecl:
+
+ sudo pecl install lzf
+
+_NOTE:_ If using suhosin with session data encryption enabled (default is `suhosin.session.encrypt=on`), two things:
+
+1. You will probably get very poor compression ratios.
+2. Lzf fails to compress the encrypted data in my experience. No idea why...
+
+If any compression lib fails to compress the session data an error will be logged in `system.log` and the
+session will still be saved without compression. If you have `suhosin.session.encrypt=on` I would either
+recommend disabling it (unless you are on a shared host since Magento does it's own session validation already)
+or disable compression or at least don't use lzf with encryption enabled.
+
+## Bot Detection ##
+
+Bots and crawlers typically do not use cookies which means you may be storing thousands of sessions that
+serve no purpose. Even worse, an attacker could use your limited session storage against you by flooding
+your backend, thereby causing your legitimate sessions to get evicted. However, you don't want to misidentify
+a user as a bot and kill their session unintentionally. This module uses both a regex as well as a
+counter on the number of writes against the session to determine the session lifetime.
+
+## Using with [Cm_Cache_Backend_Redis](https://github.com/colinmollenhour/Cm_Cache_Backend_Redis) ##
+
+Using Cm_RedisSession alongside Cm_Cache_Backend_Redis should be no problem at all. The main thing to
+keep in mind is that if both the cache and the sessions are using the same database, flushing the cache
+backend would also flush the sessions! So, don't use the same 'db' number for both if running only one
+instance of Redis. However, using a separate Redis instance for each is recommended to make sure that
+one or the other can't run wild consuming space and cause evictions for the other. For example,
+configure two instances each with 100M maxmemory rather than one instance with 200M maxmemory.
+
+## License ##
+
+ @copyright Copyright (c) 2013 Colin Mollenhour (http://colin.mollenhour.com)
+ This project is licensed under the "New BSD" license (see source).
--- Magento-CE-2.0.5/vendor/colinmollenhour/php-redis-session-abstract/src/Cm/RedisSession/ConcurrentConnectionsExceededException.php 1969-12-31 21:00:00.000000000 -0300
+++ Magento-CE-2.0.6/vendor/colinmollenhour/php-redis-session-abstract/src/Cm/RedisSession/ConcurrentConnectionsExceededException.php 2016-02-03 15:13:49.000000000 -0300
@@ -0,0 +1,35 @@
+<?php
+/*
+==New BSD License==
+
+Copyright (c) 2013, Colin Mollenhour
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ * The name of Colin Mollenhour may not be used to endorse or promote products
+ derived from this software without specific prior written permission.
+ * Redistributions in any form must not change the Cm_RedisSession namespace.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+namespace Cm\RedisSession;
+
+class ConcurrentConnectionsExceededException extends \Exception
+{
+}
--- Magento-CE-2.0.5/vendor/colinmollenhour/php-redis-session-abstract/src/Cm/RedisSession/ConnectionFailedException.php 1969-12-31 21:00:00.000000000 -0300
+++ Magento-CE-2.0.6/vendor/colinmollenhour/php-redis-session-abstract/src/Cm/RedisSession/ConnectionFailedException.php 2016-02-03 15:13:49.000000000 -0300
@@ -0,0 +1,35 @@
+<?php
+/*
+==New BSD License==
+
+Copyright (c) 2013, Colin Mollenhour
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ * The name of Colin Mollenhour may not be used to endorse or promote products
+ derived from this software without specific prior written permission.
+ * Redistributions in any form must not change the Cm_RedisSession namespace.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+namespace Cm\RedisSession;
+
+class ConnectionFailedException extends \Exception
+{
+}
--- Magento-CE-2.0.5/vendor/colinmollenhour/php-redis-session-abstract/src/Cm/RedisSession/Handler/ConfigInterface.php 1969-12-31 21:00:00.000000000 -0300
+++ Magento-CE-2.0.6/vendor/colinmollenhour/php-redis-session-abstract/src/Cm/RedisSession/Handler/ConfigInterface.php 2016-02-03 15:13:49.000000000 -0300
@@ -0,0 +1,160 @@
+<?php
+/*
+==New BSD License==
+
+Copyright (c) 2013, Colin Mollenhour
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ * The name of Colin Mollenhour may not be used to endorse or promote products
+ derived from this software without specific prior written permission.
+ * Redistributions in any form must not change the Cm_RedisSession namespace.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+namespace Cm\RedisSession\Handler;
+
+interface ConfigInterface
+{
+ /**
+ * Get log level
+ *
+ * @return int
+ */
+ public function getLogLevel();
+
+ /**
+ * Get host, can be absolute path if using unix socket
+ *
+ * @return string
+ */
+ public function getHost();
+
+ /**
+ * Get port
+ *
+ * @return int
+ */
+ public function getPort();
+
+ /**
+ * Get database number
+ *
+ * @return int
+ */
+ public function getDatabase();
+
+ /**
+ * Get password
+ *
+ * @return string
+ */
+ public function getPassword();
+
+ /**
+ * Get connection timeout
+ *
+ * @return float
+ */
+ public function getTimeout();
+
+ /**
+ * Get unique string for persistent connections, if empty persistent connection is not used
+ *
+ * @return string
+ */
+ public function getPersistentIdentifier();
+
+ /**
+ * Get compression threshold
+ *
+ * @return int
+ */
+ public function getCompressionThreshold();
+
+ /**
+ * Get compression library (gzip, lzf, lz4 or snappy)
+ *
+ * @return string
+ */
+ public function getCompressionLibrary();
+
+ /**
+ * Maximum number of processes that can wait for a lock on one session
+ *
+ * @return int
+ */
+ public function getMaxConcurrency();
+
+ /**
+ * Get the normal session lifetime
+ *
+ * @return int
+ */
+ public function getLifetime();
+
+ /**
+ * Get the maximum session lifetime
+ *
+ * @return int
+ */
+ public function getMaxLifetime();
+
+ /**
+ * Get the minimum session lifetime
+ *
+ * @return int
+ */
+ public function getMinLifetime();
+
+ /**
+ * Disable session locking entirely
+ *
+ * @return bool
+ */
+ public function getDisableLocking();
+
+ /**
+ * Get lifetime of session for bots on subsequent writes, 0 to disable
+ *
+ * @return int
+ */
+ public function getBotLifetime();
+
+ /**
+ * Get lifetime of session for bots on the first write, 0 to disable
+ *
+ * @return int
+ */
+ public function getBotFirstLifetime();
+
+ /**
+ * Get lifetime of session for non-bots on the first write, 0 to disable
+ *
+ * @return int
+ */
+ public function getFirstLifetime();
+
+ /**
+ * Get number of seconds to wait before trying to break the lock
+ *
+ * @return int
+ */
+ public function getBreakAfter();
+}
--- Magento-CE-2.0.5/vendor/colinmollenhour/php-redis-session-abstract/src/Cm/RedisSession/Handler/LoggerInterface.php 1969-12-31 21:00:00.000000000 -0300
+++ Magento-CE-2.0.6/vendor/colinmollenhour/php-redis-session-abstract/src/Cm/RedisSession/Handler/LoggerInterface.php 2016-02-03 15:13:49.000000000 -0300
@@ -0,0 +1,100 @@
+<?php
+/*
+==New BSD License==
+
+Copyright (c) 2013, Colin Mollenhour
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ * The name of Colin Mollenhour may not be used to endorse or promote products
+ derived from this software without specific prior written permission.
+ * Redistributions in any form must not change the Cm_RedisSession namespace.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+namespace Cm\RedisSession\Handler;
+
+interface LoggerInterface
+{
+ /**
+ * Emergency: system is unusable
+ */
+ const EMERGENCY = 0;
+
+ /**
+ * Alert: action must be taken immediately
+ */
+ const ALERT = 1;
+
+ /**
+ * Critical: critical conditions
+ */
+ const CRITICAL = 2;
+
+ /**
+ * Error: error conditions
+ */
+ const ERROR = 3;
+
+ /**
+ * Warning: warning conditions
+ */
+ const WARNING = 4;
+
+ /**
+ * Notice: normal but significant condition
+ */
+ const NOTICE = 5;
+
+ /**
+ * Informational: informational messages
+ */
+ const INFO = 6;
+
+ /**
+ * Debug: debug messages
+ */
+ const DEBUG = 7;
+
+ /**
+ * Set log level
+ *
+ * @param int $level
+ * @return void
+ */
+ public function setLogLevel($level);
+
+ /**
+ * Log message
+ *
+ * @param string $message
+ * @param string $level
+ * @param string $file
+ * @return void
+ */
+ public function log($message, $level);
+
+ /**
+ * Log exception
+ *
+ * @param \Exception $e
+ * @return void
+ */
+ public function logException(\Exception $e);
+}
--- Magento-CE-2.0.5/vendor/colinmollenhour/php-redis-session-abstract/src/Cm/RedisSession/Handler.php 1969-12-31 21:00:00.000000000 -0300
+++ Magento-CE-2.0.6/vendor/colinmollenhour/php-redis-session-abstract/src/Cm/RedisSession/Handler.php 2016-02-03 15:13:49.000000000 -0300
@@ -0,0 +1,811 @@
+<?php
+/*
+==New BSD License==
+
+Copyright (c) 2013, Colin Mollenhour
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ * The name of Colin Mollenhour may not be used to endorse or promote products
+ derived from this software without specific prior written permission.
+ * Redistributions in any form must not change the Cm_RedisSession namespace.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+namespace Cm\RedisSession;
+
+/**
+ * Redis session handler with optimistic locking.
+ *
+ * Features:
+ * - When a session's data exceeds the compression threshold the session data will be compressed.
+ * - Compression libraries supported are 'gzip', 'lzf', 'lz4' and 'snappy'.
+ * - Compression can be enabled, disabled, or reconfigured on the fly with no loss of session data.
+ * - Expiration is handled by Redis. No garbage collection needed.
+ * - Logs when sessions are not written due to not having or losing their lock.
+ * - Limits the number of concurrent lock requests.
+ *
+ * Locking Algorithm Properties:
+ * - Only one process may get a write lock on a session.
+ * - A process may lose it's lock if another process breaks it, in which case the session will not be written.
+ * - The lock may be broken after BREAK_AFTER seconds and the process that gets the lock is indeterminate.
+ * - Only MAX_CONCURRENCY processes may be waiting for a lock for the same session or else a ConcurrentConnectionsExceededException will be thrown.
+ * - Detects crashed processes to prevent session deadlocks (Linux only).
+ * - Detects inactive waiting processes to prevent false-positives in concurrency throttling.
+ */
+
+use Cm\RedisSession\Handler\ConfigInterface;
+use Cm\RedisSession\Handler\LoggerInterface;
+
+class Handler implements \SessionHandlerInterface
+{
+ /**
+ * Sleep 0.5 seconds between lock attempts (1,000,000 == 1 second)
+ */
+ const SLEEP_TIME = 500000;
+
+ /**
+ * Try to break lock for at most this many seconds
+ */
+ const FAIL_AFTER = 15;
+
+ /**
+ * Try to detect zombies every this many tries
+ */
+ const DETECT_ZOMBIES = 20;
+
+ /**
+ * Session prefix
+ */
+ const SESSION_PREFIX = 'sess_';
+
+ /**
+ * Bots get shorter session lifetimes
+ */
+ const BOT_REGEX = '/^alexa|^blitz\.io|bot|^browsermob|crawl|^curl|^facebookexternalhit|feed|google web preview|^ia_archiver|indexer|^java|jakarta|^libwww-perl|^load impact|^magespeedtest|monitor|^Mozilla$|nagios |^\.net|^pinterest|postrank|slurp|spider|uptime|^wget|yandex/i';
+
+ /**
+ * Default connection timeout
+ */
+ const DEFAULT_TIMEOUT = 2.5;
+
+ /**
+ * Default compression threshold
+ */
+ const DEFAULT_COMPRESSION_THRESHOLD = 2048;
+
+ /**
+ * Default compression library
+ */
+ const DEFAULT_COMPRESSION_LIBRARY = 'gzip';
+
+ /**
+ * Default log level
+ */
+ const DEFAULT_LOG_LEVEL = LoggerInterface::ALERT;
+
+ /**
+ * Maximum number of processes that can wait for a lock on one session
+ */
+ const DEFAULT_MAX_CONCURRENCY = 6;
+
+ /**
+ * Try to break the lock after this many seconds
+ */
+ const DEFAULT_BREAK_AFTER = 30;
+
+ /**
+ * The session lifetime for non-bots on the first write
+ */
+ const DEFAULT_FIRST_LIFETIME = 600;
+
+ /**
+ * The session lifetime for bots on the first write
+ */
+ const DEFAULT_BOT_FIRST_LIFETIME = 60;
+
+ /**
+ * The session lifetime for bots - shorter to prevent bots from wasting backend storage
+ */
+ const DEFAULT_BOT_LIFETIME = 7200;
+
+ /**
+ * Disable locking flag
+ */
+ const DEFAULT_DISABLE_LOCKING = false;
+
+ /**
+ * Redis backend limit
+ */
+ const DEFAULT_MAX_LIFETIME = 2592000;
+
+ /**
+ * Default min lifetime
+ */
+ const DEFAULT_MIN_LIFETIME = 60;
+
+ /**
+ * Default host
+ */
+ const DEFAULT_HOST = '127.0.0.1';
+
+ /**
+ * Default port
+ */
+ const DEFAULT_PORT = 6379;
+
+ /**
+ * Default database
+ */
+ const DEFAULT_DATABASE = 0;
+
+ /**
+ * Default lifetime
+ */
+ const DEFAULT_LIFETIME = 60;
+
+ /**
+ * @var \Credis_Client
+ */
+ protected $_redis;
+
+ /**
+ * @var int
+ */
+ protected $_dbNum;
+
+ /**
+ * @var string
+ */
+ private $_compressionThreshold;
+
+ /**
+ * @var string
+ */
+ private $_compressionLibrary;
+
+ /**
+ * @var int
+ */
+ private $_maxConcurrency;
+
+ /**
+ * @var int
+ */
+ private $_breakAfter;
+
+ /**
+ * @var boolean
+ */
+ private $_useLocking;
+
+ /**
+ * @var boolean
+ */
+ private $_hasLock;
+
+ /**
+ * Avoid infinite loops
+ *
+ * @var boolean
+ */
+ private $_sessionWritten;
+
+ /**
+ * Set expire time based on activity
+ *
+ * @var int
+ */
+ private $_sessionWrites;
+
+ /**
+ * @var int
+ */
+ private $_maxLifetime;
+
+ /**
+ * @var int
+ */
+ private $_minLifetime;
+
+ /**
+ * For debug or informational purposes
+ *
+ * @var int
+ */
+ private $failedLockAttempts = 0;
+
+ /**
+ * @var ConfigInterface
+ */
+ private $config;
+
+ /**
+ * @var LoggerInterface
+ */
+ private $logger;
+
+ /**
+ * @var int
+ */
+ private $_lifeTime;
+
+ /**
+ * @param ConfigInterface $config
+ * @param LoggerInterface $logger
+ * @throws ConnectionFailedException
+ */
+ public function __construct(ConfigInterface $config, LoggerInterface $logger)
+ {
+ $this->config = $config;
+ $this->logger = $logger;
+
+ $this->logger->setLogLevel($this->config->getLogLevel() ?: self::DEFAULT_LOG_LEVEL);
+ $timeStart = microtime(true);
+
+ // Database config
+ $host = $this->config->getHost() ?: self::DEFAULT_HOST;
+ $port = $this->config->getPort() ?: self::DEFAULT_PORT;
+ $pass = $this->config->getPassword() ?: null;
+ $timeout = $this->config->getTimeout() ?: self::DEFAULT_TIMEOUT;
+ $persistent = $this->config->getPersistentIdentifier() ?: '';
+ $this->_dbNum = $this->config->getDatabase() ?: self::DEFAULT_DATABASE;
+
+ // General config
+ $this->_compressionThreshold = $this->config->getCompressionThreshold() ?: self::DEFAULT_COMPRESSION_THRESHOLD;
+ $this->_compressionLibrary = $this->config->getCompressionLibrary() ?: self::DEFAULT_COMPRESSION_LIBRARY;
+ $this->_maxConcurrency = $this->config->getMaxConcurrency() ?: self::DEFAULT_MAX_CONCURRENCY;
+ $this->_maxLifetime = $this->config->getMaxLifetime() ?: self::DEFAULT_MAX_LIFETIME;
+ $this->_minLifetime = $this->config->getMinLifetime() ?: self::DEFAULT_MIN_LIFETIME;
+ $this->_useLocking = $this->config->getDisableLocking() ?: self::DEFAULT_DISABLE_LOCKING;
+
+ // Use sleep time multiplier so break time is in seconds
+ $this->_failAfter = (int) round((1000000 / self::SLEEP_TIME) * self::FAIL_AFTER);
+
+ // Connect and authenticate
+ $this->_redis = new \Credis_Client($host, $port, $timeout, $persistent, 0, $pass);
+ if ($this->hasConnection() == false) {
+ throw new ConnectionFailedException('Unable to connect to Redis');
+ }
+ // Destructor order cannot be predicted
+ $this->_redis->setCloseOnDestruct(false);
+ $this->_log(
+ sprintf(
+ "%s initialized for connection to %s:%s after %.5f seconds",
+ get_class($this),
+ $host,
+ $port,
+ (microtime(true) - $timeStart)
+ )
+ );
+ }
+
+ /**
+ * Open session
+ *
+ * @param string $savePath ignored
+ * @param string $sessionName ignored
+ * @return bool
+ * @SuppressWarnings(PHPMD.UnusedFormalParameter)
+ */
+ public function open($savePath, $sessionName)
+ {
+ return true;
+ }
+
+ /**
+ * @param $msg
+ * @param $level
+ */
+ private function _log($msg, $level = LoggerInterface::DEBUG)
+ {
+ $this->logger->log("{$this->_getPid()}: $msg", $level);
+ }
+
+ /**
+ * Check Redis connection
+ *
+ * @return bool
+ */
+ protected function hasConnection()
+ {
+ try {
+ $this->_redis->connect();
+ $this->_log("Connected to Redis");
+ return true;
+ } catch (\Exception $e) {
+ $this->logger->logException($e);
+ $this->_log('Unable to connect to Redis');
+ return false;
+ }
+ }
+
+ /**
+ * Fetch session data
+ *
+ * @param string $sessionId
+ * @return string
+ * @throws ConcurrentConnectionsExceededException
+ */
+ public function read($sessionId)
+ {
+ // Get lock on session. Increment the "lock" field and if the new value is 1, we have the lock.
+ $sessionId = self::SESSION_PREFIX.$sessionId;
+ $tries = $waiting = $lock = 0;
+ $lockPid = $oldLockPid = null; // Restart waiting for lock when current lock holder changes
+ $detectZombies = false;
+ $breakAfter = $this->_getBreakAfter();
+ $timeStart = microtime(true);
+ $this->_log(sprintf("Attempting to take lock on ID %s", $sessionId));
+
+ $this->_redis->select($this->_dbNum);
+ while ($this->_useLocking)
+ {
+ // Increment lock value for this session and retrieve the new value
+ $oldLock = $lock;
+ $lock = $this->_redis->hIncrBy($sessionId, 'lock', 1);
+
+ // Get the pid of the process that has the lock
+ if ($lock != 1 && $tries + 1 >= $breakAfter) {
+ $lockPid = $this->_redis->hGet($sessionId, 'pid');
+ }
+
+ // If we got the lock, update with our pid and reset lock and expiration
+ if ( $lock == 1 // We actually do have the lock
+ || (
+ $tries >= $breakAfter // We are done waiting and want to start trying to break it
+ && $oldLockPid == $lockPid // Nobody else got the lock while we were waiting
+ )
+ ) {
+ $this->_hasLock = true;
+ break;
+ }
+
+ // Otherwise, add to "wait" counter and continue
+ else if ( ! $waiting) {
+ $i = 0;
+ do {
+ $waiting = $this->_redis->hIncrBy($sessionId, 'wait', 1);
+ } while (++$i < $this->_maxConcurrency && $waiting < 1);
+ }
+
+ // Handle overloaded sessions
+ else {
+ // Detect broken sessions (e.g. caused by fatal errors)
+ if ($detectZombies) {
+ $detectZombies = false;
+ // Lock shouldn't be less than old lock (another process broke the lock)
+ if ($lock > $oldLock
+ // Lock should be old+waiting, otherwise there must be a dead process
+ && $lock + 1 < $oldLock + $waiting
+ ) {
+ // Reset session to fresh state
+ $this->_log(
+ sprintf(
+ "Detected zombie waiter after %.5f seconds for ID %s (%d waiting)",
+ (microtime(true) - $timeStart),
+ $sessionId, $waiting
+ ),
+ LoggerInterface::INFO
+ );
+ $waiting = $this->_redis->hIncrBy($sessionId, 'wait', -1);
+ continue;
+ }
+ }
+
+ // Limit concurrent lock waiters to prevent server resource hogging
+ if ($waiting >= $this->_maxConcurrency) {
+ // Overloaded sessions get 503 errors
+ $this->_redis->hIncrBy($sessionId, 'wait', -1);
+ $this->_sessionWritten = true; // Prevent session from getting written
+ $writes = $this->_redis->hGet($sessionId, 'writes');
+ $this->_log(
+ sprintf(
+ 'Session concurrency exceeded for ID %s; displaying HTTP 503 (%s waiting, %s total '
+ . 'requests)',
+ $sessionId, $waiting, $writes
+ ),
+ LoggerInterface::WARNING
+ );
+ throw new ConcurrentConnectionsExceededException();
+ }
+ }
+
+ $tries++;
+ $oldLockPid = $lockPid;
+ $sleepTime = self::SLEEP_TIME;
+
+ // Detect dead lock waiters
+ if ($tries % self::DETECT_ZOMBIES == 1) {
+ $detectZombies = true;
+ $sleepTime += 10000; // sleep + 0.01 seconds
+ }
+ // Detect dead lock holder every 10 seconds (only works on same node as lock holder)
+ if ($tries % self::DETECT_ZOMBIES == 0) {
+ $this->_log(
+ sprintf(
+ "Checking for zombies after %.5f seconds of waiting...", (microtime(true) - $timeStart)
+ )
+ );
+
+ $pid = $this->_redis->hGet($sessionId, 'pid');
+ if ($pid && ! $this->_pidExists($pid)) {
+ // Allow a live process to get the lock
+ $this->_redis->hSet($sessionId, 'lock', 0);
+ $this->_log(
+ sprintf(
+ "Detected zombie process (%s) for %s (%s waiting)",
+ $pid, $sessionId, $waiting
+ ),
+ LoggerInterface::INFO
+ );
+ continue;
+ }
+ }
+ // Timeout
+ if ($tries >= $breakAfter + $this->_failAfter) {
+ $this->_hasLock = false;
+ $this->_log(
+ sprintf(
+ 'Giving up on read lock for ID %s after %.5f seconds (%d attempts)',
+ $sessionId,
+ (microtime(true) - $timeStart),
+ $tries
+ ),
+ LoggerInterface::NOTICE
+ );
+ break;
+ }
+ else {
+ $this->_log(
+ sprintf(
+ "Waiting %.2f seconds for lock on ID %s (%d tries, lock pid is %s, %.5f seconds elapsed)",
+ $sleepTime / 1000000,
+ $sessionId,
+ $tries,
+ $lockPid,
+ (microtime(true) - $timeStart)
+ )
+ );
+ usleep($sleepTime);
+ }
+ }
+ $this->failedLockAttempts = $tries;
+
+ // Session can be read even if it was not locked by this pid!
+ $timeStart2 = microtime(true);
+ list($sessionData, $sessionWrites) = $this->_redis->hMGet($sessionId, array('data','writes'));
+ $this->_log(sprintf("Data read for ID %s in %.5f seconds", $sessionId, (microtime(true) - $timeStart2)));
+ $this->_sessionWrites = (int) $sessionWrites;
+
+ // This process is no longer waiting for a lock
+ if ($tries > 0) {
+ $this->_redis->hIncrBy($sessionId, 'wait', -1);
+ }
+
+ // This process has the lock, save the pid
+ if ($this->_hasLock) {
+ $setData = array(
+ 'pid' => $this->_getPid(),
+ 'lock' => 1,
+ );
+
+ // Save request data in session so if a lock is broken we can know which page it was for debugging
+ if (empty($_SERVER['REQUEST_METHOD'])) {
+ $setData['req'] = $_SERVER['SCRIPT_NAME'];
+ } else {
+ $setData['req'] = "{$_SERVER['REQUEST_METHOD']} {$_SERVER['SERVER_NAME']}{$_SERVER['REQUEST_URI']}";
+ }
+ if ($lock != 1) {
+ $this->_log(
+ sprintf(
+ "Successfully broke lock for ID %s after %.5f seconds (%d attempts). Lock: %d\nLast request of '
+ . 'broken lock: %s",
+ $sessionId,
+ (microtime(true) - $timeStart),
+ $tries,
+ $lock,
+ $this->_redis->hGet($sessionId, 'req')
+ ),
+ LoggerInterface::INFO
+ );
+ }
+ }
+
+ // Set session data and expiration
+ $this->_redis->pipeline();
+ if ( ! empty($setData)) {
+ $this->_redis->hMSet($sessionId, $setData);
+ }
+ $this->_redis->expire($sessionId, min($this->getLifeTime(), $this->_maxLifetime));
+ $this->_redis->exec();
+
+ // Reset flag in case of multiple session read/write operations
+ $this->_sessionWritten = false;
+
+ return $sessionData ? (string) $this->_decodeData($sessionData) : '';
+ }
+
+ /**
+ * Update session
+ *
+ * @param string $sessionId
+ * @param string $sessionData
+ * @return boolean
+ */
+ public function write($sessionId, $sessionData)
+ {
+ if ($this->_sessionWritten) {
+ $this->_log(sprintf("Repeated session write detected; skipping for ID %s", $sessionId));
+ return true;
+ }
+ $this->_sessionWritten = true;
+ $timeStart = microtime(true);
+
+ // Do not overwrite the session if it is locked by another pid
+ try {
+ if($this->_dbNum) $this->_redis->select($this->_dbNum); // Prevent conflicts with other connections?
+
+ if ( ! $this->_useLocking
+ || ( ! ($pid = $this->_redis->hGet('sess_'.$sessionId, 'pid')) || $pid == $this->_getPid())
+ ) {
+ $this->_writeRawSession($sessionId, $sessionData, $this->getLifeTime());
+ $this->_log(sprintf("Data written to ID %s in %.5f seconds", $sessionId, (microtime(true) - $timeStart)));
+
+ }
+ else {
+ if ($this->_hasLock) {
+ $this->_log(sprintf("Did not write session for ID %s: another process took the lock.",
+ $sessionId
+ ), LoggerInterface::WARNING);
+ } else {
+ $this->_log(sprintf("Did not write session for ID %s: unable to acquire lock.",
+ $sessionId
+ ), LoggerInterface::WARNING);
+ }
+ }
+ }
+ catch(\Exception $e) {
+ $this->logger->logException($e);
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * Destroy session
+ *
+ * @param string $sessionId
+ * @return boolean
+ */
+ public function destroy($sessionId)
+ {
+ $this->_log(sprintf("Destroying ID %s", $sessionId));
+ $this->_redis->pipeline();
+ if($this->_dbNum) $this->_redis->select($this->_dbNum);
+ $this->_redis->del(self::SESSION_PREFIX.$sessionId);
+ $this->_redis->exec();
+ return true;
+ }
+
+ /**
+ * Overridden to prevent calling getLifeTime at shutdown
+ *
+ * @return bool
+ */
+ public function close()
+ {
+ $this->_log("Closing connection");
+ if ($this->_redis) $this->_redis->close();
+ return true;
+ }
+
+ /**
+ * Garbage collection
+ *
+ * @param int $maxLifeTime ignored
+ * @return boolean
+ */
+ public function gc($maxLifeTime)
+ {
+ return true;
+ }
+
+ /**
+ * Get the number of failed lock attempts
+ *
+ * @return int
+ */
+ public function getFailedLockAttempts()
+ {
+ return $this->failedLockAttempts;
+ }
+
+ /**
+ * Get lock lifetime
+ *
+ * @return int|mixed
+ */
+ private function getLifeTime()
+ {
+ if (is_null($this->_lifeTime)) {
+ $lifeTime = null;
+
+ // Detect bots by user agent
+ $botLifetime = $this->config->getBotLifetime() ?: self::DEFAULT_BOT_LIFETIME;
+ if ($botLifetime) {
+ $userAgent = empty($_SERVER['HTTP_USER_AGENT']) ? false : $_SERVER['HTTP_USER_AGENT'];
+ $isBot = ! $userAgent || preg_match(self::BOT_REGEX, $userAgent);
+ if ($isBot) {
+ $this->_log(sprintf("Bot detected for user agent: %s", $userAgent));
+ if ( $this->_sessionWrites <= 1
+ && ($botFirstLifetime = $this->config->getBotFirstLifetime() ?: self::DEFAULT_BOT_FIRST_LIFETIME)
+ ) {
+ $lifeTime = $botFirstLifetime * (1+$this->_sessionWrites);
+ } else {
+ $lifeTime = $botLifetime;
+ }
+ }
+ }
+
+ // Use different lifetime for first write
+ if ($lifeTime === null && $this->_sessionWrites <= 1) {
+ $firstLifetime = $this->config->getFirstLifetime() ?: self::DEFAULT_FIRST_LIFETIME;
+ if ($firstLifetime) {
+ $lifeTime = $firstLifetime * (1+$this->_sessionWrites);
+ }
+ }
+
+ // Neither bot nor first write
+ if ($lifeTime === null) {
+ $lifeTime = $this->config->getLifetime();
+ }
+
+ $this->_lifeTime = $lifeTime;
+ if ($this->_lifeTime < $this->_minLifetime) {
+ $this->_lifeTime = $this->_minLifetime;
+ }
+ if ($this->_lifeTime > $this->_maxLifetime) {
+ $this->_lifeTime = $this->_maxLifetime;
+ }
+ }
+ return $this->_lifeTime;
+ }
+
+ /**
+ * Encode data
+ *
+ * @param string $data
+ * @return string
+ */
+ protected function _encodeData($data)
+ {
+ $originalDataSize = strlen($data);
+ if ($this->_compressionThreshold > 0 && $this->_compressionLibrary != 'none' && $originalDataSize >= $this->_compressionThreshold) {
+ $this->_log(sprintf("Compressing %s bytes with %s", $originalDataSize,$this->_compressionLibrary));
+ $timeStart = microtime(true);
+ $prefix = ':'.substr($this->_compressionLibrary,0,2).':';
+ switch($this->_compressionLibrary) {
+ case 'snappy': $data = snappy_compress($data); break;
+ case 'lzf': $data = lzf_compress($data); break;
+ case 'lz4': $data = lz4_compress($data); $prefix = ':l4:'; break;
+ case 'gzip': $data = gzcompress($data, 1); break;
+ }
+ if($data) {
+ $data = $prefix.$data;
+ $this->_log(
+ sprintf(
+ "Data compressed by %.1f percent in %.5f seconds",
+ ($originalDataSize == 0 ? 0 : (100 - (strlen($data) / $originalDataSize * 100))),
+ (microtime(true) - $timeStart)
+ )
+ );
+ } else {
+ $this->_log(
+ sprintf("Could not compress session data using %s", $this->_compressionLibrary),
+ LoggerInterface::WARNING
+ );
+ }
+ }
+ return $data;
+ }
+
+ /**
+ * Decode data
+ *
+ * @param string $data
+ * @return string
+ */
+ protected function _decodeData($data)
+ {
+ switch (substr($data,0,4)) {
+ // asking the data which library it uses allows for transparent changes of libraries
+ case ':sn:': $data = snappy_uncompress(substr($data,4)); break;
+ case ':lz:': $data = lzf_decompress(substr($data,4)); break;
+ case ':l4:': $data = lz4_uncompress(substr($data,4)); break;
+ case ':gz:': $data = gzuncompress(substr($data,4)); break;
+ }
+ return $data;
+ }
+
+ /**
+ * Write session data to Redis
+ *
+ * @param $id
+ * @param $data
+ * @param $lifetime
+ * @throws \Exception
+ */
+ protected function _writeRawSession($id, $data, $lifetime)
+ {
+ $sessionId = 'sess_' . $id;
+ $this->_redis->pipeline()
+ ->select($this->_dbNum)
+ ->hMSet($sessionId, array(
+ 'data' => $this->_encodeData($data),
+ 'lock' => 0, // 0 so that next lock attempt will get 1
+ ))
+ ->hIncrBy($sessionId, 'writes', 1)
+ ->expire($sessionId, min($lifetime, $this->_maxLifetime))
+ ->exec();
+ }
+
+ /**
+ * Get pid
+ *
+ * @return string
+ */
+ private function _getPid()
+ {
+ return gethostname().'|'.getmypid();
+ }
+
+ /**
+ * Check if pid exists
+ *
+ * @param $pid
+ * @return bool
+ */
+ private function _pidExists($pid)
+ {
+ list($host,$pid) = explode('|', $pid);
+ if (PHP_OS != 'Linux' || $host != gethostname()) {
+ return true;
+ }
+ return @file_exists('/proc/'.$pid);
+ }
+
+ /**
+ * Get break time, calculated later than other config settings due to requiring session name to be set
+ *
+ * @return int
+ */
+ private function _getBreakAfter()
+ {
+ // Has break after already been calculated? Only fetch from config once, then reuse variable.
+ if (!$this->_breakAfter) {
+ // Fetch relevant setting from config using session name
+ $this->_breakAfter = (float)($this->config->getBreakAfter() ?: self::DEFAULT_BREAK_AFTER);
+ // Use sleep time multiplier so break time is in seconds
+ $this->_breakAfter = (int)round((1000000 / self::SLEEP_TIME) * $this->_breakAfter);
+ }
+
+ return $this->_breakAfter;
+ }
+}
--- Magento-CE-2.0.5/vendor/composer/autoload_classmap.php 2016-04-27 23:23:12.000000000 -0300
+++ Magento-CE-2.0.6/vendor/composer/autoload_classmap.php 2016-05-16 13:49:29.000000000 -0300
@@ -7,6 +7,10 @@
return array(
'CSSmin' => $vendorDir . '/tubalmartin/cssmin/cssmin.php',
+ 'CredisException' => $vendorDir . '/colinmollenhour/credis/Client.php',
+ 'Credis_Client' => $vendorDir . '/colinmollenhour/credis/Client.php',
+ 'Credis_Cluster' => $vendorDir . '/colinmollenhour/credis/Cluster.php',
+ 'Credis_Sentinel' => $vendorDir . '/colinmollenhour/credis/Sentinel.php',
'File_Iterator' => $vendorDir . '/phpunit/php-file-iterator/File/Iterator.php',
'File_Iterator_Facade' => $vendorDir . '/phpunit/php-file-iterator/File/Iterator/Facade.php',
'File_Iterator_Factory' => $vendorDir . '/phpunit/php-file-iterator/File/Iterator/Factory.php',
--- Magento-CE-2.0.5/vendor/composer/autoload_files.php 2016-04-27 23:23:12.000000000 -0300
+++ Magento-CE-2.0.6/vendor/composer/autoload_files.php 2016-05-16 13:49:29.000000000 -0300
@@ -38,16 +38,16 @@
'502392721e9fd20e70182378639f4ff5' => $vendorDir . '/magento/module-reports/registration.php',
'5c7dcd6ec83d6cf2988a97cdcba365ed' => $vendorDir . '/magento/module-catalog-rule/registration.php',
'3f1662385885db186423ec0b74dfe6e9' => $vendorDir . '/magento/module-sales-rule/registration.php',
- 'a402dea5ff0872fb10e6b9910d2dd108' => $vendorDir . '/magento/module-sales/registration.php',
+ 'e54a2a6d4f945c30feee43a0713bfb8b' => $vendorDir . '/magento/module-checkout/registration.php',
+ '4725125cbaeab31cd4e5c5c07061fa43' => $vendorDir . '/magento/module-payment/registration.php',
'4e49f9b77cfaca5ecee9e68485c07e5a' => $vendorDir . '/magento/module-contact/registration.php',
'53814a716d73013b1489c928a2cb4164' => $vendorDir . '/magento/module-shipping/registration.php',
- 'e54a2a6d4f945c30feee43a0713bfb8b' => $vendorDir . '/magento/module-checkout/registration.php',
+ 'a402dea5ff0872fb10e6b9910d2dd108' => $vendorDir . '/magento/module-sales/registration.php',
'a6d2049b4013058aebdab5256bfc92a1' => $vendorDir . '/magento/module-import-export/registration.php',
'cf44f9b1253939f955772534aabbf624' => $vendorDir . '/magento/module-grouped-product/registration.php',
'108fd301b720a30c9ec42a785ee00656' => $vendorDir . '/magento/module-gift-message/registration.php',
'bb6621289f135d14ac7bffe9e45ad6ef' => $vendorDir . '/magento/module-catalog-import-export/registration.php',
'44e7790b83e1936666da9a3a94daac39' => $vendorDir . '/magento/module-downloadable/registration.php',
- '4725125cbaeab31cd4e5c5c07061fa43' => $vendorDir . '/magento/module-payment/registration.php',
'ff4a42fb48f753f6d1e6177223059e3d' => $vendorDir . '/magento/module-msrp/registration.php',
'19b03cc33c349b5e5fbc6577c2f9dc87' => $vendorDir . '/magento/module-catalog-url-rewrite/registration.php',
'beef4a50b960435d4b145e8d222f5f10' => $vendorDir . '/magento/module-configurable-product/registration.php',
--- Magento-CE-2.0.5/vendor/composer/autoload_namespaces.php 2016-04-27 23:23:12.000000000 -0300
+++ Magento-CE-2.0.6/vendor/composer/autoload_namespaces.php 2016-05-16 13:49:29.000000000 -0300
@@ -22,6 +22,7 @@
'File' => array($vendorDir . '/phpseclib/phpseclib/phpseclib'),
'Crypt' => array($vendorDir . '/phpseclib/phpseclib/phpseclib'),
'Composer' => array($vendorDir . '/composer/composer/src'),
+ 'Cm\\RedisSession\\' => array($vendorDir . '/colinmollenhour/php-redis-session-abstract/src'),
'Braintree' => array($vendorDir . '/braintree/braintree_php/lib'),
'' => array($baseDir . '/app/code'),
);
--- Magento-CE-2.0.5/vendor/composer/autoload_real.php 2016-04-27 23:23:12.000000000 -0300
+++ Magento-CE-2.0.6/vendor/composer/autoload_real.php 2016-05-16 13:49:29.000000000 -0300
@@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer
-class ComposerAutoloaderInit51d8e4e0d25132bf74ae7fd9905edadb
+class ComposerAutoloaderInit9c500efd4dbc15ca27cc77bd51919bc2
{
private static $loader;
@@ -19,9 +19,9 @@
return self::$loader;
}
- spl_autoload_register(array('ComposerAutoloaderInit51d8e4e0d25132bf74ae7fd9905edadb', 'loadClassLoader'), true, true);
+ spl_autoload_register(array('ComposerAutoloaderInit9c500efd4dbc15ca27cc77bd51919bc2', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
- spl_autoload_unregister(array('ComposerAutoloaderInit51d8e4e0d25132bf74ae7fd9905edadb', 'loadClassLoader'));
+ spl_autoload_unregister(array('ComposerAutoloaderInit9c500efd4dbc15ca27cc77bd51919bc2', 'loadClassLoader'));
$includePaths = require __DIR__ . '/include_paths.php';
array_push($includePaths, get_include_path());
@@ -47,14 +47,14 @@
$includeFiles = require __DIR__ . '/autoload_files.php';
foreach ($includeFiles as $fileIdentifier => $file) {
- composerRequire51d8e4e0d25132bf74ae7fd9905edadb($fileIdentifier, $file);
+ composerRequire9c500efd4dbc15ca27cc77bd51919bc2($fileIdentifier, $file);
}
return $loader;
}
}
-function composerRequire51d8e4e0d25132bf74ae7fd9905edadb($fileIdentifier, $file)
+function composerRequire9c500efd4dbc15ca27cc77bd51919bc2($fileIdentifier, $file)
{
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
require $file;
--- Magento-CE-2.0.5/vendor/composer/installed.json 2016-04-27 23:23:10.000000000 -0300
+++ Magento-CE-2.0.6/vendor/composer/installed.json 2016-05-16 13:49:28.000000000 -0300
@@ -79,13 +79,13 @@
},
{
"name": "magento/framework",
- "version": "100.0.7",
- "version_normalized": "100.0.7.0",
+ "version": "100.0.8",
+ "version_normalized": "100.0.8.0",
"dist": {
"type": "zip",
- "url": "https://repo.magento.com/archives/magento/framework/magento-framework-100.0.7.0.zip",
+ "url": "https://repo.magento.com/archives/magento/framework/magento-framework-100.0.8.0.zip",
"reference": null,
- "shasum": "8d92c12b2af52d3a79421a4a8e6c2e617823d016"
+ "shasum": "4a560ce4a54a5dd93bfdf0da684b9c9815270057"
},
"require": {
"ext-curl": "*",
@@ -657,13 +657,13 @@
},
{
"name": "magento/module-backend",
- "version": "100.0.6",
- "version_normalized": "100.0.6.0",
+ "version": "100.0.7",
+ "version_normalized": "100.0.7.0",
"dist": {
"type": "zip",
- "url": "https://repo.magento.com/archives/magento/module-backend/magento-module-backend-100.0.6.0.zip",
+ "url": "https://repo.magento.com/archives/magento/module-backend/magento-module-backend-100.0.7.0.zip",
"reference": null,
- "shasum": "20d9d267f7a1f731bd204ea2482982f01b5bc3d7"
+ "shasum": "87e39bc1baec0f1d4bd233487f6bc03b0d4c6956"
},
"require": {
"magento/framework": "100.0.*",
@@ -819,13 +819,13 @@
},
{
"name": "magento/module-quote",
- "version": "100.0.5",
- "version_normalized": "100.0.5.0",
+ "version": "100.0.6",
+ "version_normalized": "100.0.6.0",
"dist": {
"type": "zip",
- "url": "https://repo.magento.com/archives/magento/module-quote/magento-module-quote-100.0.5.0.zip",
+ "url": "https://repo.magento.com/archives/magento/module-quote/magento-module-quote-100.0.6.0.zip",
"reference": null,
- "shasum": "bc9237e09c6e30f8abda8013b499f837514a071a"
+ "shasum": "fd607a2af00a10bde8e25c2546ce96e86d422cb9"
},
"require": {
"magento/framework": "100.0.*",
@@ -899,46 +899,72 @@
"description": "N/A"
},
{
- "name": "magento/module-catalog",
+ "name": "magento/module-developer",
+ "version": "100.0.5",
+ "version_normalized": "100.0.5.0",
+ "dist": {
+ "type": "zip",
+ "url": "https://repo.magento.com/archives/magento/module-developer/magento-module-developer-100.0.5.0.zip",
+ "reference": null,
+ "shasum": "a1360ca14aff6919cbf48584ff867e2320922802"
+ },
+ "require": {
+ "magento/framework": "100.0.*",
+ "magento/module-store": "100.0.*",
+ "php": "~5.5.0|~5.6.0|~7.0.0"
+ },
+ "type": "magento2-module",
+ "installation-source": "dist",
+ "autoload": {
+ "files": [
+ "registration.php"
+ ],
+ "psr-4": {
+ "Magento\\Developer\\": ""
+ }
+ },
+ "license": [
+ "OSL-3.0",
+ "AFL-3.0"
+ ],
+ "description": "N/A"
+ },
+ {
+ "name": "magento/module-customer",
"version": "100.0.6",
"version_normalized": "100.0.6.0",
"dist": {
"type": "zip",
- "url": "https://repo.magento.com/archives/magento/module-catalog/magento-module-catalog-100.0.6.0.zip",
+ "url": "https://repo.magento.com/archives/magento/module-customer/magento-module-customer-100.0.6.0.zip",
"reference": null,
- "shasum": "7d6ed2305ba456f8584426c31a63f58e2d2f2c1b"
+ "shasum": "b9ffe84b45f69293ce53f31bba309cb712727adf"
},
"require": {
"magento/framework": "100.0.*",
+ "magento/module-authorization": "100.0.*",
"magento/module-backend": "100.0.*",
- "magento/module-catalog-inventory": "100.0.*",
- "magento/module-catalog-rule": "100.0.*",
- "magento/module-catalog-url-rewrite": "100.0.*",
+ "magento/module-catalog": "100.0.*",
"magento/module-checkout": "100.0.*",
- "magento/module-cms": "100.0.*",
"magento/module-config": "100.0.*",
- "magento/module-configurable-product": "100.0.*",
- "magento/module-customer": "100.0.*",
"magento/module-directory": "100.0.*",
"magento/module-eav": "100.0.*",
- "magento/module-indexer": "100.0.*",
+ "magento/module-integration": "100.0.*",
"magento/module-media-storage": "100.0.*",
- "magento/module-msrp": "100.0.*",
+ "magento/module-newsletter": "100.0.*",
"magento/module-page-cache": "100.0.*",
- "magento/module-product-alert": "100.0.*",
"magento/module-quote": "100.0.*",
+ "magento/module-review": "100.0.*",
+ "magento/module-sales": "100.0.*",
"magento/module-store": "100.0.*",
"magento/module-tax": "100.0.*",
"magento/module-theme": "100.0.*",
"magento/module-ui": "100.0.*",
- "magento/module-url-rewrite": "100.0.*",
- "magento/module-widget": "100.0.*",
"magento/module-wishlist": "100.0.*",
"php": "~5.5.0|~5.6.0|~7.0.0"
},
"suggest": {
- "magento/module-catalog-sample-data": "Sample Data version:100.0.*",
- "magento/module-cookie": "100.0.*"
+ "magento/module-cookie": "100.0.*",
+ "magento/module-customer-sample-data": "Sample Data version:100.0.*"
},
"type": "magento2-module",
"installation-source": "dist",
@@ -947,7 +973,7 @@
"registration.php"
],
"psr-4": {
- "Magento\\Catalog\\": ""
+ "Magento\\Customer\\": ""
}
},
"license": [
@@ -957,36 +983,24 @@
"description": "N/A"
},
{
- "name": "magento/module-configurable-product",
- "version": "100.0.5",
- "version_normalized": "100.0.5.0",
+ "name": "magento/module-integration",
+ "version": "100.0.6",
+ "version_normalized": "100.0.6.0",
"dist": {
"type": "zip",
- "url": "https://repo.magento.com/archives/magento/module-configurable-product/magento-module-configurable-product-100.0.5.0.zip",
+ "url": "https://repo.magento.com/archives/magento/module-integration/magento-module-integration-100.0.6.0.zip",
"reference": null,
- "shasum": "fb3adcc0a94a900f847e7158cdbecb26460f8975"
+ "shasum": "f67bb20e7bce5e52e6ed82a413e38579ed6b3341"
},
"require": {
"magento/framework": "100.0.*",
+ "magento/module-authorization": "100.0.*",
"magento/module-backend": "100.0.*",
- "magento/module-catalog": "100.0.*",
- "magento/module-catalog-inventory": "100.0.*",
- "magento/module-checkout": "100.0.*",
"magento/module-customer": "100.0.*",
- "magento/module-eav": "100.0.*",
- "magento/module-media-storage": "100.0.*",
- "magento/module-msrp": "100.0.*",
- "magento/module-quote": "100.0.*",
"magento/module-store": "100.0.*",
- "magento/module-ui": "100.0.*",
+ "magento/module-user": "100.0.*",
"php": "~5.5.0|~5.6.0|~7.0.0"
},
- "suggest": {
- "magento/module-configurable-sample-data": "Sample Data version:100.0.*",
- "magento/module-product-links-sample-data": "Sample Data version:100.0.*",
- "magento/module-sales": "100.0.*",
- "magento/module-webapi": "100.0.*"
- },
"type": "magento2-module",
"installation-source": "dist",
"autoload": {
@@ -994,7 +1008,7 @@
"registration.php"
],
"psr-4": {
- "Magento\\ConfigurableProduct\\": ""
+ "Magento\\Integration\\": ""
}
},
"license": [
@@ -1004,18 +1018,18 @@
"description": "N/A"
},
{
- "name": "magento/module-developer",
+ "name": "magento/module-authorization",
"version": "100.0.5",
"version_normalized": "100.0.5.0",
"dist": {
"type": "zip",
- "url": "https://repo.magento.com/archives/magento/module-developer/magento-module-developer-100.0.5.0.zip",
+ "url": "https://repo.magento.com/archives/magento/module-authorization/magento-module-authorization-100.0.5.0.zip",
"reference": null,
- "shasum": "a1360ca14aff6919cbf48584ff867e2320922802"
+ "shasum": "d5c72484e7a225e17d4e56bcb6bef116161ceab3"
},
"require": {
"magento/framework": "100.0.*",
- "magento/module-store": "100.0.*",
+ "magento/module-backend": "100.0.*",
"php": "~5.5.0|~5.6.0|~7.0.0"
},
"type": "magento2-module",
@@ -1025,52 +1039,32 @@
"registration.php"
],
"psr-4": {
- "Magento\\Developer\\": ""
+ "Magento\\Authorization\\": ""
}
},
"license": [
"OSL-3.0",
"AFL-3.0"
],
- "description": "N/A"
+ "description": "Authorization module provides access to Magento ACL functionality."
},
{
- "name": "magento/module-customer",
+ "name": "magento/module-page-cache",
"version": "100.0.6",
"version_normalized": "100.0.6.0",
"dist": {
"type": "zip",
- "url": "https://repo.magento.com/archives/magento/module-customer/magento-module-customer-100.0.6.0.zip",
+ "url": "https://repo.magento.com/archives/magento/module-page-cache/magento-module-page-cache-100.0.6.0.zip",
"reference": null,
- "shasum": "b9ffe84b45f69293ce53f31bba309cb712727adf"
+ "shasum": "31719ed14ae3a9933ad40a0b7a516e0db72ef367"
},
"require": {
"magento/framework": "100.0.*",
- "magento/module-authorization": "100.0.*",
"magento/module-backend": "100.0.*",
- "magento/module-catalog": "100.0.*",
- "magento/module-checkout": "100.0.*",
"magento/module-config": "100.0.*",
- "magento/module-directory": "100.0.*",
- "magento/module-eav": "100.0.*",
- "magento/module-integration": "100.0.*",
- "magento/module-media-storage": "100.0.*",
- "magento/module-newsletter": "100.0.*",
- "magento/module-page-cache": "100.0.*",
- "magento/module-quote": "100.0.*",
- "magento/module-review": "100.0.*",
- "magento/module-sales": "100.0.*",
"magento/module-store": "100.0.*",
- "magento/module-tax": "100.0.*",
- "magento/module-theme": "100.0.*",
- "magento/module-ui": "100.0.*",
- "magento/module-wishlist": "100.0.*",
"php": "~5.5.0|~5.6.0|~7.0.0"
},
- "suggest": {
- "magento/module-cookie": "100.0.*",
- "magento/module-customer-sample-data": "Sample Data version:100.0.*"
- },
"type": "magento2-module",
"installation-source": "dist",
"autoload": {
@@ -1078,7 +1072,7 @@
"registration.php"
],
"psr-4": {
- "Magento\\Customer\\": ""
+ "Magento\\PageCache\\": ""
}
},
"license": [
@@ -1088,24 +1082,35 @@
"description": "N/A"
},
{
- "name": "magento/module-integration",
+ "name": "magento/module-tax",
"version": "100.0.5",
"version_normalized": "100.0.5.0",
"dist": {
"type": "zip",
- "url": "https://repo.magento.com/archives/magento/module-integration/magento-module-integration-100.0.5.0.zip",
+ "url": "https://repo.magento.com/archives/magento/module-tax/magento-module-tax-100.0.5.0.zip",
"reference": null,
- "shasum": "baee3f3ece2f2195fb203c8338c67c89c2768731"
+ "shasum": "4a6e8d0fa229e1a9d304859b4c78b6b9d8f04735"
},
"require": {
"magento/framework": "100.0.*",
- "magento/module-authorization": "100.0.*",
"magento/module-backend": "100.0.*",
+ "magento/module-catalog": "100.0.*",
+ "magento/module-checkout": "100.0.*",
+ "magento/module-config": "100.0.*",
"magento/module-customer": "100.0.*",
+ "magento/module-directory": "100.0.*",
+ "magento/module-eav": "100.0.*",
+ "magento/module-page-cache": "100.0.*",
+ "magento/module-quote": "100.0.*",
+ "magento/module-reports": "100.0.*",
+ "magento/module-sales": "100.0.*",
+ "magento/module-shipping": "100.0.*",
"magento/module-store": "100.0.*",
- "magento/module-user": "100.0.*",
"php": "~5.5.0|~5.6.0|~7.0.0"
},
+ "suggest": {
+ "magento/module-tax-sample-data": "Sample Data version:100.0.*"
+ },
"type": "magento2-module",
"installation-source": "dist",
"autoload": {
@@ -1113,7 +1118,7 @@
"registration.php"
],
"psr-4": {
- "Magento\\Integration\\": ""
+ "Magento\\Tax\\": ""
}
},
"license": [
@@ -1123,20 +1128,47 @@
"description": "N/A"
},
{
- "name": "magento/module-authorization",
- "version": "100.0.5",
- "version_normalized": "100.0.5.0",
+ "name": "magento/module-catalog",
+ "version": "100.0.7",
+ "version_normalized": "100.0.7.0",
"dist": {
"type": "zip",
- "url": "https://repo.magento.com/archives/magento/module-authorization/magento-module-authorization-100.0.5.0.zip",
+ "url": "https://repo.magento.com/archives/magento/module-catalog/magento-module-catalog-100.0.7.0.zip",
"reference": null,
- "shasum": "d5c72484e7a225e17d4e56bcb6bef116161ceab3"
+ "shasum": "f6da28cbee4e50ed1f9222522e50f8c3edbb1de9"
},
"require": {
"magento/framework": "100.0.*",
"magento/module-backend": "100.0.*",
+ "magento/module-catalog-inventory": "100.0.*",
+ "magento/module-catalog-rule": "100.0.*",
+ "magento/module-catalog-url-rewrite": "100.0.*",
+ "magento/module-checkout": "100.0.*",
+ "magento/module-cms": "100.0.*",
+ "magento/module-config": "100.0.*",
+ "magento/module-configurable-product": "100.0.*",
+ "magento/module-customer": "100.0.*",
+ "magento/module-directory": "100.0.*",
+ "magento/module-eav": "100.0.*",
+ "magento/module-indexer": "100.0.*",
+ "magento/module-media-storage": "100.0.*",
+ "magento/module-msrp": "100.0.*",
+ "magento/module-page-cache": "100.0.*",
+ "magento/module-product-alert": "100.0.*",
+ "magento/module-quote": "100.0.*",
+ "magento/module-store": "100.0.*",
+ "magento/module-tax": "100.0.*",
+ "magento/module-theme": "100.0.*",
+ "magento/module-ui": "100.0.*",
+ "magento/module-url-rewrite": "100.0.*",
+ "magento/module-widget": "100.0.*",
+ "magento/module-wishlist": "100.0.*",
"php": "~5.5.0|~5.6.0|~7.0.0"
},
+ "suggest": {
+ "magento/module-catalog-sample-data": "Sample Data version:100.0.*",
+ "magento/module-cookie": "100.0.*"
+ },
"type": "magento2-module",
"installation-source": "dist",
"autoload": {
@@ -1144,32 +1176,46 @@
"registration.php"
],
"psr-4": {
- "Magento\\Authorization\\": ""
+ "Magento\\Catalog\\": ""
}
},
"license": [
"OSL-3.0",
"AFL-3.0"
],
- "description": "Authorization module provides access to Magento ACL functionality."
+ "description": "N/A"
},
{
- "name": "magento/module-page-cache",
+ "name": "magento/module-configurable-product",
"version": "100.0.5",
"version_normalized": "100.0.5.0",
"dist": {
"type": "zip",
- "url": "https://repo.magento.com/archives/magento/module-page-cache/magento-module-page-cache-100.0.5.0.zip",
+ "url": "https://repo.magento.com/archives/magento/module-configurable-product/magento-module-configurable-product-100.0.5.0.zip",
"reference": null,
- "shasum": "a8c9921fe26a8cd6a8a6e74e0ba78de4af8497fb"
+ "shasum": "fb3adcc0a94a900f847e7158cdbecb26460f8975"
},
"require": {
"magento/framework": "100.0.*",
"magento/module-backend": "100.0.*",
- "magento/module-config": "100.0.*",
+ "magento/module-catalog": "100.0.*",
+ "magento/module-catalog-inventory": "100.0.*",
+ "magento/module-checkout": "100.0.*",
+ "magento/module-customer": "100.0.*",
+ "magento/module-eav": "100.0.*",
+ "magento/module-media-storage": "100.0.*",
+ "magento/module-msrp": "100.0.*",
+ "magento/module-quote": "100.0.*",
"magento/module-store": "100.0.*",
+ "magento/module-ui": "100.0.*",
"php": "~5.5.0|~5.6.0|~7.0.0"
},
+ "suggest": {
+ "magento/module-configurable-sample-data": "Sample Data version:100.0.*",
+ "magento/module-product-links-sample-data": "Sample Data version:100.0.*",
+ "magento/module-sales": "100.0.*",
+ "magento/module-webapi": "100.0.*"
+ },
"type": "magento2-module",
"installation-source": "dist",
"autoload": {
@@ -1177,7 +1223,7 @@
"registration.php"
],
"psr-4": {
- "Magento\\PageCache\\": ""
+ "Magento\\ConfigurableProduct\\": ""
}
},
"license": [
@@ -1291,48 +1337,6 @@
"description": "N/A"
},
{
- "name": "magento/module-cms",
- "version": "100.0.5",
- "version_normalized": "100.0.5.0",
- "dist": {
- "type": "zip",
- "url": "https://repo.magento.com/archives/magento/module-cms/magento-module-cms-100.0.5.0.zip",
- "reference": null,
- "shasum": "5e739065c857bd930225300ebc43cffa95605fbf"
- },
- "require": {
- "magento/framework": "100.0.*",
- "magento/module-backend": "100.0.*",
- "magento/module-catalog": "100.0.*",
- "magento/module-email": "100.0.*",
- "magento/module-media-storage": "100.0.*",
- "magento/module-store": "100.0.*",
- "magento/module-theme": "100.0.*",
- "magento/module-ui": "100.0.*",
- "magento/module-variable": "100.0.*",
- "magento/module-widget": "100.0.*",
- "php": "~5.5.0|~5.6.0|~7.0.0"
- },
- "suggest": {
- "magento/module-cms-sample-data": "Sample Data version:100.0.*"
- },
- "type": "magento2-module",
- "installation-source": "dist",
- "autoload": {
- "files": [
- "registration.php"
- ],
- "psr-4": {
- "Magento\\Cms\\": ""
- }
- },
- "license": [
- "OSL-3.0",
- "AFL-3.0"
- ],
- "description": "N/A"
- },
- {
"name": "magento/module-catalog-url-rewrite",
"version": "100.0.5",
"version_normalized": "100.0.5.0",
@@ -1405,52 +1409,6 @@
"description": "N/A"
},
{
- "name": "magento/module-tax",
- "version": "100.0.5",
- "version_normalized": "100.0.5.0",
- "dist": {
- "type": "zip",
- "url": "https://repo.magento.com/archives/magento/module-tax/magento-module-tax-100.0.5.0.zip",
- "reference": null,
- "shasum": "4a6e8d0fa229e1a9d304859b4c78b6b9d8f04735"
- },
- "require": {
- "magento/framework": "100.0.*",
- "magento/module-backend": "100.0.*",
- "magento/module-catalog": "100.0.*",
- "magento/module-checkout": "100.0.*",
- "magento/module-config": "100.0.*",
- "magento/module-customer": "100.0.*",
- "magento/module-directory": "100.0.*",
- "magento/module-eav": "100.0.*",
- "magento/module-page-cache": "100.0.*",
- "magento/module-quote": "100.0.*",
- "magento/module-reports": "100.0.*",
- "magento/module-sales": "100.0.*",
- "magento/module-shipping": "100.0.*",
- "magento/module-store": "100.0.*",
- "php": "~5.5.0|~5.6.0|~7.0.0"
- },
- "suggest": {
- "magento/module-tax-sample-data": "Sample Data version:100.0.*"
- },
- "type": "magento2-module",
- "installation-source": "dist",
- "autoload": {
- "files": [
- "registration.php"
- ],
- "psr-4": {
- "Magento\\Tax\\": ""
- }
- },
- "license": [
- "OSL-3.0",
- "AFL-3.0"
- ],
- "description": "N/A"
- },
- {
"name": "magento/module-reports",
"version": "100.0.5",
"version_normalized": "100.0.5.0",
@@ -1654,44 +1612,75 @@
"description": "N/A"
},
{
- "name": "magento/module-sales",
+ "name": "magento/module-payment",
"version": "100.0.6",
"version_normalized": "100.0.6.0",
"dist": {
"type": "zip",
- "url": "https://repo.magento.com/archives/magento/module-sales/magento-module-sales-100.0.6.0.zip",
+ "url": "https://repo.magento.com/archives/magento/module-payment/magento-module-payment-100.0.6.0.zip",
"reference": null,
- "shasum": "512a7947c1f5557d7e0e449c7a05b54e2fed8a44"
+ "shasum": "8bb5ea8bd483740934145deb5fa093a72c151ae3"
+ },
+ "require": {
+ "magento/framework": "100.0.*",
+ "magento/module-checkout": "100.0.*",
+ "magento/module-config": "100.0.*",
+ "magento/module-directory": "100.0.*",
+ "magento/module-quote": "100.0.*",
+ "magento/module-sales": "100.0.*",
+ "magento/module-store": "100.0.*",
+ "php": "~5.5.0|~5.6.0|~7.0.0"
+ },
+ "type": "magento2-module",
+ "installation-source": "dist",
+ "autoload": {
+ "files": [
+ "registration.php"
+ ],
+ "psr-4": {
+ "Magento\\Payment\\": ""
+ }
+ },
+ "license": [
+ "OSL-3.0",
+ "AFL-3.0"
+ ],
+ "description": "N/A"
+ },
+ {
+ "name": "magento/module-checkout",
+ "version": "100.0.6",
+ "version_normalized": "100.0.6.0",
+ "dist": {
+ "type": "zip",
+ "url": "https://repo.magento.com/archives/magento/module-checkout/magento-module-checkout-100.0.6.0.zip",
+ "reference": null,
+ "shasum": "00a9f12d725ee8e7116fea63bdcc9be6808707ec"
},
"require": {
"magento/framework": "100.0.*",
- "magento/module-authorization": "100.0.*",
"magento/module-backend": "100.0.*",
"magento/module-catalog": "100.0.*",
"magento/module-catalog-inventory": "100.0.*",
- "magento/module-checkout": "100.0.*",
"magento/module-config": "100.0.*",
"magento/module-customer": "100.0.*",
"magento/module-directory": "100.0.*",
"magento/module-eav": "100.0.*",
- "magento/module-gift-message": "100.0.*",
- "magento/module-media-storage": "100.0.*",
+ "magento/module-msrp": "100.0.*",
+ "magento/module-page-cache": "100.0.*",
"magento/module-payment": "100.0.*",
"magento/module-quote": "100.0.*",
- "magento/module-reports": "100.0.*",
+ "magento/module-sales": "100.0.*",
"magento/module-sales-rule": "100.0.*",
- "magento/module-sales-sequence": "100.0.*",
"magento/module-shipping": "100.0.*",
"magento/module-store": "100.0.*",
"magento/module-tax": "100.0.*",
"magento/module-theme": "100.0.*",
"magento/module-ui": "100.0.*",
- "magento/module-widget": "100.0.*",
- "magento/module-wishlist": "100.0.*",
"php": "~5.5.0|~5.6.0|~7.0.0"
},
"suggest": {
- "magento/module-sales-sample-data": "Sample Data version:100.0.*"
+ "magento/module-cookie": "100.0.*"
},
"type": "magento2-module",
"installation-source": "dist",
@@ -1700,7 +1689,7 @@
"registration.php"
],
"psr-4": {
- "Magento\\Sales\\": ""
+ "Magento\\Checkout\\": ""
}
},
"license": [
@@ -1710,36 +1699,28 @@
"description": "N/A"
},
{
- "name": "magento/module-shipping",
+ "name": "magento/module-msrp",
"version": "100.0.5",
"version_normalized": "100.0.5.0",
"dist": {
"type": "zip",
- "url": "https://repo.magento.com/archives/magento/module-shipping/magento-module-shipping-100.0.5.0.zip",
+ "url": "https://repo.magento.com/archives/magento/module-msrp/magento-module-msrp-100.0.5.0.zip",
"reference": null,
- "shasum": "f86d757b879e697b21795206f6e405f6648560a5"
+ "shasum": "653c1c33ba5d5a7293da933225a5a399553b275a"
},
"require": {
- "ext-gd": "*",
"magento/framework": "100.0.*",
- "magento/module-backend": "100.0.*",
"magento/module-catalog": "100.0.*",
- "magento/module-catalog-inventory": "100.0.*",
- "magento/module-contact": "100.0.*",
- "magento/module-customer": "100.0.*",
- "magento/module-directory": "100.0.*",
- "magento/module-payment": "100.0.*",
- "magento/module-quote": "100.0.*",
- "magento/module-sales": "100.0.*",
+ "magento/module-downloadable": "100.0.*",
+ "magento/module-eav": "100.0.*",
+ "magento/module-grouped-product": "100.0.*",
"magento/module-store": "100.0.*",
"magento/module-tax": "100.0.*",
- "magento/module-ui": "100.0.*",
- "magento/module-user": "100.0.*",
"php": "~5.5.0|~5.6.0|~7.0.0"
},
"suggest": {
- "magento/module-fedex": "100.0.*",
- "magento/module-ups": "100.0.*"
+ "magento/module-bundle": "100.0.*",
+ "magento/module-msrp-sample-data": "Sample Data version:100.0.*"
},
"type": "magento2-module",
"installation-source": "dist",
@@ -1748,7 +1729,7 @@
"registration.php"
],
"psr-4": {
- "Magento\\Shipping\\": ""
+ "Magento\\Msrp\\": ""
}
},
"license": [
@@ -1758,25 +1739,33 @@
"description": "N/A"
},
{
- "name": "magento/module-payment",
+ "name": "magento/module-grouped-product",
"version": "100.0.5",
"version_normalized": "100.0.5.0",
"dist": {
"type": "zip",
- "url": "https://repo.magento.com/archives/magento/module-payment/magento-module-payment-100.0.5.0.zip",
+ "url": "https://repo.magento.com/archives/magento/module-grouped-product/magento-module-grouped-product-100.0.5.0.zip",
"reference": null,
- "shasum": "adcbca4bc81e6c5257d088dec419bc486a34b78e"
+ "shasum": "e06f107530068cf9cd67961778378a4affdd90b5"
},
"require": {
"magento/framework": "100.0.*",
+ "magento/module-backend": "100.0.*",
+ "magento/module-catalog": "100.0.*",
+ "magento/module-catalog-inventory": "100.0.*",
"magento/module-checkout": "100.0.*",
- "magento/module-config": "100.0.*",
- "magento/module-directory": "100.0.*",
+ "magento/module-customer": "100.0.*",
+ "magento/module-eav": "100.0.*",
+ "magento/module-media-storage": "100.0.*",
+ "magento/module-msrp": "100.0.*",
"magento/module-quote": "100.0.*",
"magento/module-sales": "100.0.*",
"magento/module-store": "100.0.*",
"php": "~5.5.0|~5.6.0|~7.0.0"
},
+ "suggest": {
+ "magento/module-grouped-product-sample-data": "Sample Data version:100.0.*"
+ },
"type": "magento2-module",
"installation-source": "dist",
"autoload": {
@@ -1784,7 +1773,7 @@
"registration.php"
],
"psr-4": {
- "Magento\\Payment\\": ""
+ "Magento\\GroupedProduct\\": ""
}
},
"license": [
@@ -1794,39 +1783,36 @@
"description": "N/A"
},
{
- "name": "magento/module-checkout",
- "version": "100.0.6",
- "version_normalized": "100.0.6.0",
+ "name": "magento/module-shipping",
+ "version": "100.0.5",
+ "version_normalized": "100.0.5.0",
"dist": {
"type": "zip",
- "url": "https://repo.magento.com/archives/magento/module-checkout/magento-module-checkout-100.0.6.0.zip",
+ "url": "https://repo.magento.com/archives/magento/module-shipping/magento-module-shipping-100.0.5.0.zip",
"reference": null,
- "shasum": "00a9f12d725ee8e7116fea63bdcc9be6808707ec"
+ "shasum": "f86d757b879e697b21795206f6e405f6648560a5"
},
"require": {
+ "ext-gd": "*",
"magento/framework": "100.0.*",
"magento/module-backend": "100.0.*",
"magento/module-catalog": "100.0.*",
"magento/module-catalog-inventory": "100.0.*",
- "magento/module-config": "100.0.*",
+ "magento/module-contact": "100.0.*",
"magento/module-customer": "100.0.*",
"magento/module-directory": "100.0.*",
- "magento/module-eav": "100.0.*",
- "magento/module-msrp": "100.0.*",
- "magento/module-page-cache": "100.0.*",
"magento/module-payment": "100.0.*",
"magento/module-quote": "100.0.*",
"magento/module-sales": "100.0.*",
- "magento/module-sales-rule": "100.0.*",
- "magento/module-shipping": "100.0.*",
"magento/module-store": "100.0.*",
"magento/module-tax": "100.0.*",
- "magento/module-theme": "100.0.*",
"magento/module-ui": "100.0.*",
+ "magento/module-user": "100.0.*",
"php": "~5.5.0|~5.6.0|~7.0.0"
},
"suggest": {
- "magento/module-cookie": "100.0.*"
+ "magento/module-fedex": "100.0.*",
+ "magento/module-ups": "100.0.*"
},
"type": "magento2-module",
"installation-source": "dist",
@@ -1835,7 +1821,7 @@
"registration.php"
],
"psr-4": {
- "Magento\\Checkout\\": ""
+ "Magento\\Shipping\\": ""
}
},
"license": [
@@ -1845,28 +1831,44 @@
"description": "N/A"
},
{
- "name": "magento/module-msrp",
- "version": "100.0.5",
- "version_normalized": "100.0.5.0",
+ "name": "magento/module-sales",
+ "version": "100.0.7",
+ "version_normalized": "100.0.7.0",
"dist": {
"type": "zip",
- "url": "https://repo.magento.com/archives/magento/module-msrp/magento-module-msrp-100.0.5.0.zip",
+ "url": "https://repo.magento.com/archives/magento/module-sales/magento-module-sales-100.0.7.0.zip",
"reference": null,
- "shasum": "653c1c33ba5d5a7293da933225a5a399553b275a"
+ "shasum": "82fede25e06ca9116ba02b4ddf855301496dcf02"
},
"require": {
"magento/framework": "100.0.*",
+ "magento/module-authorization": "100.0.*",
+ "magento/module-backend": "100.0.*",
"magento/module-catalog": "100.0.*",
- "magento/module-downloadable": "100.0.*",
+ "magento/module-catalog-inventory": "100.0.*",
+ "magento/module-checkout": "100.0.*",
+ "magento/module-config": "100.0.*",
+ "magento/module-customer": "100.0.*",
+ "magento/module-directory": "100.0.*",
"magento/module-eav": "100.0.*",
- "magento/module-grouped-product": "100.0.*",
+ "magento/module-gift-message": "100.0.*",
+ "magento/module-media-storage": "100.0.*",
+ "magento/module-payment": "100.0.*",
+ "magento/module-quote": "100.0.*",
+ "magento/module-reports": "100.0.*",
+ "magento/module-sales-rule": "100.0.*",
+ "magento/module-sales-sequence": "100.0.*",
+ "magento/module-shipping": "100.0.*",
"magento/module-store": "100.0.*",
"magento/module-tax": "100.0.*",
+ "magento/module-theme": "100.0.*",
+ "magento/module-ui": "100.0.*",
+ "magento/module-widget": "100.0.*",
+ "magento/module-wishlist": "100.0.*",
"php": "~5.5.0|~5.6.0|~7.0.0"
},
"suggest": {
- "magento/module-bundle": "100.0.*",
- "magento/module-msrp-sample-data": "Sample Data version:100.0.*"
+ "magento/module-sales-sample-data": "Sample Data version:100.0.*"
},
"type": "magento2-module",
"installation-source": "dist",
@@ -1875,7 +1877,7 @@
"registration.php"
],
"psr-4": {
- "Magento\\Msrp\\": ""
+ "Magento\\Sales\\": ""
}
},
"license": [
@@ -1885,14 +1887,14 @@
"description": "N/A"
},
{
- "name": "magento/module-grouped-product",
+ "name": "magento/module-wishlist",
"version": "100.0.5",
"version_normalized": "100.0.5.0",
"dist": {
"type": "zip",
- "url": "https://repo.magento.com/archives/magento/module-grouped-product/magento-module-grouped-product-100.0.5.0.zip",
+ "url": "https://repo.magento.com/archives/magento/module-wishlist/magento-module-wishlist-100.0.5.0.zip",
"reference": null,
- "shasum": "e06f107530068cf9cd67961778378a4affdd90b5"
+ "shasum": "fd8e0a487ce397b68b8099fe742355c0cff8dfa5"
},
"require": {
"magento/framework": "100.0.*",
@@ -1901,16 +1903,20 @@
"magento/module-catalog-inventory": "100.0.*",
"magento/module-checkout": "100.0.*",
"magento/module-customer": "100.0.*",
- "magento/module-eav": "100.0.*",
- "magento/module-media-storage": "100.0.*",
- "magento/module-msrp": "100.0.*",
- "magento/module-quote": "100.0.*",
+ "magento/module-grouped-product": "100.0.*",
+ "magento/module-rss": "100.0.*",
"magento/module-sales": "100.0.*",
"magento/module-store": "100.0.*",
+ "magento/module-theme": "100.0.*",
+ "magento/module-ui": "100.0.*",
"php": "~5.5.0|~5.6.0|~7.0.0"
},
"suggest": {
- "magento/module-grouped-product-sample-data": "Sample Data version:100.0.*"
+ "magento/module-bundle": "100.0.*",
+ "magento/module-configurable-product": "100.0.*",
+ "magento/module-cookie": "100.0.*",
+ "magento/module-downloadable": "100.0.*",
+ "magento/module-wishlist-sample-data": "Sample Data version:100.0.*"
},
"type": "magento2-module",
"installation-source": "dist",
@@ -1919,7 +1925,7 @@
"registration.php"
],
"psr-4": {
- "Magento\\GroupedProduct\\": ""
+ "Magento\\Wishlist\\": ""
}
},
"license": [
@@ -1929,36 +1935,29 @@
"description": "N/A"
},
{
- "name": "magento/module-wishlist",
+ "name": "magento/module-gift-message",
"version": "100.0.5",
"version_normalized": "100.0.5.0",
"dist": {
"type": "zip",
- "url": "https://repo.magento.com/archives/magento/module-wishlist/magento-module-wishlist-100.0.5.0.zip",
+ "url": "https://repo.magento.com/archives/magento/module-gift-message/magento-module-gift-message-100.0.5.0.zip",
"reference": null,
- "shasum": "fd8e0a487ce397b68b8099fe742355c0cff8dfa5"
+ "shasum": "a731bace9979bb66c2f01f9fb28145aaa66cf279"
},
"require": {
"magento/framework": "100.0.*",
"magento/module-backend": "100.0.*",
"magento/module-catalog": "100.0.*",
- "magento/module-catalog-inventory": "100.0.*",
"magento/module-checkout": "100.0.*",
"magento/module-customer": "100.0.*",
- "magento/module-grouped-product": "100.0.*",
- "magento/module-rss": "100.0.*",
+ "magento/module-eav": "100.0.*",
+ "magento/module-quote": "100.0.*",
"magento/module-sales": "100.0.*",
"magento/module-store": "100.0.*",
- "magento/module-theme": "100.0.*",
- "magento/module-ui": "100.0.*",
"php": "~5.5.0|~5.6.0|~7.0.0"
},
"suggest": {
- "magento/module-bundle": "100.0.*",
- "magento/module-configurable-product": "100.0.*",
- "magento/module-cookie": "100.0.*",
- "magento/module-downloadable": "100.0.*",
- "magento/module-wishlist-sample-data": "Sample Data version:100.0.*"
+ "magento/module-multishipping": "100.0.*"
},
"type": "magento2-module",
"installation-source": "dist",
@@ -1967,7 +1966,7 @@
"registration.php"
],
"psr-4": {
- "Magento\\Wishlist\\": ""
+ "Magento\\GiftMessage\\": ""
}
},
"license": [
@@ -1977,20 +1976,17 @@
"description": "N/A"
},
{
- "name": "magento/module-rss",
+ "name": "magento/module-sales-sequence",
"version": "100.0.5",
"version_normalized": "100.0.5.0",
"dist": {
"type": "zip",
- "url": "https://repo.magento.com/archives/magento/module-rss/magento-module-rss-100.0.5.0.zip",
+ "url": "https://repo.magento.com/archives/magento/module-sales-sequence/magento-module-sales-sequence-100.0.5.0.zip",
"reference": null,
- "shasum": "47602b4f89980a11ef068003801362a4da84f269"
+ "shasum": "8be5c44ab31c6f007398ff94f17bbc112b56299a"
},
"require": {
"magento/framework": "100.0.*",
- "magento/module-backend": "100.0.*",
- "magento/module-customer": "100.0.*",
- "magento/module-store": "100.0.*",
"php": "~5.5.0|~5.6.0|~7.0.0"
},
"type": "magento2-module",
@@ -2000,7 +1996,7 @@
"registration.php"
],
"psr-4": {
- "Magento\\Rss\\": ""
+ "Magento\\SalesSequence\\": ""
}
},
"license": [
@@ -2010,30 +2006,22 @@
"description": "N/A"
},
{
- "name": "magento/module-gift-message",
+ "name": "magento/module-rss",
"version": "100.0.5",
"version_normalized": "100.0.5.0",
"dist": {
"type": "zip",
- "url": "https://repo.magento.com/archives/magento/module-gift-message/magento-module-gift-message-100.0.5.0.zip",
+ "url": "https://repo.magento.com/archives/magento/module-rss/magento-module-rss-100.0.5.0.zip",
"reference": null,
- "shasum": "a731bace9979bb66c2f01f9fb28145aaa66cf279"
+ "shasum": "47602b4f89980a11ef068003801362a4da84f269"
},
"require": {
"magento/framework": "100.0.*",
"magento/module-backend": "100.0.*",
- "magento/module-catalog": "100.0.*",
- "magento/module-checkout": "100.0.*",
"magento/module-customer": "100.0.*",
- "magento/module-eav": "100.0.*",
- "magento/module-quote": "100.0.*",
- "magento/module-sales": "100.0.*",
"magento/module-store": "100.0.*",
"php": "~5.5.0|~5.6.0|~7.0.0"
},
- "suggest": {
- "magento/module-multishipping": "100.0.*"
- },
"type": "magento2-module",
"installation-source": "dist",
"autoload": {
@@ -2041,7 +2029,7 @@
"registration.php"
],
"psr-4": {
- "Magento\\GiftMessage\\": ""
+ "Magento\\Rss\\": ""
}
},
"license": [
@@ -2051,19 +2039,31 @@
"description": "N/A"
},
{
- "name": "magento/module-sales-sequence",
+ "name": "magento/module-cms",
"version": "100.0.5",
"version_normalized": "100.0.5.0",
"dist": {
"type": "zip",
- "url": "https://repo.magento.com/archives/magento/module-sales-sequence/magento-module-sales-sequence-100.0.5.0.zip",
+ "url": "https://repo.magento.com/archives/magento/module-cms/magento-module-cms-100.0.5.0.zip",
"reference": null,
- "shasum": "8be5c44ab31c6f007398ff94f17bbc112b56299a"
+ "shasum": "5e739065c857bd930225300ebc43cffa95605fbf"
},
"require": {
"magento/framework": "100.0.*",
+ "magento/module-backend": "100.0.*",
+ "magento/module-catalog": "100.0.*",
+ "magento/module-email": "100.0.*",
+ "magento/module-media-storage": "100.0.*",
+ "magento/module-store": "100.0.*",
+ "magento/module-theme": "100.0.*",
+ "magento/module-ui": "100.0.*",
+ "magento/module-variable": "100.0.*",
+ "magento/module-widget": "100.0.*",
"php": "~5.5.0|~5.6.0|~7.0.0"
},
+ "suggest": {
+ "magento/module-cms-sample-data": "Sample Data version:100.0.*"
+ },
"type": "magento2-module",
"installation-source": "dist",
"autoload": {
@@ -2071,7 +2071,7 @@
"registration.php"
],
"psr-4": {
- "Magento\\SalesSequence\\": ""
+ "Magento\\Cms\\": ""
}
},
"license": [
@@ -2386,13 +2386,13 @@
},
{
"name": "magento/module-backup",
- "version": "100.0.5",
- "version_normalized": "100.0.5.0",
+ "version": "100.0.6",
+ "version_normalized": "100.0.6.0",
"dist": {
"type": "zip",
- "url": "https://repo.magento.com/archives/magento/module-backup/magento-module-backup-100.0.5.0.zip",
+ "url": "https://repo.magento.com/archives/magento/module-backup/magento-module-backup-100.0.6.0.zip",
"reference": null,
- "shasum": "f00cae2d6da998dcd5d7c29ec254123a21c2eb8c"
+ "shasum": "46588c767d0a9037799e5c5456db20e5adc18847"
},
"require": {
"magento/framework": "100.0.*",
@@ -2493,13 +2493,13 @@
},
{
"name": "magento/module-webapi",
- "version": "100.0.5",
- "version_normalized": "100.0.5.0",
+ "version": "100.0.6",
+ "version_normalized": "100.0.6.0",
"dist": {
"type": "zip",
- "url": "https://repo.magento.com/archives/magento/module-webapi/magento-module-webapi-100.0.5.0.zip",
+ "url": "https://repo.magento.com/archives/magento/module-webapi/magento-module-webapi-100.0.6.0.zip",
"reference": null,
- "shasum": "fc8813ae2017132a5b9ebb0bc9d02fe3f9d5774f"
+ "shasum": "de30d4518317db49014473867b6bc9bdfd634c7e"
},
"require": {
"magento/framework": "100.0.*",
@@ -3059,13 +3059,13 @@
},
{
"name": "magento/module-paypal",
- "version": "100.0.5",
- "version_normalized": "100.0.5.0",
+ "version": "100.0.6",
+ "version_normalized": "100.0.6.0",
"dist": {
"type": "zip",
- "url": "https://repo.magento.com/archives/magento/module-paypal/magento-module-paypal-100.0.5.0.zip",
+ "url": "https://repo.magento.com/archives/magento/module-paypal/magento-module-paypal-100.0.6.0.zip",
"reference": null,
- "shasum": "00c4fdaea15989b7db0c389f67c1211099d77802"
+ "shasum": "693f078dea41d6793dcce5db636a46d977050654"
},
"require": {
"lib-libxml": "*",
@@ -3149,13 +3149,13 @@
},
{
"name": "magento/module-offline-payments",
- "version": "100.0.5",
- "version_normalized": "100.0.5.0",
+ "version": "100.0.6",
+ "version_normalized": "100.0.6.0",
"dist": {
"type": "zip",
- "url": "https://repo.magento.com/archives/magento/module-offline-payments/magento-module-offline-payments-100.0.5.0.zip",
+ "url": "https://repo.magento.com/archives/magento/module-offline-payments/magento-module-offline-payments-100.0.6.0.zip",
"reference": null,
- "shasum": "415b222e7ed3e9d67124947de26f31138a8281a8"
+ "shasum": "3a846d6b729ef96209d629b5bdb96ba87625d8f2"
},
"require": {
"magento/framework": "100.0.*",
@@ -3606,13 +3606,13 @@
},
{
"name": "magento/module-deploy",
- "version": "100.0.5",
- "version_normalized": "100.0.5.0",
+ "version": "100.0.6",
+ "version_normalized": "100.0.6.0",
"dist": {
"type": "zip",
- "url": "https://repo.magento.com/archives/magento/module-deploy/magento-module-deploy-100.0.5.0.zip",
+ "url": "https://repo.magento.com/archives/magento/module-deploy/magento-module-deploy-100.0.6.0.zip",
"reference": null,
- "shasum": "bcf8835df106fb67170e59c0809a5f3b99f185d1"
+ "shasum": "e5cc66c6502dd14ba2be0737961ba97a3fd72dee"
},
"require": {
"magento/framework": "100.0.*",
@@ -3852,13 +3852,13 @@
},
{
"name": "magento/module-captcha",
- "version": "100.0.6",
- "version_normalized": "100.0.6.0",
+ "version": "100.0.7",
+ "version_normalized": "100.0.7.0",
"dist": {
"type": "zip",
- "url": "https://repo.magento.com/archives/magento/module-captcha/magento-module-captcha-100.0.6.0.zip",
+ "url": "https://repo.magento.com/archives/magento/module-captcha/magento-module-captcha-100.0.7.0.zip",
"reference": null,
- "shasum": "822c0f58618485c26b5aca7c2bb38abd2a5f8277"
+ "shasum": "642d83460877a0e0b15a2373abfa1b8dca214285"
},
"require": {
"magento/framework": "100.0.*",
@@ -4047,13 +4047,13 @@
},
{
"name": "magento/module-braintree",
- "version": "100.0.5",
- "version_normalized": "100.0.5.0",
+ "version": "100.0.6",
+ "version_normalized": "100.0.6.0",
"dist": {
"type": "zip",
- "url": "https://repo.magento.com/archives/magento/module-braintree/magento-module-braintree-100.0.5.0.zip",
+ "url": "https://repo.magento.com/archives/magento/module-braintree/magento-module-braintree-100.0.6.0.zip",
"reference": null,
- "shasum": "ed9b516ba022ef63fce27393726b3f90f3d571a6"
+ "shasum": "2f68cc659891297e3346f60a32e910b2208faf93"
},
"require": {
"braintree/braintree_php": "2.39.0",
@@ -4092,13 +4092,13 @@
},
{
"name": "magento/module-authorizenet",
- "version": "100.0.5",
- "version_normalized": "100.0.5.0",
+ "version": "100.0.6",
+ "version_normalized": "100.0.6.0",
"dist": {
"type": "zip",
- "url": "https://repo.magento.com/archives/magento/module-authorizenet/magento-module-authorizenet-100.0.5.0.zip",
+ "url": "https://repo.magento.com/archives/magento/module-authorizenet/magento-module-authorizenet-100.0.6.0.zip",
"reference": null,
- "shasum": "8afc16a41ec226a403ad6fea7cf06aa3952e2418"
+ "shasum": "0e0c204dbb84e15e1d8b67930fe5159201094966"
},
"require": {
"magento/framework": "100.0.*",
@@ -4290,23 +4290,23 @@
},
{
"name": "symfony/process",
- "version": "v2.8.4",
- "version_normalized": "2.8.4.0",
+ "version": "v2.8.6",
+ "version_normalized": "2.8.6.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/process.git",
- "reference": "fb467471952ef5cf8497c029980e556b47545333"
+ "reference": "1276bd9be89be039748cf753a2137f4ef149cd74"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/process/zipball/fb467471952ef5cf8497c029980e556b47545333",
- "reference": "fb467471952ef5cf8497c029980e556b47545333",
+ "url": "https://api.github.com/repos/symfony/process/zipball/1276bd9be89be039748cf753a2137f4ef149cd74",
+ "reference": "1276bd9be89be039748cf753a2137f4ef149cd74",
"shasum": ""
},
"require": {
"php": ">=5.3.9"
},
- "time": "2016-03-23 13:11:46",
+ "time": "2016-04-14 15:22:22",
"type": "library",
"extra": {
"branch-alias": {
@@ -4341,8 +4341,8 @@
},
{
"name": "symfony/finder",
- "version": "v2.8.4",
- "version_normalized": "2.8.4.0",
+ "version": "v2.8.6",
+ "version_normalized": "2.8.6.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/finder.git",
@@ -4541,23 +4541,23 @@
},
{
"name": "symfony/filesystem",
- "version": "v2.8.4",
- "version_normalized": "2.8.4.0",
+ "version": "v2.8.6",
+ "version_normalized": "2.8.6.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/filesystem.git",
- "reference": "f08ffdf229252cd2745558cb2112df43903bcae4"
+ "reference": "dee379131dceed90a429e951546b33edfe7dccbb"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/filesystem/zipball/f08ffdf229252cd2745558cb2112df43903bcae4",
- "reference": "f08ffdf229252cd2745558cb2112df43903bcae4",
+ "url": "https://api.github.com/repos/symfony/filesystem/zipball/dee379131dceed90a429e951546b33edfe7dccbb",
+ "reference": "dee379131dceed90a429e951546b33edfe7dccbb",
"shasum": ""
},
"require": {
"php": ">=5.3.9"
},
- "time": "2016-03-27 10:20:16",
+ "time": "2016-04-12 18:01:21",
"type": "library",
"extra": {
"branch-alias": {
@@ -4740,17 +4740,17 @@
},
{
"name": "symfony/event-dispatcher",
- "version": "v2.8.4",
- "version_normalized": "2.8.4.0",
+ "version": "v2.8.6",
+ "version_normalized": "2.8.6.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/event-dispatcher.git",
- "reference": "47d2d8cade9b1c3987573d2943bb9352536cdb87"
+ "reference": "a158f13992a3147d466af7a23b564ac719a4ddd8"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/47d2d8cade9b1c3987573d2943bb9352536cdb87",
- "reference": "47d2d8cade9b1c3987573d2943bb9352536cdb87",
+ "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/a158f13992a3147d466af7a23b564ac719a4ddd8",
+ "reference": "a158f13992a3147d466af7a23b564ac719a4ddd8",
"shasum": ""
},
"require": {
@@ -4767,7 +4767,7 @@
"symfony/dependency-injection": "",
"symfony/http-kernel": ""
},
- "time": "2016-03-07 14:04:32",
+ "time": "2016-05-03 18:59:18",
"type": "library",
"extra": {
"branch-alias": {
@@ -5084,6 +5084,47 @@
]
},
{
+ "name": "colinmollenhour/credis",
+ "version": "1.6",
+ "version_normalized": "1.6.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/colinmollenhour/credis.git",
+ "reference": "409edfd0ea81f5cb74afbdb86df54890c207b5e4"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/colinmollenhour/credis/zipball/409edfd0ea81f5cb74afbdb86df54890c207b5e4",
+ "reference": "409edfd0ea81f5cb74afbdb86df54890c207b5e4",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.0"
+ },
+ "time": "2015-11-28 01:20:04",
+ "type": "library",
+ "installation-source": "dist",
+ "autoload": {
+ "classmap": [
+ "Client.php",
+ "Cluster.php",
+ "Sentinel.php"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Colin Mollenhour",
+ "email": "colin@mollenhour.com"
+ }
+ ],
+ "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"
+ },
+ {
"name": "magento/zendframework1",
"version": "1.12.16",
"version_normalized": "1.12.16.0",
@@ -5133,9 +5174,49 @@
]
},
{
+ "name": "colinmollenhour/php-redis-session-abstract",
+ "version": "v1.1",
+ "version_normalized": "1.1.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/colinmollenhour/php-redis-session-abstract.git",
+ "reference": "95330b7f29663dab81f53d1a438e4d927b6c5f66"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/colinmollenhour/php-redis-session-abstract/zipball/95330b7f29663dab81f53d1a438e4d927b6c5f66",
+ "reference": "95330b7f29663dab81f53d1a438e4d927b6c5f66",
+ "shasum": ""
+ },
+ "require": {
+ "colinmollenhour/credis": "1.6",
+ "magento/zendframework1": "1.12.16",
+ "php": "~5.5.0|~5.6.0|~7.0.0"
+ },
+ "time": "2016-02-03 18:13:49",
+ "type": "library",
+ "installation-source": "dist",
+ "autoload": {
+ "psr-0": {
+ "Cm\\RedisSession\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Colin Mollenhour"
+ }
+ ],
+ "description": "A Redis-based session handler with optimistic locking",
+ "homepage": "https://github.com/colinmollenhour/php-redis-session-abstract"
+ },
+ {
"name": "zendframework/zend-stdlib",
- "version": "2.4.9",
- "version_normalized": "2.4.9.0",
+ "version": "2.4.10",
+ "version_normalized": "2.4.10.0",
"source": {
"type": "git",
"url": "https://github.com/zendframework/zend-stdlib.git",
@@ -5191,8 +5272,8 @@
},
{
"name": "zendframework/zend-validator",
- "version": "2.4.9",
- "version_normalized": "2.4.9.0",
+ "version": "2.4.10",
+ "version_normalized": "2.4.10.0",
"source": {
"type": "git",
"url": "https://github.com/zendframework/zend-validator.git",
@@ -5258,8 +5339,8 @@
},
{
"name": "zendframework/zend-escaper",
- "version": "2.4.9",
- "version_normalized": "2.4.9.0",
+ "version": "2.4.10",
+ "version_normalized": "2.4.10.0",
"source": {
"type": "git",
"url": "https://github.com/zendframework/zend-escaper.git",
@@ -5305,8 +5386,8 @@
},
{
"name": "zendframework/zend-uri",
- "version": "2.4.9",
- "version_normalized": "2.4.9.0",
+ "version": "2.4.10",
+ "version_normalized": "2.4.10.0",
"source": {
"type": "git",
"url": "https://github.com/zendframework/zend-uri.git",
@@ -5355,8 +5436,8 @@
},
{
"name": "zendframework/zend-loader",
- "version": "2.4.9",
- "version_normalized": "2.4.9.0",
+ "version": "2.4.10",
+ "version_normalized": "2.4.10.0",
"source": {
"type": "git",
"url": "https://github.com/zendframework/zend-loader.git",
@@ -5402,8 +5483,8 @@
},
{
"name": "zendframework/zend-http",
- "version": "2.4.9",
- "version_normalized": "2.4.9.0",
+ "version": "2.4.10",
+ "version_normalized": "2.4.10.0",
"source": {
"type": "git",
"url": "https://github.com/zendframework/zend-http.git",
@@ -5455,8 +5536,8 @@
},
{
"name": "zendframework/zend-servicemanager",
- "version": "2.4.9",
- "version_normalized": "2.4.9.0",
+ "version": "2.4.10",
+ "version_normalized": "2.4.10.0",
"source": {
"type": "git",
"url": "https://github.com/zendframework/zend-servicemanager.git",
@@ -5507,8 +5588,8 @@
},
{
"name": "zendframework/zend-log",
- "version": "2.4.9",
- "version_normalized": "2.4.9.0",
+ "version": "2.4.10",
+ "version_normalized": "2.4.10.0",
"source": {
"type": "git",
"url": "https://github.com/zendframework/zend-log.git",
@@ -5571,8 +5652,8 @@
},
{
"name": "zendframework/zend-math",
- "version": "2.4.9",
- "version_normalized": "2.4.9.0",
+ "version": "2.4.10",
+ "version_normalized": "2.4.10.0",
"source": {
"type": "git",
"url": "https://github.com/zendframework/zend-math.git",
@@ -5624,8 +5705,8 @@
},
{
"name": "zendframework/zend-json",
- "version": "2.4.9",
- "version_normalized": "2.4.9.0",
+ "version": "2.4.10",
+ "version_normalized": "2.4.10.0",
"source": {
"type": "git",
"url": "https://github.com/zendframework/zend-json.git",
@@ -5680,8 +5761,8 @@
},
{
"name": "zendframework/zend-serializer",
- "version": "2.4.9",
- "version_normalized": "2.4.9.0",
+ "version": "2.4.10",
+ "version_normalized": "2.4.10.0",
"source": {
"type": "git",
"url": "https://github.com/zendframework/zend-serializer.git",
@@ -5735,8 +5816,8 @@
},
{
"name": "zendframework/zend-eventmanager",
- "version": "2.4.9",
- "version_normalized": "2.4.9.0",
+ "version": "2.4.10",
+ "version_normalized": "2.4.10.0",
"source": {
"type": "git",
"url": "https://github.com/zendframework/zend-eventmanager.git",
@@ -5783,8 +5864,8 @@
},
{
"name": "zendframework/zend-code",
- "version": "2.4.9",
- "version_normalized": "2.4.9.0",
+ "version": "2.4.10",
+ "version_normalized": "2.4.10.0",
"source": {
"type": "git",
"url": "https://github.com/zendframework/zend-code.git",
@@ -5838,8 +5919,8 @@
},
{
"name": "zendframework/zend-di",
- "version": "2.4.9",
- "version_normalized": "2.4.9.0",
+ "version": "2.4.10",
+ "version_normalized": "2.4.10.0",
"source": {
"type": "git",
"url": "https://github.com/zendframework/zend-di.git",
@@ -5891,8 +5972,8 @@
},
{
"name": "zendframework/zend-filter",
- "version": "2.4.9",
- "version_normalized": "2.4.9.0",
+ "version": "2.4.10",
+ "version_normalized": "2.4.10.0",
"source": {
"type": "git",
"url": "https://github.com/zendframework/zend-filter.git",
@@ -5949,8 +6030,8 @@
},
{
"name": "zendframework/zend-inputfilter",
- "version": "2.4.9",
- "version_normalized": "2.4.9.0",
+ "version": "2.4.10",
+ "version_normalized": "2.4.10.0",
"source": {
"type": "git",
"url": "https://github.com/zendframework/zend-inputfilter.git",
@@ -6002,8 +6083,8 @@
},
{
"name": "zendframework/zend-form",
- "version": "2.4.9",
- "version_normalized": "2.4.9.0",
+ "version": "2.4.10",
+ "version_normalized": "2.4.10.0",
"source": {
"type": "git",
"url": "https://github.com/zendframework/zend-form.git",
@@ -6075,8 +6156,8 @@
},
{
"name": "zendframework/zend-config",
- "version": "2.4.9",
- "version_normalized": "2.4.9.0",
+ "version": "2.4.10",
+ "version_normalized": "2.4.10.0",
"source": {
"type": "git",
"url": "https://github.com/zendframework/zend-config.git",
@@ -6134,8 +6215,8 @@
},
{
"name": "zendframework/zend-view",
- "version": "2.4.9",
- "version_normalized": "2.4.9.0",
+ "version": "2.4.10",
+ "version_normalized": "2.4.10.0",
"source": {
"type": "git",
"url": "https://github.com/zendframework/zend-view.git",
@@ -6213,8 +6294,8 @@
},
{
"name": "zendframework/zend-i18n",
- "version": "2.4.9",
- "version_normalized": "2.4.9.0",
+ "version": "2.4.10",
+ "version_normalized": "2.4.10.0",
"source": {
"type": "git",
"url": "https://github.com/zendframework/zend-i18n.git",
@@ -6279,8 +6360,8 @@
},
{
"name": "zendframework/zend-text",
- "version": "2.4.9",
- "version_normalized": "2.4.9.0",
+ "version": "2.4.10",
+ "version_normalized": "2.4.10.0",
"source": {
"type": "git",
"url": "https://github.com/zendframework/zend-text.git",
@@ -6328,8 +6409,8 @@
},
{
"name": "zendframework/zend-mvc",
- "version": "2.4.9",
- "version_normalized": "2.4.9.0",
+ "version": "2.4.10",
+ "version_normalized": "2.4.10.0",
"source": {
"type": "git",
"url": "https://github.com/zendframework/zend-mvc.git",
@@ -6418,8 +6499,8 @@
},
{
"name": "zendframework/zend-modulemanager",
- "version": "2.4.9",
- "version_normalized": "2.4.9.0",
+ "version": "2.4.10",
+ "version_normalized": "2.4.10.0",
"source": {
"type": "git",
"url": "https://github.com/zendframework/zend-modulemanager.git",
@@ -6478,8 +6559,8 @@
},
{
"name": "zendframework/zend-console",
- "version": "2.4.9",
- "version_normalized": "2.4.9.0",
+ "version": "2.4.10",
+ "version_normalized": "2.4.10.0",
"source": {
"type": "git",
"url": "https://github.com/zendframework/zend-console.git",
@@ -6530,8 +6611,8 @@
},
{
"name": "zendframework/zend-crypt",
- "version": "2.4.9",
- "version_normalized": "2.4.9.0",
+ "version": "2.4.10",
+ "version_normalized": "2.4.10.0",
"source": {
"type": "git",
"url": "https://github.com/zendframework/zend-crypt.git",
@@ -6584,8 +6665,8 @@
},
{
"name": "zendframework/zend-server",
- "version": "2.4.9",
- "version_normalized": "2.4.9.0",
+ "version": "2.4.10",
+ "version_normalized": "2.4.10.0",
"source": {
"type": "git",
"url": "https://github.com/zendframework/zend-server.git",
@@ -6633,8 +6714,8 @@
},
{
"name": "zendframework/zend-soap",
- "version": "2.4.9",
- "version_normalized": "2.4.9.0",
+ "version": "2.4.10",
+ "version_normalized": "2.4.10.0",
"source": {
"type": "git",
"url": "https://github.com/zendframework/zend-soap.git",
@@ -6687,13 +6768,13 @@
},
{
"name": "magento/magento2-base",
- "version": "2.0.5",
- "version_normalized": "2.0.5.0",
+ "version": "2.0.6",
+ "version_normalized": "2.0.6.0",
"dist": {
"type": "zip",
- "url": "https://repo.magento.com/archives/magento/magento2-base/magento-magento2-base-2.0.5.0.zip",
+ "url": "https://repo.magento.com/archives/magento/magento2-base/magento-magento2-base-2.0.6.0.zip",
"reference": null,
- "shasum": "bf8651c1475548c710ee905166b57c65f1482aea"
+ "shasum": "2cbc57a9cba85c2507e3fec7edadeb3ad795d532"
},
"require": {
"braintree/braintree_php": "2.39.0",
@@ -6738,7 +6819,6 @@
"replace": {
"blueimp/jquery-file-upload": "5.6.14",
"colinmollenhour/cache-backend-redis": "1.8",
- "colinmollenhour/credis": "1.5",
"components/jquery": "1.11.0",
"components/jqueryui": "1.10.4",
"tinymce/tinymce": "3.4.7",
@@ -6750,7 +6830,6 @@
"component_paths": {
"trentrichardson/jquery-timepicker-addon": "lib/web/jquery/jquery-ui-timepicker-addon.js",
"colinmollenhour/cache-backend-redis": "lib/internal/Cm/Cache/Backend/Redis.php",
- "colinmollenhour/credis": "lib/internal/Credis",
"components/jquery": [
"lib/web/jquery.js",
"lib/web/jquery/jquery.min.js",
@@ -6771,10 +6850,6 @@
"lib/internal/LinLibertineFont"
],
[
- "lib/internal/Credis",
- "lib/internal/Credis"
- ],
- [
"lib/.htaccess",
"lib/.htaccess"
],
@@ -7241,16 +7316,18 @@
},
{
"name": "magento/product-community-edition",
- "version": "2.0.5",
- "version_normalized": "2.0.5.0",
+ "version": "2.0.6",
+ "version_normalized": "2.0.6.0",
"dist": {
"type": "zip",
- "url": "https://repo.magento.com/archives/magento/product-community-edition/magento-product-community-edition-2.0.5.0.zip",
+ "url": "https://repo.magento.com/archives/magento/product-community-edition/magento-product-community-edition-2.0.6.0.zip",
"reference": null,
- "shasum": "a652f333b48fc07e376fdd78e317328e65c4f0a8"
+ "shasum": "e1856ebd6bdb9b0e42546f8176b6f471fc4431b9"
},
"require": {
"braintree/braintree_php": "2.39.0",
+ "colinmollenhour/credis": "1.6",
+ "colinmollenhour/php-redis-session-abstract": "1.1",
"composer/composer": "1.0.0-alpha10",
"ext-ctype": "*",
"ext-curl": "*",
@@ -7268,7 +7345,7 @@
"ext-zip": "*",
"lib-libxml": "*",
"magento/composer": "~1.0.0",
- "magento/framework": "100.0.7",
+ "magento/framework": "100.0.8",
"magento/language-de_de": "100.0.5",
"magento/language-en_us": "100.0.5",
"magento/language-es_es": "100.0.5",
@@ -7277,19 +7354,19 @@
"magento/language-pt_br": "100.0.5",
"magento/language-zh_hans_cn": "100.0.5",
"magento/magento-composer-installer": "*",
- "magento/magento2-base": "2.0.5",
+ "magento/magento2-base": "2.0.6",
"magento/module-admin-notification": "100.0.5",
"magento/module-advanced-pricing-import-export": "100.0.6",
"magento/module-authorization": "100.0.5",
- "magento/module-authorizenet": "100.0.5",
- "magento/module-backend": "100.0.6",
- "magento/module-backup": "100.0.5",
- "magento/module-braintree": "100.0.5",
+ "magento/module-authorizenet": "100.0.6",
+ "magento/module-backend": "100.0.7",
+ "magento/module-backup": "100.0.6",
+ "magento/module-braintree": "100.0.6",
"magento/module-bundle": "100.0.5",
"magento/module-bundle-import-export": "100.0.5",
"magento/module-cache-invalidate": "100.0.5",
- "magento/module-captcha": "100.0.6",
- "magento/module-catalog": "100.0.6",
+ "magento/module-captcha": "100.0.7",
+ "magento/module-catalog": "100.0.7",
"magento/module-catalog-import-export": "100.0.6",
"magento/module-catalog-inventory": "100.0.5",
"magento/module-catalog-rule": "100.0.5",
@@ -7310,7 +7387,7 @@
"magento/module-currency-symbol": "100.0.5",
"magento/module-customer": "100.0.6",
"magento/module-customer-import-export": "100.0.5",
- "magento/module-deploy": "100.0.5",
+ "magento/module-deploy": "100.0.6",
"magento/module-developer": "100.0.5",
"magento/module-dhl": "100.0.5",
"magento/module-directory": "100.0.5",
@@ -7328,7 +7405,7 @@
"magento/module-grouped-product": "100.0.5",
"magento/module-import-export": "100.0.5",
"magento/module-indexer": "100.0.5",
- "magento/module-integration": "100.0.5",
+ "magento/module-integration": "100.0.6",
"magento/module-layered-navigation": "100.0.5",
"magento/module-marketplace": "100.0.5",
"magento/module-media-storage": "100.0.5",
@@ -7336,21 +7413,21 @@
"magento/module-multishipping": "100.0.5",
"magento/module-new-relic-reporting": "100.0.5",
"magento/module-newsletter": "100.0.6",
- "magento/module-offline-payments": "100.0.5",
+ "magento/module-offline-payments": "100.0.6",
"magento/module-offline-shipping": "100.0.5",
- "magento/module-page-cache": "100.0.5",
- "magento/module-payment": "100.0.5",
- "magento/module-paypal": "100.0.5",
+ "magento/module-page-cache": "100.0.6",
+ "magento/module-payment": "100.0.6",
+ "magento/module-paypal": "100.0.6",
"magento/module-persistent": "100.0.5",
"magento/module-product-alert": "100.0.5",
"magento/module-product-video": "100.0.5",
- "magento/module-quote": "100.0.5",
+ "magento/module-quote": "100.0.6",
"magento/module-reports": "100.0.5",
"magento/module-require-js": "100.0.5",
"magento/module-review": "100.0.5",
"magento/module-rss": "100.0.5",
"magento/module-rule": "100.0.5",
- "magento/module-sales": "100.0.6",
+ "magento/module-sales": "100.0.7",
"magento/module-sales-rule": "100.0.5",
"magento/module-sales-sequence": "100.0.5",
"magento/module-sample-data": "100.0.5",
@@ -7372,7 +7449,7 @@
"magento/module-usps": "100.0.5",
"magento/module-variable": "100.0.5",
"magento/module-version": "100.0.5",
- "magento/module-webapi": "100.0.5",
+ "magento/module-webapi": "100.0.6",
"magento/module-webapi-security": "100.0.1",
"magento/module-weee": "100.0.5",
"magento/module-widget": "100.0.6",
@@ -7582,17 +7659,17 @@
},
{
"name": "sebastian/environment",
- "version": "1.3.5",
- "version_normalized": "1.3.5.0",
+ "version": "1.3.6",
+ "version_normalized": "1.3.6.0",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/environment.git",
- "reference": "dc7a29032cf72b54f36dac15a1ca5b3a1b6029bf"
+ "reference": "2292b116f43c272ff4328083096114f84ea46a56"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/dc7a29032cf72b54f36dac15a1ca5b3a1b6029bf",
- "reference": "dc7a29032cf72b54f36dac15a1ca5b3a1b6029bf",
+ "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/2292b116f43c272ff4328083096114f84ea46a56",
+ "reference": "2292b116f43c272ff4328083096114f84ea46a56",
"shasum": ""
},
"require": {
@@ -7601,7 +7678,7 @@
"require-dev": {
"phpunit/phpunit": "~4.4"
},
- "time": "2016-02-26 18:40:46",
+ "time": "2016-05-04 07:59:13",
"type": "library",
"extra": {
"branch-alias": {
@@ -7754,23 +7831,23 @@
},
{
"name": "symfony/yaml",
- "version": "v2.8.4",
- "version_normalized": "2.8.4.0",
+ "version": "v2.8.6",
+ "version_normalized": "2.8.6.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/yaml.git",
- "reference": "584e52cb8f788a887553ba82db6caacb1d6260bb"
+ "reference": "e4fbcc65f90909c999ac3b4dfa699ee6563a9940"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/yaml/zipball/584e52cb8f788a887553ba82db6caacb1d6260bb",
- "reference": "584e52cb8f788a887553ba82db6caacb1d6260bb",
+ "url": "https://api.github.com/repos/symfony/yaml/zipball/e4fbcc65f90909c999ac3b4dfa699ee6563a9940",
+ "reference": "e4fbcc65f90909c999ac3b4dfa699ee6563a9940",
"shasum": ""
},
"require": {
"php": ">=5.3.9"
},
- "time": "2016-03-04 07:54:35",
+ "time": "2016-03-29 19:00:15",
"type": "library",
"extra": {
"branch-alias": {
@@ -7962,23 +8039,26 @@
},
{
"name": "phpunit/php-timer",
- "version": "1.0.7",
- "version_normalized": "1.0.7.0",
+ "version": "1.0.8",
+ "version_normalized": "1.0.8.0",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-timer.git",
- "reference": "3e82f4e9fc92665fafd9157568e4dcb01d014e5b"
+ "reference": "38e9124049cf1a164f1e4537caf19c99bf1eb260"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3e82f4e9fc92665fafd9157568e4dcb01d014e5b",
- "reference": "3e82f4e9fc92665fafd9157568e4dcb01d014e5b",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/38e9124049cf1a164f1e4537caf19c99bf1eb260",
+ "reference": "38e9124049cf1a164f1e4537caf19c99bf1eb260",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
- "time": "2015-06-21 08:01:12",
+ "require-dev": {
+ "phpunit/phpunit": "~4|~5"
+ },
+ "time": "2016-05-12 18:03:57",
"type": "library",
"installation-source": "dist",
"autoload": {
@@ -8320,17 +8400,17 @@
},
{
"name": "symfony/config",
- "version": "v2.8.4",
- "version_normalized": "2.8.4.0",
+ "version": "v2.8.6",
+ "version_normalized": "2.8.6.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/config.git",
- "reference": "5273f4724dc5288fe7a33cb08077ab9852621f2c"
+ "reference": "edbbcf33cffa2a85104fc80de8dc052cc51596bb"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/config/zipball/5273f4724dc5288fe7a33cb08077ab9852621f2c",
- "reference": "5273f4724dc5288fe7a33cb08077ab9852621f2c",
+ "url": "https://api.github.com/repos/symfony/config/zipball/edbbcf33cffa2a85104fc80de8dc052cc51596bb",
+ "reference": "edbbcf33cffa2a85104fc80de8dc052cc51596bb",
"shasum": ""
},
"require": {
@@ -8340,7 +8420,7 @@
"suggest": {
"symfony/yaml": "To use the yaml reference dumper"
},
- "time": "2016-03-04 07:54:35",
+ "time": "2016-04-20 18:52:26",
"type": "library",
"extra": {
"branch-alias": {
@@ -8375,17 +8455,17 @@
},
{
"name": "symfony/dependency-injection",
- "version": "v2.8.4",
- "version_normalized": "2.8.4.0",
+ "version": "v2.8.6",
+ "version_normalized": "2.8.6.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/dependency-injection.git",
- "reference": "f7b4a498e679fa440b16facb934680a1527ed48c"
+ "reference": "bd04588c087651ceffdc45d40dc4de05af9c7c52"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/f7b4a498e679fa440b16facb934680a1527ed48c",
- "reference": "f7b4a498e679fa440b16facb934680a1527ed48c",
+ "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/bd04588c087651ceffdc45d40dc4de05af9c7c52",
+ "reference": "bd04588c087651ceffdc45d40dc4de05af9c7c52",
"shasum": ""
},
"require": {
@@ -8401,10 +8481,11 @@
},
"suggest": {
"symfony/config": "",
+ "symfony/expression-language": "For using expressions in service container configuration",
"symfony/proxy-manager-bridge": "Generate service proxies to lazy load them",
"symfony/yaml": ""
},
- "time": "2016-03-21 07:27:21",
+ "time": "2016-05-09 18:12:35",
"type": "library",
"extra": {
"branch-alias": {
@@ -8654,8 +8735,8 @@
},
{
"name": "symfony/stopwatch",
- "version": "v3.0.4",
- "version_normalized": "3.0.4.0",
+ "version": "v3.0.6",
+ "version_normalized": "3.0.6.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/stopwatch.git",
--- Magento-CE-2.0.5/vendor/magento/framework/App/Cache/Frontend/Factory.php 2016-04-28 06:15:12.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/framework/App/Cache/Frontend/Factory.php 2016-05-16 20:18:16.000000000 -0300
@@ -67,7 +67,7 @@
*/
protected $_backendOptions = [
'hashed_directory_level' => 1,
- 'hashed_directory_umask' => DriverInterface::WRITEABLE_DIRECTORY_MODE,
+ 'hashed_directory_umask' => 0777,
'file_name_prefix' => 'mage',
];
--- Magento-CE-2.0.5/vendor/magento/framework/AppInterface.php 2016-04-28 06:15:12.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/framework/AppInterface.php 2016-05-16 20:18:16.000000000 -0300
@@ -17,7 +17,7 @@
/**
* Magento version
*/
- const VERSION = '2.0.5';
+ const VERSION = '2.0.6';
/**
* Launch application
--- Magento-CE-2.0.5/vendor/magento/framework/Archive/Helper/File.php 2016-04-28 06:15:12.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/framework/Archive/Helper/File.php 2016-05-16 20:18:16.000000000 -0300
@@ -91,7 +91,7 @@
* @throws LocalizedException
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
*/
- public function open($mode = 'w+', $chmod = DriverInterface::WRITEABLE_FILE_MODE)
+ public function open($mode = 'w+', $chmod = null)
{
$this->_isInWriteMode = $this->_isWritableMode($mode);
@@ -182,7 +182,7 @@
$this->_close();
$this->_fileHandler = false;
- if ($this->_isInWriteMode) {
+ if ($this->_isInWriteMode && isset($this->_chmod)) {
@chmod($this->_filePath, $this->_chmod);
}
}
--- Magento-CE-2.0.5/vendor/magento/framework/Archive/Tar.php 2016-04-28 06:15:12.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/framework/Archive/Tar.php 2016-05-16 20:18:16.000000000 -0300
@@ -404,7 +404,7 @@
if (in_array($header['type'], ["0", chr(0), ''])) {
if (!file_exists($dirname)) {
- $mkdirResult = @mkdir($dirname, DriverInterface::WRITEABLE_DIRECTORY_MODE, true);
+ $mkdirResult = @mkdir($dirname, 0777, true);
if (false === $mkdirResult) {
throw new \Magento\Framework\Exception\LocalizedException(
--- Magento-CE-2.0.5/vendor/magento/framework/Backup/Filesystem/Rollback/Ftp.php 2016-04-28 06:15:12.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/framework/Backup/Filesystem/Rollback/Ftp.php 2016-05-16 20:18:16.000000000 -0300
@@ -126,7 +126,7 @@
{
$tmpDir = $this->_snapshot->getBackupsDir() . '/~tmp-' . microtime(true);
- $result = @mkdir($tmpDir, DriverInterface::WRITEABLE_DIRECTORY_MODE);
+ $result = @mkdir($tmpDir);
if (false === $result) {
throw new \Magento\Framework\Backup\Exception\NotEnoughPermissions(
--- Magento-CE-2.0.5/vendor/magento/framework/Backup/Filesystem.php 2016-04-28 06:15:12.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/framework/Backup/Filesystem.php 2016-05-16 20:18:16.000000000 -0300
@@ -279,7 +279,6 @@
}
mkdir($backupsDir);
- chmod($backupsDir, DriverInterface::WRITEABLE_DIRECTORY_MODE);
}
if (!is_writable($backupsDir)) {
--- Magento-CE-2.0.5/vendor/magento/framework/Code/Generator/Io.php 2016-04-28 06:15:12.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/framework/Code/Generator/Io.php 2016-05-16 20:18:16.000000000 -0300
@@ -169,7 +169,7 @@
}
try {
if (!$this->filesystemDriver->isDirectory($directory)) {
- $this->filesystemDriver->createDirectory($directory, DriverInterface::WRITEABLE_DIRECTORY_MODE);
+ $this->filesystemDriver->createDirectory($directory);
}
return true;
} catch (FileSystemException $e) {
--- Magento-CE-2.0.5/vendor/magento/framework/composer.json 2016-04-28 06:15:12.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/framework/composer.json 2016-05-16 20:18:16.000000000 -0300
@@ -2,7 +2,7 @@
"name": "magento/framework",
"description": "N/A",
"type": "magento2-library",
- "version": "100.0.7",
+ "version": "100.0.8",
"license": [
"OSL-3.0",
"AFL-3.0"
--- Magento-CE-2.0.5/vendor/magento/framework/File/Uploader.php 2016-04-28 06:15:12.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/framework/File/Uploader.php 2016-05-16 20:18:16.000000000 -0300
@@ -223,7 +223,6 @@
$this->_result = $this->_moveFile($this->_file['tmp_name'], $destinationFile);
if ($this->_result) {
- $this->chmod($destinationFile);
if ($this->_enableFilesDispersion) {
$fileName = str_replace('\\', '/', self::_addDirSeparator($this->_dispretionPath)) . $fileName;
}
@@ -242,10 +241,12 @@
/**
* @param string $file
* @return void
+ *
+ * @deprecated
*/
protected function chmod($file)
{
- chmod($file, DriverInterface::WRITEABLE_DIRECTORY_MODE);
+ chmod($file, 0777);
}
/**
@@ -554,7 +555,7 @@
}
if (!(@is_dir($destinationFolder)
- || @mkdir($destinationFolder, DriverInterface::WRITEABLE_DIRECTORY_MODE, true)
+ || @mkdir($destinationFolder, 0777, true)
)) {
throw new \Exception("Unable to create directory '{$destinationFolder}'.");
}
--- Magento-CE-2.0.5/vendor/magento/framework/Filesystem/Directory/Write.php 2016-04-28 06:15:12.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/framework/Filesystem/Directory/Write.php 2016-05-16 20:18:16.000000000 -0300
@@ -15,7 +15,7 @@
*
* @var int
*/
- protected $permissions = DriverInterface::WRITEABLE_DIRECTORY_MODE;
+ protected $permissions = 0777;
/**
* Constructor
--- Magento-CE-2.0.5/vendor/magento/framework/Filesystem/Driver/File.php 2016-04-28 06:15:12.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/framework/Filesystem/Driver/File.php 2016-05-16 20:18:16.000000000 -0300
@@ -193,7 +193,7 @@
* @return bool
* @throws FileSystemException
*/
- public function createDirectory($path, $permissions)
+ public function createDirectory($path, $permissions = 0777)
{
return $this->mkdirRecursive($path, $permissions);
}
@@ -206,7 +206,7 @@
* @return bool
* @throws FileSystemException
*/
- private function mkdirRecursive($path, $permissions)
+ private function mkdirRecursive($path, $permissions = 0777)
{
$path = $this->getScheme() . $path;
if (is_dir($path)) {
--- Magento-CE-2.0.5/vendor/magento/framework/Filesystem/DriverInterface.php 2016-04-28 06:15:12.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/framework/Filesystem/DriverInterface.php 2016-05-16 20:18:16.000000000 -0300
@@ -16,11 +16,15 @@
{
/**
* Permissions to give read/write/execute access to owner and owning group, but not to all users
+ *
+ * @deprecated
*/
const WRITEABLE_DIRECTORY_MODE = 0770;
/**
* Permissions to give read/write access to owner and owning group, but not to all users
+ *
+ * @deprecated
*/
const WRITEABLE_FILE_MODE = 0660;
@@ -104,7 +108,7 @@
* @return bool
* @throws FileSystemException
*/
- public function createDirectory($path, $permissions);
+ public function createDirectory($path, $permissions = 0777);
/**
* Read directory
--- Magento-CE-2.0.5/vendor/magento/framework/Filesystem/Io/File.php 2016-04-28 06:15:12.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/framework/Filesystem/Io/File.php 2016-05-16 20:18:16.000000000 -0300
@@ -301,7 +301,7 @@
* @param bool $recursive
* @return bool
*/
- public function mkdir($dir, $mode = DriverInterface::WRITEABLE_DIRECTORY_MODE, $recursive = true)
+ public function mkdir($dir, $mode = 0777, $recursive = true)
{
$this->_cwd();
$result = @mkdir($dir, $mode, $recursive);
@@ -553,7 +553,7 @@
* @return true
* @throws \Exception
*/
- public function checkAndCreateFolder($folder, $mode = DriverInterface::WRITEABLE_DIRECTORY_MODE)
+ public function checkAndCreateFolder($folder, $mode = 0777)
{
if (is_dir($folder)) {
return true;
--- Magento-CE-2.0.5/vendor/magento/framework/Filesystem/Io/Ftp.php 2016-04-28 06:15:12.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/framework/Filesystem/Io/Ftp.php 2016-05-16 20:18:16.000000000 -0300
@@ -159,7 +159,7 @@
* @return bool
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
- public function mkdir($dir, $mode = DriverInterface::WRITEABLE_DIRECTORY_MODE, $recursive = true)
+ public function mkdir($dir, $mode = 0777, $recursive = true)
{
return @ftp_mkdir($this->_conn, $dir);
}
--- Magento-CE-2.0.5/vendor/magento/framework/Filesystem/Io/IoInterface.php 2016-04-28 06:15:12.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/framework/Filesystem/Io/IoInterface.php 2016-05-16 20:18:16.000000000 -0300
@@ -35,7 +35,7 @@
* @param bool $recursive
* @return bool
*/
- public function mkdir($dir, $mode = DriverInterface::WRITEABLE_DIRECTORY_MODE, $recursive = true);
+ public function mkdir($dir, $mode = 0777, $recursive = true);
/**
* Delete a directory
--- Magento-CE-2.0.5/vendor/magento/framework/Filesystem/Io/Sftp.php 2016-04-28 06:15:12.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/framework/Filesystem/Io/Sftp.php 2016-05-16 20:18:16.000000000 -0300
@@ -78,7 +78,7 @@
* @return bool
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
- public function mkdir($dir, $mode = DriverInterface::WRITEABLE_DIRECTORY_MODE, $recursive = true)
+ public function mkdir($dir, $mode = 0777, $recursive = true)
{
if ($recursive) {
$no_errors = true;
--- Magento-CE-2.0.5/vendor/magento/framework/Logger/Handler/Base.php 2016-04-28 06:15:12.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/framework/Logger/Handler/Base.php 2016-05-16 20:18:16.000000000 -0300
@@ -54,7 +54,7 @@
{
$logDir = $this->filesystem->getParentDirectory($this->url);
if (!$this->filesystem->isDirectory($logDir)) {
- $this->filesystem->createDirectory($logDir, DriverInterface::WRITEABLE_DIRECTORY_MODE);
+ $this->filesystem->createDirectory($logDir);
}
parent::write($record);
--- Magento-CE-2.0.5/vendor/magento/framework/Model/ResourceModel/AbstractResource.php 2016-04-28 06:15:12.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/framework/Model/ResourceModel/AbstractResource.php 2016-05-16 20:18:16.000000000 -0300
@@ -3,11 +3,10 @@
* Copyright © 2016 Magento. All rights reserved.
* See COPYING.txt for license details.
*/
-
-// @codingStandardsIgnoreFile
-
namespace Magento\Framework\Model\ResourceModel;
+use Magento\Framework\DataObject;
+
/**
* Abstract resource model
*/
@@ -38,7 +37,6 @@
*/
abstract protected function _construct();
-
/**
* Get connection
*
@@ -119,26 +117,19 @@
/**
* Serialize specified field in an object
*
- * @param \Magento\Framework\DataObject $object
+ * @param DataObject $object
* @param string $field
* @param mixed $defaultValue
* @param bool $unsetEmpty
* @return $this
*/
- protected function _serializeField(\Magento\Framework\DataObject $object, $field, $defaultValue = null, $unsetEmpty = false)
+ protected function _serializeField(DataObject $object, $field, $defaultValue = null, $unsetEmpty = false)
{
$value = $object->getData($field);
- if (empty($value)) {
- if ($unsetEmpty) {
+ if (empty($value) && $unsetEmpty) {
$object->unsetData($field);
} else {
- if (is_object($defaultValue) || is_array($defaultValue)) {
- $defaultValue = serialize($defaultValue);
- }
- $object->setData($field, $defaultValue);
- }
- } elseif (is_array($value) || is_object($value)) {
- $object->setData($field, serialize($value));
+ $object->setData($field, serialize($value ?: $defaultValue));
}
return $this;
@@ -152,24 +143,30 @@
* @param mixed $defaultValue
* @return void
*/
- protected function _unserializeField(\Magento\Framework\DataObject $object, $field, $defaultValue = null)
+ protected function _unserializeField(DataObject $object, $field, $defaultValue = null)
{
$value = $object->getData($field);
+
+ if ($value) {
+ $unserializedValue = @unserialize($value);
+ $value = $unserializedValue !== false || $value === 'b:0;' ? $unserializedValue : $value;
+ }
+
if (empty($value)) {
$object->setData($field, $defaultValue);
- } elseif (!is_array($value) && !is_object($value)) {
- $object->setData($field, unserialize($value));
+ } else {
+ $object->setData($field, $value);
}
}
/**
* Prepare data for passed table
*
- * @param \Magento\Framework\DataObject $object
+ * @param DataObject $object
* @param string $table
* @return array
*/
- protected function _prepareDataForTable(\Magento\Framework\DataObject $object, $table)
+ protected function _prepareDataForTable(DataObject $object, $table)
{
$data = [];
$fields = $this->getConnection()->describeTable($table);
--- Magento-CE-2.0.5/vendor/magento/framework/Model/Test/Unit/ResourceModel/AbstractResourceStub.php 1969-12-31 21:00:00.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/framework/Model/Test/Unit/ResourceModel/AbstractResourceStub.php 2016-05-16 20:18:16.000000000 -0300
@@ -0,0 +1,54 @@
+<?php
+/**
+ * Copyright © 2016 Magento. All rights reserved.
+ * See COPYING.txt for license details.
+ */
+namespace Magento\Framework\Model\Test\Unit\ResourceModel;
+
+use Magento\Framework\DataObject;
+use Magento\Framework\Model\ResourceModel\AbstractResource;
+
+class AbstractResourceStub extends AbstractResource
+{
+ /**
+ * Resource initialization
+ *
+ * @return void
+ */
+ protected function _construct()
+ {
+ return null;
+ }
+
+ /**
+ * Get connection
+ *
+ * @return \Magento\Framework\DB\Adapter\AdapterInterface
+ */
+ protected function getConnection()
+ {
+ return null;
+ }
+
+ /**
+ * @param DataObject $object
+ * @param string $field
+ * @param null $defaultValue
+ * @param bool $unsetEmpty
+ * @return $this
+ */
+ public function _serializeField(DataObject $object, $field, $defaultValue = null, $unsetEmpty = false)
+ {
+ return parent::_serializeField($object, $field, $defaultValue, $unsetEmpty);
+ }
+
+ /**
+ * @param DataObject $object
+ * @param string $field
+ * @param null $defaultValue
+ */
+ public function _unserializeField(DataObject $object, $field, $defaultValue = null)
+ {
+ parent::_unserializeField($object, $field, $defaultValue);
+ }
+}
--- Magento-CE-2.0.5/vendor/magento/framework/Model/Test/Unit/ResourceModel/AbstractResourceTest.php 1969-12-31 21:00:00.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/framework/Model/Test/Unit/ResourceModel/AbstractResourceTest.php 2016-05-16 20:18:16.000000000 -0300
@@ -0,0 +1,108 @@
+<?php
+/**
+ * Copyright © 2016 Magento. All rights reserved.
+ * See COPYING.txt for license details.
+ */
+namespace Magento\Framework\Model\Test\Unit\ResourceModel;
+
+use Magento\Framework\DataObject;
+
+class AbstractResourceTest extends \PHPUnit_Framework_TestCase
+{
+ /**
+ * @param array $arguments
+ * @param string $expectation
+ * @dataProvider serializableFieldsDataProvider
+ */
+ public function testSerializeFields(array $arguments, $expectation)
+ {
+ /** @var DataObject $dataObject */
+ list($dataObject, $field, $defaultValue, $unsetEmpty) = $arguments;
+
+ $abstractResource = new AbstractResourceStub();
+
+ $abstractResource->_serializeField($dataObject, $field, $defaultValue, $unsetEmpty);
+
+ static::assertEquals($expectation, $dataObject->getDataByKey($field));
+ }
+
+ /**
+ * @return array
+ */
+ public function serializableFieldsDataProvider()
+ {
+ $dataObject = new DataObject(
+ [
+ 'object' => new \stdClass(),
+ 'array' => ['a', 'b', 'c'],
+ 'string' => 'i am string',
+ 'int' => 969,
+ 'serialized_object' => 'O:8:"stdClass":0:{}',
+ 'empty_value' => '',
+ 'empty_value_with_default' => ''
+ ]
+ );
+
+ return [
+ [[$dataObject, 'object', null, false], serialize($dataObject->getDataByKey('object'))],
+ [[$dataObject, 'array', null, false], serialize($dataObject->getDataByKey('array'))],
+ [[$dataObject, 'string', null, false], serialize($dataObject->getDataByKey('string'))],
+ [[$dataObject, 'int', null, false], serialize($dataObject->getDataByKey('int'))],
+ [
+ [$dataObject, 'serialized_object', null, false],
+ serialize($dataObject->getDataByKey('serialized_object'))
+ ],
+ [[$dataObject, 'empty_value', null, true], null],
+ [[$dataObject, 'empty_value_with_default', new \stdClass(), false], 'O:8:"stdClass":0:{}'],
+ ];
+ }
+
+ /**
+ * @param array $arguments
+ * @param mixed $expectation
+ * @dataProvider unserializableFieldsDataProvider
+ */
+ public function testUnserializeFields(array $arguments, $expectation)
+ {
+ /** @var DataObject $dataObject */
+ list($dataObject, $field, $defaultValue) = $arguments;
+
+ $abstractResource = new AbstractResourceStub();
+
+ $abstractResource->_unserializeField($dataObject, $field, $defaultValue);
+
+ static::assertEquals($expectation, $dataObject->getDataByKey($field));
+ }
+
+ /**
+ * @return array
+ */
+ public function unserializableFieldsDataProvider()
+ {
+ $dataObject = new DataObject(
+ [
+ 'object' => serialize(new \stdClass()),
+ 'array' => serialize(['a', 'b', 'c']),
+ 'string' => serialize('i am string'),
+ 'int' => serialize(969),
+ 'serialized_object' => serialize('O:8:"stdClass":0:{}'),
+ 'empty_value_with_default' => serialize(''),
+ 'not_serialized_string' => 'i am string',
+ 'serialized_boolean_false' => serialize(false)
+ ]
+ );
+
+ $defaultValue = new \stdClass();
+
+ return [
+ [[$dataObject, 'object', null], unserialize($dataObject->getDataByKey('object'))],
+ [[$dataObject, 'array', null], unserialize($dataObject->getDataByKey('array'))],
+ [[$dataObject, 'string', null], unserialize($dataObject->getDataByKey('string'))],
+ [[$dataObject, 'int', null], unserialize($dataObject->getDataByKey('int'))],
+ [[$dataObject, 'serialized_object', null], unserialize($dataObject->getDataByKey('serialized_object'))],
+ [[$dataObject, 'empty_value_with_default', $defaultValue], $defaultValue],
+ [[$dataObject, 'not_serialized_string', null], 'i am string'],
+ [[$dataObject, 'serialized_boolean_false', null], false]
+ ];
+ }
+}
--- Magento-CE-2.0.5/vendor/magento/framework/ObjectManager/ObjectManager.php 2016-04-28 06:15:12.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/framework/ObjectManager/ObjectManager.php 2016-05-16 20:18:16.000000000 -0300
@@ -27,7 +27,7 @@
protected $_sharedInstances = [];
/**
- * @var Config\Config
+ * @var ConfigInterface
*/
protected $_config;
--- Magento-CE-2.0.5/vendor/magento/framework/Session/Config.php 2016-04-28 06:15:12.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/framework/Session/Config.php 2016-05-16 20:18:16.000000000 -0300
@@ -15,8 +15,6 @@
/**
* Magento session configuration
- *
- * @method Config setSaveHandler()
*/
class Config implements ConfigInterface
{
@@ -130,21 +128,6 @@
$this->_scopeType = $scopeType;
/**
- * Session handler
- *
- * Save handler may be set to custom value in deployment config, which will override everything else.
- * Otherwise, try to read PHP settings for session.save_handler value. Otherwise, use 'files' as default.
- */
- $defaultSaveHandler = $this->getStorageOption('session.save_handler')
- ?: SaveHandlerInterface::DEFAULT_HANDLER;
- $saveMethod = $deploymentConfig->get(
- self::PARAM_SESSION_SAVE_METHOD,
- $defaultSaveHandler
- );
- $saveMethod = $saveMethod === 'db' ? 'user' : $saveMethod;
- $this->setSaveHandler($saveMethod);
-
- /**
* Session path
*/
$savePath = $deploymentConfig->get(self::PARAM_SESSION_SAVE_PATH);
--- Magento-CE-2.0.5/vendor/magento/framework/Session/SaveHandler/Redis/Config.php 1969-12-31 21:00:00.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/framework/Session/SaveHandler/Redis/Config.php 2016-05-16 20:18:16.000000000 -0300
@@ -0,0 +1,291 @@
+<?php
+/**
+ * Copyright © 2016 Magento. All rights reserved.
+ * See COPYING.txt for license details.
+ */
+namespace Magento\Framework\Session\SaveHandler\Redis;
+
+use Magento\Framework\App\Config\ScopeConfigInterface;
+use Magento\Store\Model\ScopeInterface as StoreScopeInterface;
+use Magento\Framework\App\DeploymentConfig;
+use Magento\Framework\App\State;
+
+/**
+ * Redis session save handler
+ */
+class Config implements \Cm\RedisSession\Handler\ConfigInterface
+{
+ /**
+ * Configuration path for log level
+ */
+ const PARAM_LOG_LEVEL = 'session/redis/log_level';
+
+ /**
+ * Configuration path for host
+ */
+ const PARAM_HOST = 'session/redis/host';
+
+ /**
+ * Configuration path for port
+ */
+ const PARAM_PORT = 'session/redis/port';
+
+ /**
+ * Configuration path for database
+ */
+ const PARAM_DATABASE = 'session/redis/database';
+
+ /**
+ * Configuration path for password
+ */
+ const PARAM_PASSWORD = 'session/redis/password';
+
+ /**
+ * Configuration path for connection timeout
+ */
+ const PARAM_TIMEOUT = 'session/redis/timeout';
+
+ /**
+ * Configuration path for persistent identifier
+ */
+ const PARAM_PERSISTENT_IDENTIFIER = 'session/redis/param_persistent_identifier';
+
+ /**
+ * Configuration path for compression threshold
+ */
+ const PARAM_COMPRESSION_THRESHOLD = 'session/redis/param_compression_threshold';
+
+ /**
+ * Configuration path for compression library
+ */
+ const PARAM_COMPRESSION_LIBRARY = 'session/redis/compression_library';
+
+ /**
+ * Configuration path for maximum number of processes that can wait for a lock on one session
+ */
+ const PARAM_MAX_CONCURRENCY = 'session/redis/max_concurrency';
+
+ /**
+ * Configuration path for minimum session lifetime
+ */
+ const PARAM_MAX_LIFETIME = 'session/redis/max_lifetime';
+
+ /**
+ * Configuration path for min
+ */
+ const PARAM_MIN_LIFETIME = 'session/redis/min_lifetime';
+
+ /**
+ * Configuration path for disabling session locking entirely flag
+ */
+ const PARAM_DISABLE_LOCKING = 'session/redis/disable_locking';
+
+ /**
+ * Configuration path for lifetime of session for bots on subsequent writes
+ */
+ const PARAM_BOT_LIFETIME = 'session/redis/bot_lifetime';
+
+ /**
+ * Configuration path for lifetime of session for bots on the first write
+ */
+ const PARAM_BOT_FIRST_LIFETIME = 'session/redis/bot_first_lifetime';
+
+ /**
+ * Configuration path for lifetime of session for non-bots on the first write
+ */
+ const PARAM_FIRST_LIFETIME = 'session/redis/first_lifetime';
+
+ /**
+ * Configuration path for number of seconds to wait before trying to break the lock
+ */
+ const PARAM_BREAK_AFTER = 'session/redis/break_after';
+
+ /**
+ * Cookie lifetime config path
+ */
+ const XML_PATH_COOKIE_LIFETIME = 'web/cookie/cookie_lifetime';
+
+ /**
+ * Admin session lifetime config path
+ */
+ const XML_PATH_ADMIN_SESSION_LIFETIME = 'admin/security/session_lifetime';
+
+ /**
+ * Session max lifetime
+ */
+ const SESSION_MAX_LIFETIME = 31536000;
+
+ /**
+ * Deployment config
+ *
+ * @var DeploymentConfig $deploymentConfig
+ */
+ private $deploymentConfig;
+
+ /**
+ * @var ScopeConfigInterface
+ */
+ private $scopeConfig;
+
+ /**
+ * @param DeploymentConfig $deploymentConfig
+ * @param State $appState
+ * @param ScopeConfigInterface $scopeConfig
+ */
+ public function __construct(
+ DeploymentConfig $deploymentConfig,
+ State $appState,
+ ScopeConfigInterface $scopeConfig
+ ) {
+ $this->deploymentConfig = $deploymentConfig;
+ $this->appState = $appState;
+ $this->scopeConfig = $scopeConfig;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getLogLevel()
+ {
+ return $this->deploymentConfig->get(self::PARAM_LOG_LEVEL);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getHost()
+ {
+ return $this->deploymentConfig->get(self::PARAM_HOST);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getPort()
+ {
+ return $this->deploymentConfig->get(self::PARAM_PORT);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getDatabase()
+ {
+ return $this->deploymentConfig->get(self::PARAM_DATABASE);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getPassword()
+ {
+ return $this->deploymentConfig->get(self::PARAM_PASSWORD);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getTimeout()
+ {
+ return $this->deploymentConfig->get(self::PARAM_TIMEOUT);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getPersistentIdentifier()
+ {
+ return $this->deploymentConfig->get(self::PARAM_PERSISTENT_IDENTIFIER);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getCompressionThreshold()
+ {
+ return $this->deploymentConfig->get(self::PARAM_COMPRESSION_THRESHOLD);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getCompressionLibrary()
+ {
+ return $this->deploymentConfig->get(self::PARAM_COMPRESSION_LIBRARY);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getMaxConcurrency()
+ {
+ return $this->deploymentConfig->get(self::PARAM_MAX_CONCURRENCY);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getMaxLifetime()
+ {
+ return self::SESSION_MAX_LIFETIME;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getMinLifetime()
+ {
+ return $this->deploymentConfig->get(self::PARAM_MIN_LIFETIME);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getDisableLocking()
+ {
+ return $this->deploymentConfig->get(self::PARAM_DISABLE_LOCKING);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getBotLifetime()
+ {
+ return $this->deploymentConfig->get(self::PARAM_BOT_LIFETIME);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getBotFirstLifetime()
+ {
+ return $this->deploymentConfig->get(self::PARAM_BOT_FIRST_LIFETIME);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getFirstLifetime()
+ {
+ return $this->deploymentConfig->get(self::PARAM_FIRST_LIFETIME);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getBreakAfter()
+ {
+ return $this->deploymentConfig->get(self::PARAM_BREAK_AFTER . '_' . $this->appState->getAreaCode());
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getLifetime()
+ {
+ if ($this->appState->getAreaCode() == \Magento\Framework\App\Area::AREA_ADMINHTML) {
+ return (int)$this->scopeConfig->getValue(self::XML_PATH_ADMIN_SESSION_LIFETIME);
+ }
+ return (int)$this->scopeConfig->getValue(self::XML_PATH_COOKIE_LIFETIME, StoreScopeInterface::SCOPE_STORE);
+ }
+}
--- Magento-CE-2.0.5/vendor/magento/framework/Session/SaveHandler/Redis/Logger.php 1969-12-31 21:00:00.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/framework/Session/SaveHandler/Redis/Logger.php 2016-05-16 20:18:16.000000000 -0300
@@ -0,0 +1,93 @@
+<?php
+/**
+ * Copyright © 2016 Magento. All rights reserved.
+ * See COPYING.txt for license details.
+ */
+namespace Magento\Framework\Session\SaveHandler\Redis;
+
+use Cm\RedisSession\Handler\ConfigInterface;
+use Psr\Log\LoggerInterface;
+use Magento\Framework\App\Request\Http as Request;
+
+class Logger implements \Cm\RedisSession\Handler\LoggerInterface
+{
+ /**
+ * @var LoggerInterface
+ */
+ private $logger;
+
+ /**
+ * @var int
+ */
+ private $logLevel;
+
+ /**
+ * @var Request
+ */
+ private $request;
+
+ /**
+ * Logger constructor
+ *
+ * @param ConfigInterface $config
+ * @param LoggerInterface $logger
+ * @param Request $request
+ */
+ public function __construct(ConfigInterface $config, LoggerInterface $logger, Request $request)
+ {
+ $this->logger = $logger;
+ $this->request = $request;
+ $this->logLevel = $config->getLogLevel() ?: self::ALERT;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function setLogLevel($level)
+ {
+ $this->logLevel = $level;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function log($message, $level)
+ {
+ $message .= ' ' . $this->request->getRequestUri();
+ if ($this->logLevel >= $level) {
+ switch ($level) {
+ case self::EMERGENCY:
+ $this->logger->emergency($message);
+ break;
+ case self::ALERT:
+ $this->logger->alert($message);
+ break;
+ case self::CRITICAL:
+ $this->logger->critical($message);
+ break;
+ case self::ERROR:
+ $this->logger->error($message);
+ break;
+ case self::WARNING:
+ $this->logger->warning($message);
+ break;
+ case self::NOTICE:
+ $this->logger->notice($message);
+ break;
+ case self::INFO:
+ $this->logger->info($message);
+ break;
+ default:
+ $this->logger->debug($message);
+ }
+ }
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function logException(\Exception $e)
+ {
+ $this->logger->critical($e->getMessage());
+ }
+}
--- Magento-CE-2.0.5/vendor/magento/framework/Session/SaveHandler/Redis.php 1969-12-31 21:00:00.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/framework/Session/SaveHandler/Redis.php 2016-05-16 20:18:16.000000000 -0300
@@ -0,0 +1,51 @@
+<?php
+/**
+ * Copyright © 2016 Magento. All rights reserved.
+ * See COPYING.txt for license details.
+ */
+namespace Magento\Framework\Session\SaveHandler;
+
+use Cm\RedisSession\Handler\ConfigInterface;
+use Cm\RedisSession\Handler\LoggerInterface;
+use Cm\RedisSession\ConnectionFailedException;
+use Cm\RedisSession\ConcurrentConnectionsExceededException;
+use Magento\Framework\Exception\SessionException;
+use Magento\Framework\Phrase;
+use Magento\Framework\Filesystem;
+use Magento\Framework\App\Filesystem\DirectoryList;
+
+class Redis extends \Cm\RedisSession\Handler
+{
+ /**
+ * @var Filesystem
+ */
+ private $filesystem;
+
+ /**
+ * @param ConfigInterface $config
+ * @param LoggerInterface $logger
+ * @param Filesystem $filesystem
+ * @throws SessionException
+ */
+ public function __construct(ConfigInterface $config, LoggerInterface $logger, Filesystem $filesystem)
+ {
+ $this->filesystem = $filesystem;
+ try {
+ parent::__construct($config, $logger);
+ } catch (ConnectionFailedException $e) {
+ throw new SessionException(new Phrase($e->getMessage()));
+ }
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function read($sessionId)
+ {
+ try {
+ return parent::read($sessionId);
+ } catch (ConcurrentConnectionsExceededException $e) {
+ require $this->filesystem->getDirectoryRead(DirectoryList::PUB)->getAbsolutePath('errors/503.php');
+ }
+ }
+}
--- Magento-CE-2.0.5/vendor/magento/framework/Session/SaveHandler.php 2016-04-28 06:15:12.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/framework/Session/SaveHandler.php 2016-05-16 20:18:16.000000000 -0300
@@ -5,8 +5,10 @@
*/
namespace Magento\Framework\Session;
-use Magento\Framework\App\DeploymentConfig;
+use Magento\Framework\Session\Config;
+use Magento\Framework\Session\Config\ConfigInterface;
use Magento\Framework\Exception\SessionException;
+use Magento\Framework\App\DeploymentConfig;
/**
* Magento session save handler
@@ -21,6 +23,13 @@
protected $saveHandlerAdapter;
/**
+ * Config
+ *
+ * @var ConfigInterface
+ */
+ private $config;
+
+ /**
* Constructor
*
* @param SaveHandlerFactory $saveHandlerFactory
@@ -32,11 +41,21 @@
DeploymentConfig $deploymentConfig,
$default = self::DEFAULT_HANDLER
) {
- $saveMethod = $deploymentConfig->get(\Magento\Framework\Session\Config::PARAM_SESSION_SAVE_METHOD);
+ /**
+ * Session handler
+ *
+ * Save handler may be set to custom value in deployment config, which will override everything else.
+ * Otherwise, try to read PHP settings for session.save_handler value. Otherwise, use 'files' as default.
+ */
+ $defaultSaveHandler = ini_get('session.save_handler') ?: SaveHandlerInterface::DEFAULT_HANDLER;
+ $saveMethod = $deploymentConfig->get(Config::PARAM_SESSION_SAVE_METHOD, $defaultSaveHandler);
+ $this->setSaveHandler($saveMethod);
+
try {
$connection = $saveHandlerFactory->create($saveMethod);
} catch (SessionException $e) {
$connection = $saveHandlerFactory->create($default);
+ $this->setSaveHandler($default);
}
$this->saveHandlerAdapter = $connection;
}
@@ -109,4 +128,35 @@
{
return $this->saveHandlerAdapter->gc($maxLifetime);
}
+
+ /**
+ * Get config
+ *
+ * @return ConfigInterface
+ * @deprecated
+ */
+ private function getConfig()
+ {
+ if (!($this->config instanceof ConfigInterface)) {
+ return \Magento\Framework\App\ObjectManager::getInstance()->get(
+ ConfigInterface::class
+ );
+ }
+ return $this->config;
+ }
+
+ /**
+ * Set session.save_handler option
+ *
+ * @param string $saveHandler
+ * @return $this
+ */
+ private function setSaveHandler($saveHandler)
+ {
+ if ($saveHandler === 'db' || $saveHandler === 'redis') {
+ $saveHandler = 'user';
+ }
+ $this->getConfig()->setOption('session.save_handler', $saveHandler);
+ return $this;
+ }
}
--- Magento-CE-2.0.5/vendor/magento/framework/Session/Test/Unit/ConfigTest.php 2016-04-28 06:15:12.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/framework/Session/Test/Unit/ConfigTest.php 2016-05-16 20:18:16.000000000 -0300
@@ -15,9 +15,6 @@
class ConfigTest extends \PHPUnit_Framework_TestCase
{
- /** mock session.save_handler value from deployment config */
- const SESSION_HANDLER_CONFIG = 'files';
-
/**
* @var \Magento\Framework\TestFramework\Unit\Helper\ObjectManager
*/
@@ -89,7 +86,6 @@
return [
['save_path', 'getSavePath', __DIR__],
['name', 'getName', 'FOOBAR'],
- ['save_handler', 'getSaveHandler', 'user'],
['gc_probability', 'getGcProbability', 42],
['gc_divisor', 'getGcDivisor', 3],
['gc_maxlifetime', 'getGcMaxlifetime', 180],
@@ -135,23 +131,6 @@
$this->assertEquals('FOOBAR', $this->config->getName());
}
- public function testSaveHandlerFromConfig()
- {
- $this->getModel($this->validatorMock);
- $this->assertSame(
- self::SESSION_HANDLER_CONFIG,
- $this->config->getSaveHandler(),
- var_export($this->config->toArray(), 1)
- );
- }
-
- public function testSaveHandlerIsMutable()
- {
- $this->getModel($this->validatorMock);
- $this->config->setSaveHandler('user');
- $this->assertEquals('user', $this->config->getSaveHandler());
- }
-
public function testCookieLifetimeIsMutable()
{
$this->getModel($this->validatorMock);
@@ -370,7 +349,6 @@
true,
true,
[
- 'session.save_handler' => 'files',
'session.cache_limiter' => 'files',
'session.cookie_lifetime' => 7200,
'session.cookie_path' => '/',
@@ -382,7 +360,6 @@
true,
false,
[
- 'session.save_handler' => 'files',
'session.cache_limiter' => 'files',
'session.cookie_httponly' => false,
],
@@ -391,7 +368,6 @@
false,
true,
[
- 'session.save_handler' => 'files',
'session.cache_limiter' => 'files',
'session.cookie_lifetime' => 3600,
'session.cookie_path' => '/',
@@ -454,13 +430,9 @@
$deploymentConfigMock = $this->getMock('Magento\Framework\App\DeploymentConfig', [], [], '', false);
$deploymentConfigMock->expects($this->at(0))
->method('get')
- ->with(Config::PARAM_SESSION_SAVE_METHOD, ini_get('session.save_handler') ?: 'files')
- ->willReturn(self::SESSION_HANDLER_CONFIG);
- $deploymentConfigMock->expects($this->at(1))
- ->method('get')
->with(Config::PARAM_SESSION_SAVE_PATH)
->will($this->returnValue(null));
- $deploymentConfigMock->expects($this->at(2))
+ $deploymentConfigMock->expects($this->at(1))
->method('get')
->with(Config::PARAM_SESSION_CACHE_LIMITER)
->will($this->returnValue('files'));
@@ -471,13 +443,12 @@
'scopeConfig' => $this->configMock,
'validatorFactory' => $this->validatorFactoryMock,
'scopeType' => \Magento\Store\Model\ScopeInterface::SCOPE_STORE,
- 'cacheLimiter' => \Magento\Framework\Session\SaveHandlerInterface::DEFAULT_HANDLER,
+ 'cacheLimiter' => 'files',
'lifetimePath' => 'test_web/test_cookie/test_cookie_lifetime',
'request' => $this->requestMock,
'filesystem' => $filesystemMock,
'deploymentConfig' => $deploymentConfigMock,
]
-
);
return $this->config;
}
--- Magento-CE-2.0.5/vendor/magento/framework/Session/Test/Unit/SaveHandler/Redis/ConfigTest.php 1969-12-31 21:00:00.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/framework/Session/Test/Unit/SaveHandler/Redis/ConfigTest.php 2016-05-16 20:18:16.000000000 -0300
@@ -0,0 +1,249 @@
+<?php
+/**
+ * Copyright © 2016 Magento. All rights reserved.
+ * See COPYING.txt for license details.
+ */
+namespace Magento\Framework\Session\Test\Unit\SaveHandler\Redis;
+
+use Magento\Store\Model\ScopeInterface;
+use Magento\Framework\Session\SaveHandler\Redis\Config;
+
+class ConfigTest extends \PHPUnit_Framework_TestCase
+{
+ /**
+ * @var \Magento\Framework\App\DeploymentConfig|\PHPUnit_Framework_MockObject_MockObject
+ */
+ private $deploymentConfigMock;
+
+ /**
+ * @var \Magento\Framework\App\State|\PHPUnit_Framework_MockObject_MockObject
+ */
+ private $appStateMock;
+
+ /**
+ * @var \Magento\Framework\App\Config|\PHPUnit_Framework_MockObject_MockObject
+ */
+ private $scopeConfigMock;
+
+ /**
+ * @var Config
+ */
+ private $config;
+
+ public function setUp()
+ {
+ $this->deploymentConfigMock = $this->getMock(\Magento\Framework\App\DeploymentConfig::class, [], [], '', false);
+ $this->appStateMock = $this->getMock(\Magento\Framework\App\State::class, [], [], '', false);
+ $this->scopeConfigMock = $this->getMock(\Magento\Framework\App\Config::class, [], [], '', false);
+
+ $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
+ $this->config = $objectManager->getObject(
+ Config::class,
+ [
+ 'deploymentConfig' => $this->deploymentConfigMock,
+ 'appState' => $this->appStateMock,
+ 'scopeConfig' => $this->scopeConfigMock
+ ]
+ );
+ }
+
+ public function testGetLogLevel()
+ {
+ $expected = 2;
+ $this->deploymentConfigMock->expects($this->once())
+ ->method('get')
+ ->with(Config::PARAM_LOG_LEVEL)
+ ->willReturn($expected);
+ $this->assertEquals($this->config->getLogLevel(), $expected);
+ }
+
+ public function testGetHost()
+ {
+ $expected = '127.0.0.1';
+ $this->deploymentConfigMock->expects($this->once())
+ ->method('get')
+ ->with(Config::PARAM_HOST)
+ ->willReturn($expected);
+ $this->assertEquals($this->config->getHost(), $expected);
+ }
+
+ public function testGetPort()
+ {
+ $expected = 1234;
+ $this->deploymentConfigMock->expects($this->once())
+ ->method('get')
+ ->with(Config::PARAM_PORT)
+ ->willReturn($expected);
+ $this->assertEquals($this->config->getPort(), $expected);
+ }
+
+ public function testGetDatabase()
+ {
+ $expected = 2;
+ $this->deploymentConfigMock->expects($this->once())
+ ->method('get')
+ ->with(Config::PARAM_DATABASE)
+ ->willReturn($expected);
+ $this->assertEquals($this->config->getDatabase(), $expected);
+ }
+
+ public function testGetPassword()
+ {
+ $expected = 'password';
+ $this->deploymentConfigMock->expects($this->once())
+ ->method('get')
+ ->with(Config::PARAM_PASSWORD)
+ ->willReturn($expected);
+ $this->assertEquals($this->config->getPassword(), $expected);
+ }
+
+ public function testGetTimeout()
+ {
+ $expected = 10;
+ $this->deploymentConfigMock->expects($this->once())
+ ->method('get')
+ ->with(Config::PARAM_TIMEOUT)
+ ->willReturn($expected);
+ $this->assertEquals($this->config->getTimeout(), $expected);
+ }
+
+ public function testGetPersistentIdentifier()
+ {
+ $expected = 'sess01';
+ $this->deploymentConfigMock->expects($this->once())
+ ->method('get')
+ ->with(Config::PARAM_PERSISTENT_IDENTIFIER)
+ ->willReturn($expected);
+ $this->assertEquals($this->config->getPersistentIdentifier(), $expected);
+ }
+
+ public function testGetCompressionThreshold()
+ {
+ $expected = 2;
+ $this->deploymentConfigMock->expects($this->once())
+ ->method('get')
+ ->with(Config::PARAM_COMPRESSION_THRESHOLD)
+ ->willReturn($expected);
+ $this->assertEquals($this->config->getCompressionThreshold(), $expected);
+ }
+
+ public function testGetCompressionLibrary()
+ {
+ $expected = 'gzip';
+ $this->deploymentConfigMock->expects($this->once())
+ ->method('get')
+ ->with(Config::PARAM_COMPRESSION_LIBRARY)
+ ->willReturn($expected);
+ $this->assertEquals($this->config->getCompressionLibrary(), $expected);
+ }
+
+ public function testGetMaxConcurrency()
+ {
+ $expected = 6;
+ $this->deploymentConfigMock->expects($this->once())
+ ->method('get')
+ ->with(Config::PARAM_MAX_CONCURRENCY)
+ ->willReturn($expected);
+ $this->assertEquals($this->config->getMaxConcurrency(), $expected);
+ }
+
+ public function testGetMaxLifetime()
+ {
+ $this->assertEquals($this->config->getMaxLifetime(), Config::SESSION_MAX_LIFETIME);
+ }
+
+ public function testGetMinLifetime()
+ {
+ $expected = 30;
+ $this->deploymentConfigMock->expects($this->once())
+ ->method('get')
+ ->with(Config::PARAM_MIN_LIFETIME)
+ ->willReturn($expected);
+ $this->assertEquals($this->config->getMinLifetime(), $expected);
+ }
+
+ public function testGetDisableLocking()
+ {
+ $expected = false;
+ $this->deploymentConfigMock->expects($this->once())
+ ->method('get')
+ ->with(Config::PARAM_DISABLE_LOCKING)
+ ->willReturn($expected);
+ $this->assertEquals($this->config->getDisableLocking(), $expected);
+ }
+
+ public function testGetBotLifetime()
+ {
+ $expected = 30;
+ $this->deploymentConfigMock->expects($this->once())
+ ->method('get')
+ ->with(Config::PARAM_BOT_LIFETIME)
+ ->willReturn($expected);
+ $this->assertEquals($this->config->getBotLifetime(), $expected);
+ }
+
+ public function testGetBotFirstLifetime()
+ {
+ $expected = 30;
+ $this->deploymentConfigMock->expects($this->once())
+ ->method('get')
+ ->with(Config::PARAM_BOT_FIRST_LIFETIME)
+ ->willReturn($expected);
+ $this->assertEquals($this->config->getBotFirstLifetime(), $expected);
+ }
+
+ public function testGetFirstLifetime()
+ {
+ $expected = 30;
+ $this->deploymentConfigMock->expects($this->once())
+ ->method('get')
+ ->with(Config::PARAM_FIRST_LIFETIME)
+ ->willReturn($expected);
+ $this->assertEquals($this->config->getFirstLifetime(), $expected);
+ }
+
+ public function testBreakAfter()
+ {
+ $areaCode = 'frontend';
+ $breakAfter = 5;
+ $this->deploymentConfigMock->expects($this->once())
+ ->method('get')
+ ->with(Config::PARAM_BREAK_AFTER . '_' . $areaCode)
+ ->willReturn($breakAfter);
+ $this->appStateMock->expects($this->once())
+ ->method('getAreaCode')
+ ->willReturn($areaCode);
+ $this->assertEquals($this->config->getBreakAfter(), $breakAfter);
+ }
+
+ public function testGetLifetimeAdmin()
+ {
+ $areaCode = 'adminhtml';
+ $expectedLifetime = 123;
+ $this->appStateMock->expects($this->once())
+ ->method('getAreaCode')
+ ->willReturn($areaCode);
+ $this->scopeConfigMock->expects($this->once())
+ ->method('getValue')
+ ->with(Config::XML_PATH_ADMIN_SESSION_LIFETIME)
+ ->willReturn($expectedLifetime);
+ $this->assertEquals($this->config->getLifetime(), $expectedLifetime);
+ }
+
+ public function testGetLifetimeFrontend()
+ {
+ $areaCode = 'frontend';
+ $expectedLifetime = 234;
+ $this->appStateMock->expects($this->once())
+ ->method('getAreaCode')
+ ->willReturn($areaCode);
+ $this->scopeConfigMock->expects($this->once())
+ ->method('getValue')
+ ->with(
+ Config::XML_PATH_COOKIE_LIFETIME,
+ ScopeInterface::SCOPE_STORE
+ )
+ ->willReturn($expectedLifetime);
+ $this->assertEquals($this->config->getLifetime(), $expectedLifetime);
+ }
+}
--- Magento-CE-2.0.5/vendor/magento/framework/Session/Test/Unit/SaveHandler/Redis/LoggerTest.php 1969-12-31 21:00:00.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/framework/Session/Test/Unit/SaveHandler/Redis/LoggerTest.php 2016-05-16 20:18:16.000000000 -0300
@@ -0,0 +1,95 @@
+<?php
+/**
+ * Copyright © 2016 Magento. All rights reserved.
+ * See COPYING.txt for license details.
+ */
+namespace Magento\Framework\Session\Test\Unit\SaveHandler\Redis;
+
+use Cm\RedisSession\Handler\LoggerInterface;
+use Magento\Framework\Session\SaveHandler\Redis\Logger;
+
+class LoggerTest extends \PHPUnit_Framework_TestCase
+{
+ /**
+ * @var \Cm\RedisSession\Handler\ConfigInterface
+ */
+ protected $config;
+
+ /**
+ * @var \Psr\Log\LoggerInterface
+ */
+ protected $psrLogger;
+
+ /**
+ * @var \Magento\Framework\Session\SaveHandler\Redis\Logger
+ */
+ protected $logger;
+
+ /**
+ * @var \Magento\Framework\App\Request\Http
+ */
+ protected $request;
+
+ /**
+ * @var string
+ */
+ protected $requestUri = 'customer/account/login';
+
+ public function setUp()
+ {
+ $this->config = $this->getMock('Cm\RedisSession\Handler\ConfigInterface', [], [], '', false);
+ $this->config->expects($this->once())
+ ->method('getLogLevel')
+ ->willReturn(LoggerInterface::DEBUG);
+ $this->psrLogger = $this->getMock('Psr\Log\LoggerInterface', [], [], '', false);
+ $this->request = $this->getMock('Magento\Framework\App\Request\Http', [], [], '', false);
+ //$this->logger = new Logger($this->config, $this->psrLogger, $this->request);
+ $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
+ $this->logger = $objectManager->getObject(
+ 'Magento\Framework\Session\SaveHandler\Redis\Logger',
+ [
+ 'config' => $this->config,
+ 'logger' => $this->psrLogger,
+ 'request' => $this->request
+ ]
+ );
+ }
+
+ /**
+ * @dataProvider logDataProvider
+ */
+ public function testLog($logLevel, $method)
+ {
+ $message = 'Error message';
+ $this->request->expects($this->once())
+ ->method('getRequestUri')
+ ->willReturn($this->requestUri);
+ $this->psrLogger->expects($this->once())
+ ->method($method)
+ ->with($message . ' ' . $this->requestUri);
+ $this->logger->log($message, $logLevel);
+ }
+
+ public function logDataProvider()
+ {
+ return [
+ [LoggerInterface::EMERGENCY, 'emergency'],
+ [LoggerInterface::ALERT, 'alert'],
+ [LoggerInterface::CRITICAL, 'critical'],
+ [LoggerInterface::ERROR, 'error'],
+ [LoggerInterface::WARNING, 'warning'],
+ [LoggerInterface::NOTICE, 'notice'],
+ [LoggerInterface::INFO, 'info'],
+ [LoggerInterface::DEBUG, 'debug'],
+ ];
+ }
+
+ public function testLogException()
+ {
+ $exception = new \Exception('Error message');
+ $this->psrLogger->expects($this->once())
+ ->method('critical')
+ ->with($exception->getMessage());
+ $this->logger->logException($exception);
+ }
+}
--- Magento-CE-2.0.5/vendor/magento/framework/Setup/BackupRollback.php 2016-04-28 06:15:12.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/framework/Setup/BackupRollback.php 2016-05-16 20:18:16.000000000 -0300
@@ -121,7 +121,7 @@
throw new LocalizedException(new Phrase("This backup type \'$type\' is not supported."));
}
if (!$this->file->isExists($this->backupsDir)) {
- $this->file->createDirectory($this->backupsDir, DriverInterface::WRITEABLE_DIRECTORY_MODE);
+ $this->file->createDirectory($this->backupsDir);
}
$fsBackup->setBackupsDir($this->backupsDir);
$fsBackup->setBackupExtension('tgz');
@@ -201,7 +201,7 @@
$dbBackup = $this->objectManager->create('Magento\Framework\Backup\Db');
$dbBackup->setRootDir($this->directoryList->getRoot());
if (!$this->file->isExists($this->backupsDir)) {
- $this->file->createDirectory($this->backupsDir, DriverInterface::WRITEABLE_DIRECTORY_MODE);
+ $this->file->createDirectory($this->backupsDir);
}
$dbBackup->setBackupsDir($this->backupsDir);
$dbBackup->setBackupExtension('gz');
--- Magento-CE-2.0.5/vendor/magento/framework/Setup/Test/Unit/BackupRollbackTest.php 2016-04-28 06:15:12.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/framework/Setup/Test/Unit/BackupRollbackTest.php 2016-05-16 20:18:16.000000000 -0300
@@ -107,7 +107,7 @@
$this->filesystem->expects($this->once())
->method('create');
$this->file->expects($this->once())->method('isExists')->with($this->path . '/backups')->willReturn(false);
- $this->file->expects($this->once())->method('createDirectory')->with($this->path . '/backups', 0770);
+ $this->file->expects($this->once())->method('createDirectory')->with($this->path . '/backups');
$this->model->codeBackup(time());
}
@@ -158,7 +158,7 @@
$this->filesystem->expects($this->once())
->method('create');
$this->file->expects($this->once())->method('isExists')->with($this->path . '/backups')->willReturn(false);
- $this->file->expects($this->once())->method('createDirectory')->with($this->path . '/backups', 0770);
+ $this->file->expects($this->once())->method('createDirectory')->with($this->path . '/backups');
$this->model->codeBackup(time(), Factory::TYPE_MEDIA);
}
--- Magento-CE-2.0.5/vendor/magento/framework/System/Dirs.php 2016-04-28 06:15:12.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/framework/System/Dirs.php 2016-05-16 20:18:16.000000000 -0300
@@ -75,7 +75,7 @@
* @return true
* @throws \Exception
*/
- public static function mkdirStrict($path, $recursive = true, $mode = DriverInterface::WRITEABLE_DIRECTORY_MODE)
+ public static function mkdirStrict($path, $recursive = true, $mode = 0777)
{
$exists = file_exists($path);
if ($exists && is_dir($path)) {
--- Magento-CE-2.0.5/vendor/magento/framework/System/Ftp.php 2016-04-28 06:15:12.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/framework/System/Ftp.php 2016-05-16 20:18:16.000000000 -0300
@@ -52,7 +52,7 @@
* @param int $mode
* @return bool
*/
- public function mkdirRecursive($path, $mode = DriverInterface::WRITEABLE_DIRECTORY_MODE)
+ public function mkdirRecursive($path, $mode = 0777)
{
$this->checkConnected();
$dir = explode("/", $path);
@@ -219,7 +219,7 @@
* @return bool
* @throws \Exception
*/
- public function upload($remote, $local, $dirMode = DriverInterface::WRITEABLE_DIRECTORY_MODE, $ftpMode = FTP_BINARY)
+ public function upload($remote, $local, $dirMode = 0777, $ftpMode = FTP_BINARY)
{
$this->checkConnected();
--- Magento-CE-2.0.5/vendor/magento/magento2-base/app/bootstrap.php 2016-04-28 06:15:28.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/magento2-base/app/bootstrap.php 2016-05-16 20:18:00.000000000 -0300
@@ -9,7 +9,6 @@
*/
error_reporting(E_ALL);
#ini_set('display_errors', 1);
-umask(0);
/* PHP version validation */
if (version_compare(phpversion(), '5.5.0', '<') === true) {
@@ -31,6 +30,11 @@
require_once __DIR__ . '/autoload.php';
require_once BP . '/app/functions.php';
+/* Custom umask value may be provided in optional mage_umask file in root */
+$umaskFile = BP . '/magento_umask';
+$mask = file_exists($umaskFile) ? octdec(file_get_contents($umaskFile)) : 002;
+umask($mask);
+
if (!empty($_SERVER['MAGE_PROFILER'])
&& isset($_SERVER['HTTP_ACCEPT'])
&& strpos($_SERVER['HTTP_ACCEPT'], 'text/html') !== false
--- Magento-CE-2.0.5/vendor/magento/magento2-base/app/etc/di.xml 2016-04-28 06:15:28.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/magento2-base/app/etc/di.xml 2016-05-16 20:18:00.000000000 -0300
@@ -141,6 +141,8 @@
<preference for="Magento\Framework\Stdlib\DateTime\DateTimeFormatterInterface" type="Magento\Framework\Stdlib\DateTime\DateTimeFormatter"/>
<preference for="Magento\Framework\Api\Search\SearchInterface" type="Magento\Framework\Search\Search"/>
<preference for="Magento\Framework\View\Design\FileResolution\Fallback\ResolverInterface" type="Magento\Framework\View\Design\FileResolution\Fallback\Resolver\Simple" />
+ <preference for="Cm\RedisSession\Handler\ConfigInterface" type="Magento\Framework\Session\SaveHandler\Redis\Config"/>
+ <preference for="Cm\RedisSession\Handler\LoggerInterface" type="Magento\Framework\Session\SaveHandler\Redis\Logger"/>
<type name="Magento\Framework\Model\ResourceModel\Db\TransactionManager" shared="false" />
<type name="Magento\Framework\Logger\Handler\Base">
<arguments>
@@ -186,9 +188,16 @@
<arguments>
<argument name="handlers" xsi:type="array">
<item name="db" xsi:type="string">Magento\Framework\Session\SaveHandler\DbTable</item>
+ <item name="redis" xsi:type="string">Magento\Framework\Session\SaveHandler\Redis</item>
</argument>
</arguments>
</type>
+ <type name="Magento\Framework\Session\SaveHandler\Redis">
+ <arguments>
+ <argument name="config" xsi:type="object">Cm\RedisSession\Handler\ConfigInterface</argument>
+ <argument name="logger" xsi:type="object">Cm\RedisSession\Handler\LoggerInterface</argument>
+ </arguments>
+ </type>
<virtualType name="interceptionConfigScope" type="Magento\Framework\Config\Scope">
<arguments>
<argument name="defaultScope" xsi:type="string">global</argument>
--- Magento-CE-2.0.5/vendor/magento/magento2-base/CHANGELOG.md 2016-04-28 06:15:26.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/magento2-base/CHANGELOG.md 2016-05-16 20:17:58.000000000 -0300
@@ -1,3 +1,16 @@
+2.0.6
+=============
+* Functional fixes:
+ * Fixed issue with Redis sessions.
+ * Fixed issue with Varnish cache on GoDaddy.
+
+* Security fixes:
+ * This release contains several security fixes. We describe each issue in detail in the Magento Security Center (https://www.magento.com/security).
+
+* Enhancements:
+ * Management of file ownership and permissions have been made more flexible.
+ * Support for using the Redis adapter to provide session storage.
+
2.0.5
=============
* Fixed bugs:
--- Magento-CE-2.0.5/vendor/magento/magento2-base/composer.json 2016-04-28 06:15:24.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/magento2-base/composer.json 2016-05-16 20:17:58.000000000 -0300
@@ -2,7 +2,7 @@
"name": "magento/magento2-base",
"description": "Magento 2 Base (Community Edition)",
"type": "magento2-component",
- "version": "2.0.5",
+ "version": "2.0.6",
"require": {
"magento/magento-composer-installer": "*",
"php": "~5.5.0|~5.6.0|~7.0.0",
@@ -50,7 +50,6 @@
"replace": {
"trentrichardson/jquery-timepicker-addon": "1.4.3",
"colinmollenhour/cache-backend-redis": "1.8",
- "colinmollenhour/credis": "1.5",
"components/jquery": "1.11.0",
"blueimp/jquery-file-upload": "5.6.14",
"components/jqueryui": "1.10.4",
@@ -61,7 +60,6 @@
"component_paths": {
"trentrichardson/jquery-timepicker-addon": "lib/web/jquery/jquery-ui-timepicker-addon.js",
"colinmollenhour/cache-backend-redis": "lib/internal/Cm/Cache/Backend/Redis.php",
- "colinmollenhour/credis": "lib/internal/Credis",
"components/jquery": [
"lib/web/jquery.js",
"lib/web/jquery/jquery.min.js",
@@ -82,10 +80,6 @@
"lib/internal/LinLibertineFont"
],
[
- "lib/internal/Credis",
- "lib/internal/Credis"
- ],
- [
"lib/.htaccess",
"lib/.htaccess"
],
--- Magento-CE-2.0.5/vendor/magento/magento2-base/dev/tests/api-functional/testsuite/Magento/Quote/Api/GuestCartManagementTest.php 2016-04-28 06:15:28.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/magento2-base/dev/tests/api-functional/testsuite/Magento/Quote/Api/GuestCartManagementTest.php 2016-05-16 20:18:00.000000000 -0300
@@ -70,9 +70,9 @@
$quote = $this->objectManager->create('Magento\Quote\Model\Quote')->load('test01', 'reserved_order_id');
$cartId = $quote->getId();
/** @var \Magento\Quote\Model\QuoteIdMask $quoteIdMask */
- $quoteIdMask = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()
- ->create('Magento\Quote\Model\QuoteIdMaskFactory')
- ->create();
+ $quoteIdMaskFactory = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()
+ ->create('Magento\Quote\Model\QuoteIdMaskFactory');
+ $quoteIdMask = $quoteIdMaskFactory->create();
$quoteIdMask->load($cartId, 'quote_id');
//Use masked cart Id
$cartId = $quoteIdMask->getMaskedId();
@@ -110,6 +110,7 @@
$this->assertEquals($customer->getId(), $quote->getCustomerId());
$this->assertEquals($customer->getFirstname(), $quote->getCustomerFirstname());
$this->assertEquals($customer->getLastname(), $quote->getCustomerLastname());
+ $this->assertNull($quoteIdMaskFactory->create()->load($cartId, 'masked_id')->getId());
}
/**
--- Magento-CE-2.0.5/vendor/magento/magento2-base/dev/tests/api-functional/testsuite/Magento/Webapi/Authentication/RestTest.php 2016-04-28 06:15:28.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/magento2-base/dev/tests/api-functional/testsuite/Magento/Webapi/Authentication/RestTest.php 2016-05-16 20:18:00.000000000 -0300
@@ -90,6 +90,8 @@
public function testGetRequestTokenExpiredConsumer()
{
$this::consumerFixture('2012-01-01 00:00:00');
+ $this::$_consumer->setUpdatedAt('2012-01-01 00:00:00');
+ $this::$_consumer->save();
/** @var $oAuthClient \Magento\TestFramework\Authentication\Rest\OauthClient */
$oAuthClient = $this->_getOauthClient(self::$_consumerKey, self::$_consumerSecret);
$oAuthClient->requestRequestToken();
--- Magento-CE-2.0.5/vendor/magento/magento2-base/dev/tests/functional/lib/Magento/Mtf/Util/Generate/Factory/AbstractFactory.php 2016-04-28 06:15:26.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/magento2-base/dev/tests/functional/lib/Magento/Mtf/Util/Generate/Factory/AbstractFactory.php 2016-05-16 20:17:58.000000000 -0300
@@ -105,7 +105,7 @@
* @return bool
* @throws \Exception
*/
- protected function checkAndCreateFolder($folder, $mode = DriverInterface::WRITEABLE_DIRECTORY_MODE)
+ protected function checkAndCreateFolder($folder, $mode = 0777)
{
if (is_dir($folder)) {
return true;
@@ -127,7 +127,7 @@
* @param bool $recursive
* @return bool
*/
- protected function mkDir($dir, $mode = 0770, $recursive = true)
+ protected function mkDir($dir, $mode = 0777, $recursive = true)
{
return @mkdir($dir, $mode, $recursive);
}
--- Magento-CE-2.0.5/vendor/magento/magento2-base/dev/tests/integration/framework/Magento/TestFramework/Application.php 2016-04-28 06:15:26.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/magento2-base/dev/tests/integration/framework/Magento/TestFramework/Application.php 2016-05-16 20:17:58.000000000 -0300
@@ -573,7 +573,7 @@
{
if (!file_exists($dir)) {
$old = umask(0);
- mkdir($dir, DriverInterface::WRITEABLE_DIRECTORY_MODE);
+ mkdir($dir);
umask($old);
} elseif (!is_dir($dir)) {
throw new \Magento\Framework\Exception\LocalizedException(__("'%1' is not a directory.", $dir));
--- Magento-CE-2.0.5/vendor/magento/magento2-base/dev/tests/integration/testsuite/Magento/Cms/Model/Wysiwyg/Images/StorageTest.php 2016-04-28 06:15:26.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/magento2-base/dev/tests/integration/testsuite/Magento/Cms/Model/Wysiwyg/Images/StorageTest.php 2016-05-16 20:17:58.000000000 -0300
@@ -25,7 +25,7 @@
'Magento\Cms\Helper\Wysiwyg\Images'
)->getCurrentPath() . 'MagentoCmsModelWysiwygImagesStorageTest';
if (!file_exists(self::$_baseDir)) {
- mkdir(self::$_baseDir, 0770);
+ mkdir(self::$_baseDir);
}
touch(self::$_baseDir . '/1.swf');
}
--- Magento-CE-2.0.5/vendor/magento/magento2-base/dev/tests/integration/testsuite/Magento/Framework/Filesystem/Directory/WriteTest.php 2016-04-28 06:15:26.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/magento2-base/dev/tests/integration/testsuite/Magento/Framework/Filesystem/Directory/WriteTest.php 2016-05-16 20:17:58.000000000 -0300
@@ -28,7 +28,7 @@
*/
public function testInstance()
{
- $dir = $this->getDirectoryInstance('newDir1', 0770);
+ $dir = $this->getDirectoryInstance('newDir1', 0777);
$this->assertTrue($dir instanceof ReadInterface);
$this->assertTrue($dir instanceof WriteInterface);
}
@@ -56,10 +56,10 @@
public function createProvider()
{
return [
- ['newDir1', 0770, "newDir1"],
- ['newDir1', 0770, "root_dir1/subdir1/subdir2"],
- ['newDir2', 0750, "root_dir2/subdir"],
- ['newDir1', 0770, "."]
+ ['newDir1', 0777, "newDir1"],
+ ['newDir1', 0777, "root_dir1/subdir1/subdir2"],
+ ['newDir2', 0777, "root_dir2/subdir"],
+ ['newDir1', 0777, "."]
];
}
@@ -71,7 +71,7 @@
*/
public function testDelete($path)
{
- $directory = $this->getDirectoryInstance('newDir', 0770);
+ $directory = $this->getDirectoryInstance('newDir', 0777);
$directory->create($path);
$this->assertTrue($directory->isExist($path));
$directory->delete($path);
@@ -116,7 +116,7 @@
*/
public function renameProvider()
{
- return [['newDir1', 0770, 'first_name.txt', 'second_name.txt']];
+ return [['newDir1', 0777, 'first_name.txt', 'second_name.txt']];
}
/**
@@ -150,7 +150,7 @@
*/
public function renameTargetDirProvider()
{
- return [['dir1', 'dir2', 0770, 'first_name.txt', 'second_name.txt']];
+ return [['dir1', 'dir2', 0777, 'first_name.txt', 'second_name.txt']];
}
/**
@@ -180,8 +180,8 @@
public function copyProvider()
{
return [
- ['newDir1', 0770, 'first_name.txt', 'second_name.txt'],
- ['newDir1', 0770, 'subdir/first_name.txt', 'subdir/second_name.txt']
+ ['newDir1', 0777, 'first_name.txt', 'second_name.txt'],
+ ['newDir1', 0777, 'subdir/first_name.txt', 'subdir/second_name.txt']
];
}
@@ -216,8 +216,8 @@
public function copyTargetDirProvider()
{
return [
- ['dir1', 'dir2', 0770, 'first_name.txt', 'second_name.txt'],
- ['dir1', 'dir2', 0770, 'subdir/first_name.txt', 'subdir/second_name.txt']
+ ['dir1', 'dir2', 0777, 'first_name.txt', 'second_name.txt'],
+ ['dir1', 'dir2', 0777, 'subdir/first_name.txt', 'subdir/second_name.txt']
];
}
@@ -226,9 +226,9 @@
*/
public function testChangePermissions()
{
- $directory = $this->getDirectoryInstance('newDir1', 0770);
+ $directory = $this->getDirectoryInstance('newDir1', 0777);
$directory->create('test_directory');
- $this->assertTrue($directory->changePermissions('test_directory', 0640));
+ $this->assertTrue($directory->changePermissions('test_directory', 0644));
}
/**
@@ -241,7 +241,7 @@
$directory->create('test_directory/subdirectory');
$directory->writeFile('test_directory/subdirectory/test_file.txt', 'Test Content');
- $this->assertTrue($directory->changePermissionsRecursively('test_directory', 0750, 0640));
+ $this->assertTrue($directory->changePermissionsRecursively('test_directory', 0777, 0644));
}
/**
@@ -269,8 +269,8 @@
public function touchProvider()
{
return [
- ['test_directory', 0770, 'touch_file.txt', time() - 3600],
- ['test_directory', 0770, 'subdirectory/touch_file.txt', time() - 3600]
+ ['test_directory', 0777, 'touch_file.txt', time() - 3600],
+ ['test_directory', 0777, 'subdirectory/touch_file.txt', time() - 3600]
];
}
@@ -279,7 +279,7 @@
*/
public function testIsWritable()
{
- $directory = $this->getDirectoryInstance('newDir1', 0770);
+ $directory = $this->getDirectoryInstance('newDir1', 0777);
$directory->create('bar');
$this->assertFalse($directory->isWritable('not_existing_dir'));
$this->assertTrue($directory->isWritable('bar'));
@@ -310,8 +310,8 @@
public function openFileProvider()
{
return [
- ['newDir1', 0770, 'newFile.txt', 'w+'],
- ['newDir1', 0770, 'subdirectory/newFile.txt', 'w+']
+ ['newDir1', 0777, 'newFile.txt', 'w+'],
+ ['newDir1', 0777, 'subdirectory/newFile.txt', 'w+']
];
}
@@ -325,7 +325,7 @@
*/
public function testWriteFile($path, $content, $extraContent)
{
- $directory = $this->getDirectoryInstance('writeFileDir', 0770);
+ $directory = $this->getDirectoryInstance('writeFileDir', 0777);
$directory->writeFile($path, $content);
$this->assertEquals($content, $directory->readFile($path));
$directory->writeFile($path, $extraContent);
@@ -342,7 +342,7 @@
*/
public function testWriteFileAppend($path, $content, $extraContent)
{
- $directory = $this->getDirectoryInstance('writeFileDir', 0770);
+ $directory = $this->getDirectoryInstance('writeFileDir', 0777);
$directory->writeFile($path, $content, 'a+');
$this->assertEquals($content, $directory->readFile($path));
$directory->writeFile($path, $extraContent, 'a+');
--- Magento-CE-2.0.5/vendor/magento/magento2-base/dev/tests/integration/testsuite/Magento/Framework/Filesystem/Driver/FileTest.php 2016-04-28 06:15:26.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/magento2-base/dev/tests/integration/testsuite/Magento/Framework/Filesystem/Driver/FileTest.php 2016-05-16 20:17:58.000000000 -0300
@@ -75,7 +75,7 @@
if (is_dir($generatedPath)) {
$this->assertTrue($this->driver->deleteDirectory($generatedPathBase));
}
- $this->assertTrue($this->driver->createDirectory($generatedPath, '755'));
+ $this->assertTrue($this->driver->createDirectory($generatedPath));
$this->assertTrue(is_dir($generatedPath));
}
}
--- Magento-CE-2.0.5/vendor/magento/magento2-base/dev/tests/integration/testsuite/Magento/Framework/Session/ConfigTest.php 2016-04-28 06:15:26.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/magento2-base/dev/tests/integration/testsuite/Magento/Framework/Session/ConfigTest.php 2016-05-16 20:17:58.000000000 -0300
@@ -36,15 +36,12 @@
$sessionManager->writeClose();
}
$this->deploymentConfigMock = $this->getMock('Magento\Framework\App\DeploymentConfig', [], [], '', false);
+
$this->deploymentConfigMock->expects($this->at(0))
->method('get')
- ->with($this->equalTo(Config::PARAM_SESSION_SAVE_METHOD), $this->anything())
- ->will($this->returnValue('files'));
- $this->deploymentConfigMock->expects($this->at(1))
- ->method('get')
->with(Config::PARAM_SESSION_SAVE_PATH)
->will($this->returnValue(null));
- $this->deploymentConfigMock->expects($this->at(2))
+ $this->deploymentConfigMock->expects($this->at(1))
->method('get')
->with(Config::PARAM_SESSION_CACHE_LIMITER)
->will($this->returnValue($this->_cacheLimiter));
@@ -86,11 +83,6 @@
$this->assertEquals($this->_model->getSavePath(), $this->_model->getOption('save_path'));
}
- public function testGetSessionSaveMethod()
- {
- $this->assertEquals('files', $this->_model->getSaveHandler());
- }
-
/**
* Unable to add integration tests for testGetLifetimePathNonDefault
*
@@ -122,7 +114,6 @@
return [
['save_path', 'getSavePath', __DIR__],
['name', 'getName', 'FOOBAR'],
- ['save_handler', 'getSaveHandler', 'user'],
['gc_probability', 'getGcProbability', 42],
['gc_divisor', 'getGcDivisor', 3],
['gc_maxlifetime', 'getGcMaxlifetime', 180],
@@ -152,12 +143,6 @@
$this->assertEquals('FOOBAR', $this->_model->getName());
}
- public function testSaveHandlerIsMutable()
- {
- $this->_model->setSaveHandler('user');
- $this->assertEquals('user', $this->_model->getSaveHandler());
- }
-
public function testCookieLifetimeIsMutable()
{
$this->_model->setCookieLifetime(20);
@@ -295,7 +280,7 @@
$this->markTestSkipped('Cannot set session.save_path with ini_set');
}
- $this->deploymentConfigMock->expects($this->at(1))
+ $this->deploymentConfigMock->expects($this->at(0))
->method('get')
->with(Config::PARAM_SESSION_SAVE_PATH)
->will($this->returnValue($given));
--- Magento-CE-2.0.5/vendor/magento/magento2-base/dev/tests/integration/testsuite/Magento/Framework/Session/SaveHandlerTest.php 1969-12-31 21:00:00.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/magento2-base/dev/tests/integration/testsuite/Magento/Framework/Session/SaveHandlerTest.php 2016-05-16 20:17:58.000000000 -0300
@@ -0,0 +1,89 @@
+<?php
+/**
+ * Copyright © 2016 Magento. All rights reserved.
+ * See COPYING.txt for license details.
+ */
+namespace Magento\Framework\Session;
+
+use Magento\Framework\App\DeploymentConfig;
+use Magento\Framework\Session\Config\ConfigInterface;
+use Magento\Framework\Session\SaveHandler;
+use Magento\Framework\App\ObjectManager;
+
+class SaveHandlerTest extends \PHPUnit_Framework_TestCase
+{
+ /** @var \Magento\Framework\Session\Config\ConfigInterface */
+ private $sessionConfig;
+
+ /** @var \Magento\Framework\App\DeploymentConfig */
+ private $deploymentConfig;
+
+ public function setUp()
+ {
+ $this->sessionConfig = ObjectManager::getInstance()->get(ConfigInterface::class);
+ $this->deploymentConfig = ObjectManager::getInstance()->get(DeploymentConfig::class);
+ }
+
+ /**
+ * Tests that the session handler is correctly set when object is created.
+ *
+ * @dataProvider saveHandlerProvider
+ * @param string $deploymentConfigHandler
+ * @param string $iniHandler
+ */
+ public function testSetSaveHandler($deploymentConfigHandler, $iniHandler)
+ {
+ // Set expected session.save_handler config
+ if ($deploymentConfigHandler) {
+ if ($deploymentConfigHandler !== 'files') {
+ $expected = 'user';
+ } else {
+ $expected = $deploymentConfigHandler;
+ }
+ } else if ($iniHandler) {
+ $expected = $iniHandler;
+ } else {
+ $expected = SaveHandlerInterface::DEFAULT_HANDLER;
+ }
+
+ // Set ini configuration
+ if ($iniHandler) {
+ $oldIni = ini_set('session.save_handler', $iniHandler);
+ }
+
+ /** @var DeploymentConfig | \PHPUnit_Framework_MockObject_MockObject $deploymentConfigMock */
+ $deploymentConfigMock = $this->getMockBuilder(DeploymentConfig::class)
+ ->disableOriginalConstructor()
+ ->getMock();
+ $deploymentConfigMock->expects($this->once())
+ ->method('get')
+ ->with(Config::PARAM_SESSION_SAVE_METHOD, SaveHandlerInterface::DEFAULT_HANDLER)
+ ->willReturn($deploymentConfigHandler ?: SaveHandlerInterface::DEFAULT_HANDLER);
+
+ new SaveHandler(
+ ObjectManager::getInstance()->get(SaveHandlerFactory::class),
+ $deploymentConfigMock
+ );
+
+ // Test expectation
+ $this->assertEquals(
+ $expected,
+ ObjectManager::getInstance()->get(ConfigInterface::class)->getOption('session.save_handler')
+ );
+
+ // Reset ini configuration
+ if (isset($oldIni)) {
+ ini_set('session.save_handler', $oldIni);
+ }
+ }
+
+ public function saveHandlerProvider()
+ {
+ return [
+ ['db', false],
+ ['db', 'files'],
+ [false, 'files'],
+ [false, false],
+ ];
+ }
+}
--- Magento-CE-2.0.5/vendor/magento/magento2-base/dev/tests/integration/testsuite/Magento/Paypal/Model/Payment/Method/Billing/AbstractAgreementTest.php 2016-04-28 06:15:26.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/magento2-base/dev/tests/integration/testsuite/Magento/Paypal/Model/Payment/Method/Billing/AbstractAgreementTest.php 2016-05-16 20:17:58.000000000 -0300
@@ -6,6 +6,8 @@
namespace Magento\Paypal\Model\Payment\Method\Billing;
+use Magento\Quote\Api\Data\PaymentInterface;
+
class AbstractAgreementTest extends \PHPUnit_Framework_TestCase
{
/** @var \Magento\Paypal\Model\Method\Agreement */
@@ -60,8 +62,10 @@
)->getFirstItem();
$data = new \Magento\Framework\DataObject(
[
+ PaymentInterface::KEY_ADDITIONAL_DATA => [
AbstractAgreement::TRANSPORT_BILLING_AGREEMENT_ID => $billingAgreement->getId()
]
+ ]
);
$this->_model->assignData($data);
$this->assertEquals(
--- Magento-CE-2.0.5/vendor/magento/magento2-base/dev/tests/integration/testsuite/Magento/Setup/Controller/ComponentGridTest.php 2016-04-28 06:15:26.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/magento2-base/dev/tests/integration/testsuite/Magento/Setup/Controller/ComponentGridTest.php 2016-05-16 20:17:58.000000000 -0300
@@ -15,73 +15,13 @@
use Magento\Framework\Stdlib\DateTime\TimezoneInterface;
use Magento\Setup\Model\MarketplaceManager;
-class ComponentGridTest extends \PHPUnit_Framework_TestCase
-{
- /**
- * @var ComposerInformation|\PHPUnit_Framework_MockObject_MockObject
- */
- private $composerInformationMock;
-
- /**
- * @var UpdatePackagesCache|\PHPUnit_Framework_MockObject_MockObject
- */
- private $updatePackagesCacheMock;
-
- /**
- * @var TimezoneInterface|\PHPUnit_Framework_MockObject_MockObject
- *
- */
- private $timezoneMock;
-
/**
- * @var FullModuleList|\PHPUnit_Framework_MockObject_MockObject
- */
- private $fullModuleListMock;
-
- /**
- * @var ModuleList|\PHPUnit_Framework_MockObject_MockObject
- */
- private $enabledModuleListMock;
-
- /**
- * @var PackageInfoFactory|\PHPUnit_Framework_MockObject_MockObject
- */
- private $packageInfoFactoryMock;
-
- /**
- * Module package info
+ * @deprecated
*
- * @var PackageInfo
+ * @link setup/src/Magento/Setup/Test/Unit/Controller/ComponentGridTest.php
*/
- private $packageInfo;
-
- /**
- * Controller
- *
- * @var ComponentGrid
- */
- private $controller;
-
- /**
- * @var MarketplaceManager
- */
- private $marketplaceManagerMock;
-
- /**
- * @var array
- */
- private $componentData = [];
-
- /**
- * @var array
- */
- private $lastSyncData = [];
-
- /**
- * @var array
- */
- private $convertedLastSyncDate = [];
-
+class ComponentGridTest extends \PHPUnit_Framework_TestCase
+{
/**#@+
* Canned formatted date and time to return from mock
*/
@@ -91,179 +31,17 @@
public function setUp()
{
- $this->convertedLastSyncDate = [
- 'lastSyncDate' => [
- 'date' => self::FORMATTED_DATE,
- 'time' => self::FORMATTED_TIME,
- ],
- ];
-
- $this->lastSyncData = [
- "lastSyncDate" => "1447271496",
- "packages" => [
- 'magento/sample-module-one' => [
- 'name' => 'magento/sample-module-one',
- 'type' => 'magento2-module',
- 'version' => '1.0.0'
- ]
- ],
- 'countOfInstall' => 0,
- 'countOfUpdate' => 1
- ];
- $this->componentData = [
- 'magento/sample-module-one' => [
- 'name' => 'magento/sample-module-one',
- 'type' => 'magento2-module',
- 'version' => '1.0.0'
- ]
- ];
- $allComponentData = [
- 'magento/sample-module-two' => [
- 'name' => 'magento/sample-module-two',
- 'type' => 'magento2-module',
- 'version' => '1.0.0'
- ]
- ];
- $allComponentData = array_merge($allComponentData, $this->componentData);
- $this->composerInformationMock = $this->getMock(
- 'Magento\Framework\Composer\ComposerInformation',
- [],
- [],
- '',
- false
- );
- $objectManagerProvider = $this->getMock('Magento\Setup\Model\ObjectManagerProvider', [], [], '', false);
- $objectManager = $this->getMock('Magento\Framework\ObjectManagerInterface', [], [], '', false);
- $objectManagerProvider->expects($this->once())
- ->method('get')
- ->willReturn($objectManager);
- $this->packageInfoFactoryMock = $this
- ->getMock('Magento\Framework\Module\PackageInfoFactory', [], [], '', false);
- $this->enabledModuleListMock = $this->getMock('Magento\Framework\Module\ModuleList', [], [], '', false);
- $this->enabledModuleListMock->expects($this->any())->method('has')->willReturn(true);
- $this->fullModuleListMock = $this->getMock('Magento\Framework\Module\FullModuleList', [], [], '', false);
- $this->fullModuleListMock->expects($this->any())->method('getNames')->willReturn($allComponentData);
- $this->timezoneMock = $this->getMock('Magento\Framework\Stdlib\DateTime\TimezoneInterface', [], [], '', false);
- $objectManager->expects($this->exactly(4))
- ->method('get')
- ->willReturnMap([
- ['Magento\Framework\Module\PackageInfoFactory', $this->packageInfoFactoryMock],
- ['Magento\Framework\Module\FullModuleList', $this->fullModuleListMock],
- ['Magento\Framework\Module\ModuleList', $this->enabledModuleListMock],
- ['Magento\Framework\Stdlib\DateTime\TimezoneInterface', $this->timezoneMock]
- ]);
- $this->packageInfo = $this->getMock('Magento\Framework\Module\PackageInfo', [], [], '', false);
- $this->updatePackagesCacheMock = $this->getMock('Magento\Setup\Model\UpdatePackagesCache', [], [], '', false);
- $this->marketplaceManagerMock = $this->getMock('Magento\Setup\Model\MarketplaceManager', [], [], '', false);
- $this->packageInfoFactoryMock->expects($this->once())->method('create')->willReturn($this->packageInfo);
- $this->controller = new ComponentGrid(
- $this->composerInformationMock,
- $objectManagerProvider,
- $this->updatePackagesCacheMock,
- $this->marketplaceManagerMock
- );
}
public function testIndexAction()
{
- $viewModel = $this->controller->indexAction();
- $this->assertInstanceOf('Zend\View\Model\ViewModel', $viewModel);
- $this->assertTrue($viewModel->terminate());
}
public function testComponentsAction()
{
- $this->fullModuleListMock->expects($this->once())
- ->method('getNames')
- ->willReturn(['magento/sample-module1']);
- $this->packageInfo->expects($this->once())
- ->method('getModuleName')
- ->willReturn('Sample_Module');
- $this->packageInfo->expects($this->exactly(2))
- ->method('getPackageName')
- ->willReturn($this->componentData['magento/sample-module-one']['name']);
- $this->packageInfo->expects($this->exactly(2))
- ->method('getVersion')
- ->willReturn($this->componentData['magento/sample-module-one']['version']);
- $this->enabledModuleListMock->expects($this->once())
- ->method('has')
- ->willReturn(true);
- $this->composerInformationMock->expects($this->once())
- ->method('getInstalledMagentoPackages')
- ->willReturn($this->componentData);
- $this->composerInformationMock->expects($this->once())
- ->method('isPackageInComposerJson')
- ->willReturn(true);
- $this->updatePackagesCacheMock->expects($this->once())
- ->method('getPackagesForUpdate')
- ->willReturn($this->lastSyncData);
- $this->setupTimezoneMock();
- $jsonModel = $this->controller->componentsAction();
- $this->assertInstanceOf('Zend\View\Model\JsonModel', $jsonModel);
- $variables = $jsonModel->getVariables();
- $this->assertArrayHasKey('success', $variables);
- $this->assertTrue($variables['success']);
- $expected = [[
- 'name' => 'magento/sample-module-one',
- 'type' => 'magento2-module',
- 'version' => '1.0.0',
- 'update' => false,
- 'uninstall' => true,
- 'vendor' => 'magento',
- 'moduleName' => 'Sample_Module',
- 'enable' => true,
- 'disable' => false
- ]];
- $this->assertEquals($expected, $variables['components']);
- $this->assertArrayHasKey('total', $variables);
- $this->assertEquals(1, $variables['total']);
- $expectedLastSyncData = array_replace($this->lastSyncData, $this->convertedLastSyncDate);
- $this->assertEquals($expectedLastSyncData, $variables['lastSyncData']);
}
public function testSyncAction()
{
- $this->updatePackagesCacheMock->expects($this->once())
- ->method('syncPackagesForUpdate');
- $this->updatePackagesCacheMock->expects($this->once())
- ->method('getPackagesForUpdate')
- ->willReturn($this->lastSyncData);
- $this->setupTimezoneMock();
- $jsonModel = $this->controller->syncAction();
- $this->assertInstanceOf('Zend\View\Model\JsonModel', $jsonModel);
- $variables = $jsonModel->getVariables();
- $this->assertArrayHasKey('success', $variables);
- $this->assertTrue($variables['success']);
- $expectedLastSyncData = array_replace($this->lastSyncData, $this->convertedLastSyncDate);
- $this->assertEquals($expectedLastSyncData, $variables['lastSyncData']);
- }
-
- /**
- * Prepare the timezone mock to expect calls and return formatted date and time
- *
- * @return none
- */
- private function setupTimezoneMock()
- {
- $this->timezoneMock->expects($this->at(0))
- ->method('formatDateTime')
- ->with(
- $this->isInstanceOf('\DateTime'),
- \IntlDateFormatter::MEDIUM,
- \IntlDateFormatter::NONE,
- null,
- null,
- null
- )->willReturn(self::FORMATTED_DATE);
- $this->timezoneMock->expects($this->at(1))
- ->method('formatDateTime')
- ->with(
- $this->isInstanceOf('\DateTime'),
- \IntlDateFormatter::NONE,
- \IntlDateFormatter::MEDIUM,
- null,
- null,
- null
- )->willReturn(self::FORMATTED_TIME);
}
}
--- Magento-CE-2.0.5/vendor/magento/magento2-base/dev/tests/integration/testsuite/Magento/Setup/Model/UpdatePackagesCacheTest.php 2016-04-28 06:15:26.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/magento2-base/dev/tests/integration/testsuite/Magento/Setup/Model/UpdatePackagesCacheTest.php 2016-05-16 20:17:58.000000000 -0300
@@ -9,7 +9,6 @@
use Magento\TestFramework\Helper\Bootstrap;
use Magento\Framework\Composer\ComposerJsonFinder;
use Magento\Framework\Composer\MagentoComposerApplicationFactory;
-use Magento\Setup\Model\UpdatePackagesCache;
/**
* Tests Magento\Framework\ComposerInformation
@@ -81,12 +80,6 @@
$this->setupDirectory('testSkeleton');
- $objectManagerProvider = $this->getMock('Magento\Setup\Model\ObjectManagerProvider', [], [], '', false);
- $objectManagerProvider
- ->expects($this->any())
- ->method('get')
- ->willReturn($this->objectManager);
-
/** @var UpdatePackagesCache $updatePackagesCache|\PHPUnit_Framework_MockObject_MockObject */
$updatePackagesCache = $this->getMock('Magento\Setup\Model\UpdatePackagesCache', [], [], '', false);
--- Magento-CE-2.0.5/vendor/magento/magento2-base/dev/tests/static/testsuite/Magento/Test/Integrity/Di/CompilerTest.php 2016-04-28 06:15:28.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/magento2-base/dev/tests/static/testsuite/Magento/Test/Integrity/Di/CompilerTest.php 2016-05-16 20:18:00.000000000 -0300
@@ -69,15 +69,14 @@
$basePath = Files::init()->getPathToSource();
$basePath = str_replace('\\', '/', $basePath);
-
$this->_tmpDir = realpath(__DIR__) . '/tmp';
$this->_generationDir = $this->_tmpDir . '/generation';
if (!file_exists($this->_generationDir)) {
- mkdir($this->_generationDir, 0770, true);
+ mkdir($this->_generationDir, 0777, true);
}
$this->_compilationDir = $this->_tmpDir . '/di';
if (!file_exists($this->_compilationDir)) {
- mkdir($this->_compilationDir, 0770, true);
+ mkdir($this->_compilationDir, 0777, true);
}
$this->_command = 'php ' . $basePath . '/bin/magento setup:di:compile-multi-tenant --generation=%s --di=%s';
--- Magento-CE-2.0.5/vendor/magento/magento2-base/dev/tests/static/testsuite/Magento/Test/Js/Exemplar/JsHintTest.php 2016-04-28 06:15:28.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/magento2-base/dev/tests/static/testsuite/Magento/Test/Js/Exemplar/JsHintTest.php 2016-05-16 20:18:00.000000000 -0300
@@ -29,7 +29,7 @@
{
$reportFile = self::$_cmd->getReportFile();
if (!is_dir(dirname($reportFile))) {
- mkdir(dirname($reportFile), 0770);
+ mkdir(dirname($reportFile));
}
}
--- Magento-CE-2.0.5/vendor/magento/magento2-base/dev/tests/static/testsuite/Magento/Test/Js/LiveCodeTest.php 2016-04-28 06:15:28.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/magento2-base/dev/tests/static/testsuite/Magento/Test/Js/LiveCodeTest.php 2016-05-16 20:18:00.000000000 -0300
@@ -60,7 +60,7 @@
{
$reportDir = Files::init()->getPathToSource() . '/dev/tests/static/report';
if (!is_dir($reportDir)) {
- mkdir($reportDir, 0770);
+ mkdir($reportDir);
}
self::$_reportFile = $reportDir . '/js_report.txt';
@unlink(self::$_reportFile);
--- Magento-CE-2.0.5/vendor/magento/magento2-base/dev/tests/static/testsuite/Magento/Test/Php/LiveCodeTest.php 2016-04-28 06:15:28.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/magento2-base/dev/tests/static/testsuite/Magento/Test/Php/LiveCodeTest.php 2016-05-16 20:18:00.000000000 -0300
@@ -42,7 +42,7 @@
self::$pathToSource = Utility\Files::init()->getPathToSource();
self::$reportDir = self::$pathToSource . '/dev/tests/static/report';
if (!is_dir(self::$reportDir)) {
- mkdir(self::$reportDir, 0770);
+ mkdir(self::$reportDir);
}
}
--- Magento-CE-2.0.5/vendor/magento/magento2-base/.htaccess 2016-04-28 06:15:28.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/magento2-base/.htaccess 2016-05-16 20:18:00.000000000 -0300
@@ -279,6 +279,10 @@
order allow,deny
deny from all
</Files>
+ <Files magento_umask>
+ order allow,deny
+ deny from all
+ </Files>
################################
## If running in cluster environment, uncomment this
--- Magento-CE-2.0.5/vendor/magento/magento2-base/.htaccess.sample 2016-04-28 06:15:26.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/magento2-base/.htaccess.sample 2016-05-16 20:17:58.000000000 -0300
@@ -245,6 +245,10 @@
order allow,deny
deny from all
</Files>
+ <Files magento_umask>
+ order allow,deny
+ deny from all
+ </Files>
################################
## If running in cluster environment, uncomment this
--- Magento-CE-2.0.5/vendor/magento/magento2-base/lib/internal/Credis/Client.php 2016-04-28 06:15:24.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/magento2-base/lib/internal/Credis/Client.php 1969-12-31 21:00:00.000000000 -0300
@@ -1,1113 +0,0 @@
-<?php
-/**
- * Credis_Client (a fork of Redisent)
- *
- * Most commands are compatible with phpredis library:
- * - use "pipeline()" to start a pipeline of commands instead of multi(Redis::PIPELINE)
- * - any arrays passed as arguments will be flattened automatically
- * - setOption and getOption are not supported in standalone mode
- * - order of arguments follows redis-cli instead of phpredis where they differ (lrem)
- *
- * - Uses phpredis library if extension is installed for better performance.
- * - Establishes connection lazily.
- * - Supports tcp and unix sockets.
- * - Reconnects automatically unless a watch or transaction is in progress.
- * - Can set automatic retry connection attempts for iffy Redis connections.
- *
- * @author Colin Mollenhour <colin@mollenhour.com>
- * @copyright 2011 Colin Mollenhour <colin@mollenhour.com>
- * @license http://www.opensource.org/licenses/mit-license.php The MIT License
- * @package Credis_Client
- */
-
-if( ! defined('CRLF')) define('CRLF', sprintf('%s%s', chr(13), chr(10)));
-
-/**
- * Credis-specific errors, wraps native Redis errors
- */
-class CredisException extends Exception
-{
-
- const CODE_TIMED_OUT = 1;
- const CODE_DISCONNECTED = 2;
-
- public function __construct($message, $code = 0, $exception = NULL)
- {
- if ($exception && get_class($exception) == 'RedisException' && $message == 'read error on connection') {
- $code = CredisException::CODE_DISCONNECTED;
- }
- parent::__construct($message, $code, $exception);
- }
-
-}
-
-/**
- * Credis_Client, a lightweight Redis PHP standalone client and phpredis wrapper
- *
- * Server/Connection:
- * @method Credis_Client pipeline()
- * @method Credis_Client multi()
- * @method array exec()
- * @method string flushAll()
- * @method string flushDb()
- * @method array info()
- * @method bool|array config(string $setGet, string $key, string $value = null)
- *
- * Keys:
- * @method int del(string $key)
- * @method int exists(string $key)
- * @method int expire(string $key, int $seconds)
- * @method int expireAt(string $key, int $timestamp)
- * @method array keys(string $key)
- * @method int persist(string $key)
- * @method bool rename(string $key, string $newKey)
- * @method bool renameNx(string $key, string $newKey)
- * @method array sort(string $key, string $arg1, string $valueN = null)
- * @method int ttl(string $key)
- * @method string type(string $key)
- *
- * Scalars:
- * @method int append(string $key, string $value)
- * @method int decr(string $key)
- * @method int decrBy(string $key, int $decrement)
- * @method bool|string get(string $key)
- * @method int getBit(string $key, int $offset)
- * @method string getRange(string $key, int $start, int $end)
- * @method string getSet(string $key, string $value)
- * @method int incr(string $key)
- * @method int incrBy(string $key, int $decrement)
- * @method array mGet(array $keys)
- * @method bool mSet(array $keysValues)
- * @method int mSetNx(array $keysValues)
- * @method bool set(string $key, string $value)
- * @method int setBit(string $key, int $offset, int $value)
- * @method bool setEx(string $key, int $seconds, string $value)
- * @method int setNx(string $key, string $value)
- * @method int setRange(string $key, int $offset, int $value)
- * @method int strLen(string $key)
- *
- * Sets:
- * @method int sAdd(string $key, mixed $value, string $valueN = null)
- * @method int sRem(string $key, mixed $value, string $valueN = null)
- * @method array sMembers(string $key)
- * @method array sUnion(mixed $keyOrArray, string $valueN = null)
- * @method array sInter(mixed $keyOrArray, string $valueN = null)
- * @method array sDiff(mixed $keyOrArray, string $valueN = null)
- * @method string sPop(string $key)
- * @method int sCard(string $key)
- * @method int sIsMember(string $key, string $member)
- * @method int sMove(string $source, string $dest, string $member)
- * @method string|array sRandMember(string $key, int $count = null)
- * @method int sUnionStore(string $dest, string $key1, string $key2 = null)
- * @method int sInterStore(string $dest, string $key1, string $key2 = null)
- * @method int sDiffStore(string $dest, string $key1, string $key2 = null)
- *
- * Hashes:
- * @method bool|int hSet(string $key, string $field, string $value)
- * @method bool hSetNx(string $key, string $field, string $value)
- * @method bool|string hGet(string $key, string $field)
- * @method bool|int hLen(string $key)
- * @method bool hDel(string $key, string $field)
- * @method array hKeys(string $key, string $field)
- * @method array hVals(string $key, string $field)
- * @method array hGetAll(string $key)
- * @method bool hExists(string $key, string $field)
- * @method int hIncrBy(string $key, string $field, int $value)
- * @method bool hMSet(string $key, array $keysValues)
- * @method array hMGet(string $key, array $fields)
- *
- * Lists:
- * @method array|null blPop(string $keyN, int $timeout)
- * @method array|null brPop(string $keyN, int $timeout)
- * @method array|null brPoplPush(string $source, string $destination, int $timeout)
- * @method string|null lIndex(string $key, int $index)
- * @method int lInsert(string $key, string $beforeAfter, string $pivot, string $value)
- * @method int lLen(string $key)
- * @method string|null lPop(string $key)
- * @method int lPush(string $key, mixed $value, mixed $valueN = null)
- * @method int lPushX(string $key, mixed $value)
- * @method array lRange(string $key, int $start, int $stop)
- * @method int lRem(string $key, int $count, mixed $value)
- * @method bool lSet(string $key, int $index, mixed $value)
- * @method bool lTrim(string $key, int $start, int $stop)
- * @method string|null rPop(string $key)
- * @method string|null rPoplPush(string $source, string $destination)
- * @method int rPush(string $key, mixed $value, mixed $valueN = null)
- * @method int rPushX(string $key, mixed $value)
- *
- * Sorted Sets:
- * TODO
- *
- * Pub/Sub
- * @method array pUnsubscribe(mixed $pattern, string $patternN = NULL))
- * @method array unsubscribe(mixed $channel, string $channelN = NULL))
- * @method int publish(string $channel, string $message)
- * @method int|array pubsub(string $subCommand, $arg = NULL)
- *
- * Scripting:
- * @method string|int script(string $command, string $arg1 = null)
- * @method string|int|array|bool eval(string $script, array $keys = NULL, array $args = NULL)
- * @method string|int|array|bool evalSha(string $script, array $keys = NULL, array $args = NULL)
- */
-class Credis_Client {
-
- const TYPE_STRING = 'string';
- const TYPE_LIST = 'list';
- const TYPE_SET = 'set';
- const TYPE_ZSET = 'zset';
- const TYPE_HASH = 'hash';
- const TYPE_NONE = 'none';
- const FREAD_BLOCK_SIZE = 8192;
-
- /**
- * Socket connection to the Redis server or Redis library instance
- * @var resource|Redis
- */
- protected $redis;
- protected $redisMulti;
-
- /**
- * Host of the Redis server
- * @var string
- */
- protected $host;
-
- /**
- * Port on which the Redis server is running
- * @var integer
- */
- protected $port;
-
- /**
- * Timeout for connecting to Redis server
- * @var float
- */
- protected $timeout;
-
- /**
- * Timeout for reading response from Redis server
- * @var float
- */
- protected $readTimeout;
-
- /**
- * Unique identifier for persistent connections
- * @var string
- */
- protected $persistent;
-
- /**
- * @var bool
- */
- protected $closeOnDestruct = TRUE;
-
- /**
- * @var bool
- */
- protected $connected = FALSE;
-
- /**
- * @var bool
- */
- protected $standalone;
-
- /**
- * @var int
- */
- protected $maxConnectRetries = 0;
-
- /**
- * @var int
- */
- protected $connectFailures = 0;
-
- /**
- * @var bool
- */
- protected $usePipeline = FALSE;
-
- /**
- * @var array
- */
- protected $commandNames;
-
- /**
- * @var string
- */
- protected $commands;
-
- /**
- * @var bool
- */
- protected $isMulti = FALSE;
-
- /**
- * @var bool
- */
- protected $isWatching = FALSE;
-
- /**
- * @var string
- */
- protected $authPassword;
-
- /**
- * @var int
- */
- protected $selectedDb = 0;
-
- /**
- * Aliases for backwards compatibility with phpredis
- * @var array
- */
- protected $wrapperMethods = array('delete' => 'del', 'getkeys' => 'keys', 'sremove' => 'srem');
-
- /**
- * @var array
- */
- protected $renamedCommands;
-
- /**
- * @var int
- */
- protected $requests = 0;
-
- /**
- * Creates a Redisent connection to the Redis server on host {@link $host} and port {@link $port}.
- * $host may also be a path to a unix socket or a string in the form of tcp://[hostname]:[port] or unix://[path]
- *
- * @param string $host The hostname of the Redis server
- * @param integer $port The port number of the Redis server
- * @param float $timeout Timeout period in seconds
- * @param string $persistent Flag to establish persistent connection
- * @param int $db The selected datbase of the Redis server
- * @param string $password The authentication password of the Redis server
- */
- public function __construct($host = '127.0.0.1', $port = 6379, $timeout = null, $persistent = '', $db = 0, $password = null)
- {
- $this->host = (string) $host;
- $this->port = (int) $port;
- $this->timeout = $timeout;
- $this->persistent = (string) $persistent;
- $this->standalone = ! extension_loaded('redis');
- $this->authPassword = $password;
- $this->selectedDb = (int)$db;
- $this->convertHost();
- }
-
- public function __destruct()
- {
- if ($this->closeOnDestruct) {
- $this->close();
- }
- }
- /**
- * Return the host of the Redis instance
- * @return string
- */
- public function getHost()
- {
- return $this->host;
- }
- /**
- * Return the port of the Redis instance
- * @return int
- */
- public function getPort()
- {
- return $this->port;
- }
-
- /**
- * Return the selected database
- * @return int
- */
- public function getSelectedDb()
- {
- return $this->selectedDb;
- }
- /**
- * @return string
- */
- public function getPersistence()
- {
- return $this->persistent;
- }
- /**
- * @throws CredisException
- * @return Credis_Client
- */
- public function forceStandalone()
- {
- if($this->connected) {
- throw new CredisException('Cannot force Credis_Client to use standalone PHP driver after a connection has already been established.');
- }
- $this->standalone = TRUE;
- return $this;
- }
-
- /**
- * @param int $retries
- * @return Credis_Client
- */
- public function setMaxConnectRetries($retries)
- {
- $this->maxConnectRetries = $retries;
- return $this;
- }
-
- /**
- * @param bool $flag
- * @return Credis_Client
- */
- public function setCloseOnDestruct($flag)
- {
- $this->closeOnDestruct = $flag;
- return $this;
- }
- protected function convertHost()
- {
- if (preg_match('#^(tcp|unix)://(.*)$#', $this->host, $matches)) {
- if($matches[1] == 'tcp') {
- if ( ! preg_match('#^([^:]+)(:([0-9]+))?(/(.+))?$#', $matches[2], $matches)) {
- throw new CredisException('Invalid host format; expected tcp://host[:port][/persistence_identifier]');
- }
- $this->host = $matches[1];
- $this->port = (int) (isset($matches[3]) ? $matches[3] : 6379);
- $this->persistent = isset($matches[5]) ? $matches[5] : '';
- } else {
- $this->host = $matches[2];
- $this->port = NULL;
- if (substr($this->host,0,1) != '/') {
- throw new CredisException('Invalid unix socket format; expected unix:///path/to/redis.sock');
- }
- }
- }
- if ($this->port !== NULL && substr($this->host,0,1) == '/') {
- $this->port = NULL;
- }
- }
- /**
- * @throws CredisException
- * @return Credis_Client
- */
- public function connect()
- {
- if ($this->connected) {
- return $this;
- }
- if ($this->standalone) {
- $flags = STREAM_CLIENT_CONNECT;
- $remote_socket = $this->port === NULL
- ? 'unix://'.$this->host
- : 'tcp://'.$this->host.':'.$this->port;
- if ($this->persistent) {
- if ($this->port === NULL) { // Unix socket
- throw new CredisException('Persistent connections to UNIX sockets are not supported in standalone mode.');
- }
- $remote_socket .= '/'.$this->persistent;
- $flags = $flags | STREAM_CLIENT_PERSISTENT;
- }
- $result = $this->redis = @stream_socket_client($remote_socket, $errno, $errstr, $this->timeout !== null ? $this->timeout : 2.5, $flags);
- }
- else {
- if ( ! $this->redis) {
- $this->redis = new Redis;
- }
- $result = $this->persistent
- ? $this->redis->pconnect($this->host, $this->port, $this->timeout, $this->persistent)
- : $this->redis->connect($this->host, $this->port, $this->timeout);
- }
-
- // Use recursion for connection retries
- if ( ! $result) {
- $this->connectFailures++;
- if ($this->connectFailures <= $this->maxConnectRetries) {
- return $this->connect();
- }
- $failures = $this->connectFailures;
- $this->connectFailures = 0;
- throw new CredisException("Connection to Redis failed after $failures failures." . (isset($errno) && isset($errstr) ? "Last Error : ({$errno}) {$errstr}" : ""));
- }
-
- $this->connectFailures = 0;
- $this->connected = TRUE;
-
- // Set read timeout
- if ($this->readTimeout) {
- $this->setReadTimeout($this->readTimeout);
- }
-
- if($this->authPassword !== null) {
- $this->auth($this->authPassword);
- }
- if($this->selectedDb !== 0) {
- $this->select($this->selectedDb);
- }
- return $this;
- }
- /**
- * @return bool
- */
- public function isConnected()
- {
- return $this->connected;
- }
- /**
- * Set the read timeout for the connection. Use 0 to disable timeouts entirely (or use a very long timeout
- * if not supported).
- *
- * @param int $timeout 0 (or -1) for no timeout, otherwise number of seconds
- * @throws CredisException
- * @return Credis_Client
- */
- public function setReadTimeout($timeout)
- {
- if ($timeout < -1) {
- throw new CredisException('Timeout values less than -1 are not accepted.');
- }
- $this->readTimeout = $timeout;
- if ($this->connected) {
- if ($this->standalone) {
- $timeout = $timeout <= 0 ? 315360000 : $timeout; // Ten-year timeout
- stream_set_blocking($this->redis, TRUE);
- stream_set_timeout($this->redis, (int) floor($timeout), ($timeout - floor($timeout)) * 1000000);
- } else if (defined('Redis::OPT_READ_TIMEOUT')) {
- // supported in phpredis 2.2.3
- // a timeout value of -1 means reads will not timeout
- $timeout = $timeout == 0 ? -1 : $timeout;
- $this->redis->setOption(Redis::OPT_READ_TIMEOUT, $timeout);
- }
- }
- return $this;
- }
-
- /**
- * @return bool
- */
- public function close()
- {
- $result = TRUE;
- if ($this->connected && ! $this->persistent) {
- try {
- $result = $this->standalone ? fclose($this->redis) : $this->redis->close();
- $this->connected = FALSE;
- } catch (Exception $e) {
- ; // Ignore exceptions on close
- }
- }
- return $result;
- }
-
- /**
- * Enabled command renaming and provide mapping method. Supported methods are:
- *
- * 1. renameCommand('foo') // Salted md5 hash for all commands -> md5('foo'.$command)
- * 2. renameCommand(function($command){ return 'my'.$command; }); // Callable
- * 3. renameCommand('get', 'foo') // Single command -> alias
- * 4. renameCommand(['get' => 'foo', 'set' => 'bar']) // Full map of [command -> alias]
- *
- * @param string|callable|array $command
- * @param string|null $alias
- * @return $this
- */
- public function renameCommand($command, $alias = NULL)
- {
- if ( ! $this->standalone) {
- $this->forceStandalone();
- }
- if ($alias === NULL) {
- $this->renamedCommands = $command;
- } else {
- if ( ! $this->renamedCommands) {
- $this->renamedCommands = array();
- }
- $this->renamedCommands[$command] = $alias;
- }
- return $this;
- }
-
- /**
- * @param $command
- */
- public function getRenamedCommand($command)
- {
- static $map;
-
- // Command renaming not enabled
- if ($this->renamedCommands === NULL) {
- return $command;
- }
-
- // Initialize command map
- if ($map === NULL) {
- if (is_array($this->renamedCommands)) {
- $map = $this->renamedCommands;
- } else {
- $map = array();
- }
- }
-
- // Generate and return cached result
- if ( ! isset($map[$command])) {
- // String means all commands are hashed with salted md5
- if (is_string($this->renamedCommands)) {
- $map[$command] = md5($this->renamedCommands.$command);
- }
- // Would already be set in $map if it was intended to be renamed
- else if (is_array($this->renamedCommands)) {
- return $command;
- }
- // User-supplied function
- else if (is_callable($this->renamedCommands)) {
- $map[$command] = call_user_func($this->renamedCommands, $command);
- }
- }
- return $map[$command];
- }
-
- /**
- * @param string $password
- * @return bool
- */
- public function auth($password)
- {
- $response = $this->__call('auth', array($password));
- $this->authPassword = $password;
- return $response;
- }
-
- /**
- * @param int $index
- * @return bool
- */
- public function select($index)
- {
- $response = $this->__call('select', array($index));
- $this->selectedDb = (int) $index;
- return $response;
- }
-
- /**
- * @param string|array $patterns
- * @param $callback
- * @return $this|array|bool|Credis_Client|mixed|null|string
- * @throws CredisException
- */
- public function pSubscribe($patterns, $callback)
- {
- if ( ! $this->standalone) {
- return $this->__call('pSubscribe', array((array)$patterns, $callback));
- }
-
- // Standalone mode: use infinite loop to subscribe until timeout
- $patternCount = is_array($patterns) ? count($patterns) : 1;
- while ($patternCount--) {
- if (isset($status)) {
- list($command, $pattern, $status) = $this->read_reply();
- } else {
- list($command, $pattern, $status) = $this->__call('psubscribe', array($patterns));
- }
- if ( ! $status) {
- throw new CredisException('Invalid pSubscribe response.');
- }
- }
- try {
- while (1) {
- list($type, $pattern, $channel, $message) = $this->read_reply();
- if ($type != 'pmessage') {
- throw new CredisException('Received non-pmessage reply.');
- }
- $callback($this, $pattern, $channel, $message);
- }
- } catch (CredisException $e) {
- if ($e->getCode() == CredisException::CODE_TIMED_OUT) {
- try {
- list($command, $pattern, $status) = $this->pUnsubscribe($patterns);
- while ($status !== 0) {
- list($command, $pattern, $status) = $this->read_reply();
- }
- } catch (CredisException $e2) {
- throw $e2;
- }
- }
- throw $e;
- }
- }
-
- /**
- * @param string|array $channels
- * @param $callback
- * @throws CredisException
- * @return $this|array|bool|Credis_Client|mixed|null|string
- */
- public function subscribe($channels, $callback)
- {
- if ( ! $this->standalone) {
- return $this->__call('subscribe', array((array)$channels, $callback));
- }
-
- // Standalone mode: use infinite loop to subscribe until timeout
- $channelCount = is_array($channels) ? count($channels) : 1;
- while ($channelCount--) {
- if (isset($status)) {
- list($command, $channel, $status) = $this->read_reply();
- } else {
- list($command, $channel, $status) = $this->__call('subscribe', array($channels));
- }
- if ( ! $status) {
- throw new CredisException('Invalid subscribe response.');
- }
- }
- try {
- while (1) {
- list($type, $channel, $message) = $this->read_reply();
- if ($type != 'message') {
- throw new CredisException('Received non-message reply.');
- }
- $callback($this, $channel, $message);
- }
- } catch (CredisException $e) {
- if ($e->getCode() == CredisException::CODE_TIMED_OUT) {
- try {
- list($command, $channel, $status) = $this->unsubscribe($channels);
- while ($status !== 0) {
- list($command, $channel, $status) = $this->read_reply();
- }
- } catch (CredisException $e2) {
- throw $e2;
- }
- }
- throw $e;
- }
- }
-
- public function __call($name, $args)
- {
- // Lazy connection
- $this->connect();
-
- $name = strtolower($name);
-
- // Send request via native PHP
- if($this->standalone)
- {
- switch ($name) {
- case 'eval':
- case 'evalsha':
- $script = array_shift($args);
- $keys = (array) array_shift($args);
- $eArgs = (array) array_shift($args);
- $args = array($script, count($keys), $keys, $eArgs);
- break;
- }
- // Flatten arguments
- $argsFlat = NULL;
- foreach($args as $index => $arg) {
- if(is_array($arg)) {
- if($argsFlat === NULL) {
- $argsFlat = array_slice($args, 0, $index);
- }
- if($name == 'mset' || $name == 'msetnx' || $name == 'hmset') {
- foreach($arg as $key => $value) {
- $argsFlat[] = $key;
- $argsFlat[] = $value;
- }
- } else {
- $argsFlat = array_merge($argsFlat, $arg);
- }
- } else if($argsFlat !== NULL) {
- $argsFlat[] = $arg;
- }
- }
- if($argsFlat !== NULL) {
- $args = $argsFlat;
- $argsFlat = NULL;
- }
-
- // In pipeline mode
- if($this->usePipeline)
- {
- if($name == 'pipeline') {
- throw new CredisException('A pipeline is already in use and only one pipeline is supported.');
- }
- else if($name == 'exec') {
- if($this->isMulti) {
- $this->commandNames[] = $name;
- $this->commands .= self::_prepare_command(array($this->getRenamedCommand($name)));
- }
-
- // Write request
- if($this->commands) {
- $this->write_command($this->commands);
- }
- $this->commands = NULL;
-
- // Read response
- $response = array();
- foreach($this->commandNames as $command) {
- $response[] = $this->read_reply($command);
- }
- $this->commandNames = NULL;
-
- if($this->isMulti) {
- $response = array_pop($response);
- }
- $this->usePipeline = $this->isMulti = FALSE;
- return $response;
- }
- else {
- if($name == 'multi') {
- $this->isMulti = TRUE;
- }
- array_unshift($args, $this->getRenamedCommand($name));
- $this->commandNames[] = $name;
- $this->commands .= self::_prepare_command($args);
- return $this;
- }
- }
-
- // Start pipeline mode
- if($name == 'pipeline')
- {
- $this->usePipeline = TRUE;
- $this->commandNames = array();
- $this->commands = '';
- return $this;
- }
-
- // If unwatching, allow reconnect with no error thrown
- if($name == 'unwatch') {
- $this->isWatching = FALSE;
- }
-
- // Non-pipeline mode
- array_unshift($args, $this->getRenamedCommand($name));
- $command = self::_prepare_command($args);
- $this->write_command($command);
- $response = $this->read_reply($name);
-
- // Watch mode disables reconnect so error is thrown
- if($name == 'watch') {
- $this->isWatching = TRUE;
- }
- // Transaction mode
- else if($this->isMulti && ($name == 'exec' || $name == 'discard')) {
- $this->isMulti = FALSE;
- }
- // Started transaction
- else if($this->isMulti || $name == 'multi') {
- $this->isMulti = TRUE;
- $response = $this;
- }
- }
-
- // Send request via phpredis client
- else
- {
- // Tweak arguments
- switch($name) {
- case 'get': // optimize common cases
- case 'set':
- case 'hget':
- case 'hset':
- case 'setex':
- case 'mset':
- case 'msetnx':
- case 'hmset':
- case 'hmget':
- case 'del':
- break;
- case 'mget':
- if(isset($args[0]) && ! is_array($args[0])) {
- $args = array($args);
- }
- break;
- case 'lrem':
- $args = array($args[0], $args[2], $args[1]);
- break;
- case 'eval':
- case 'evalsha':
- if (isset($args[1]) && is_array($args[1])) {
- $cKeys = $args[1];
- } elseif (isset($args[1]) && is_string($args[1])) {
- $cKeys = array($args[1]);
- } else {
- $cKeys = array();
- }
- if (isset($args[2]) && is_array($args[2])) {
- $cArgs = $args[2];
- } elseif (isset($args[2]) && is_string($args[2])) {
- $cArgs = array($args[2]);
- } else {
- $cArgs = array();
- }
- $args = array($args[0], array_merge($cKeys, $cArgs), count($cKeys));
- break;
- case 'subscribe':
- case 'psubscribe':
- break;
- default:
- // Flatten arguments
- $argsFlat = NULL;
- foreach($args as $index => $arg) {
- if(is_array($arg)) {
- if($argsFlat === NULL) {
- $argsFlat = array_slice($args, 0, $index);
- }
- $argsFlat = array_merge($argsFlat, $arg);
- } else if($argsFlat !== NULL) {
- $argsFlat[] = $arg;
- }
- }
- if($argsFlat !== NULL) {
- $args = $argsFlat;
- $argsFlat = NULL;
- }
- }
-
- try {
- // Proxy pipeline mode to the phpredis library
- if($name == 'pipeline' || $name == 'multi') {
- if($this->isMulti) {
- return $this;
- } else {
- $this->isMulti = TRUE;
- $this->redisMulti = call_user_func_array(array($this->redis, $name), $args);
- }
- }
- else if($name == 'exec' || $name == 'discard') {
- $this->isMulti = FALSE;
- $response = $this->redisMulti->$name();
- $this->redisMulti = NULL;
- #echo "> $name : ".substr(print_r($response, TRUE),0,100)."\n";
- return $response;
- }
-
- // Use aliases to be compatible with phpredis wrapper
- if(isset($this->wrapperMethods[$name])) {
- $name = $this->wrapperMethods[$name];
- }
-
- // Multi and pipeline return self for chaining
- if($this->isMulti) {
- call_user_func_array(array($this->redisMulti, $name), $args);
- return $this;
- }
-
- // Send request, retry one time when using persistent connections on the first request only
- $this->requests++;
- try {
- $response = call_user_func_array(array($this->redis, $name), $args);
- } catch (RedisException $e) {
- if ($this->persistent && $this->requests == 1 && $e->getMessage() == 'read error on connection') {
- $this->connected = FALSE;
- $this->connect();
- $response = call_user_func_array(array($this->redis, $name), $args);
- } else {
- throw $e;
- }
- }
- }
- // Wrap exceptions
- catch(RedisException $e) {
- $code = 0;
- if ( ! ($result = $this->redis->IsConnected())) {
- $this->connected = FALSE;
- $code = CredisException::CODE_DISCONNECTED;
- }
- throw new CredisException($e->getMessage(), $code, $e);
- }
-
- #echo "> $name : ".substr(print_r($response, TRUE),0,100)."\n";
-
- // change return values where it is too difficult to minim in standalone mode
- switch($name)
- {
- case 'hmget':
- $response = array_values($response);
- break;
-
- case 'type':
- $typeMap = array(
- self::TYPE_NONE,
- self::TYPE_STRING,
- self::TYPE_SET,
- self::TYPE_LIST,
- self::TYPE_ZSET,
- self::TYPE_HASH,
- );
- $response = $typeMap[$response];
- break;
-
- // Handle scripting errors
- case 'eval':
- case 'evalsha':
- case 'script':
- $error = $this->redis->getLastError();
- $this->redis->clearLastError();
- if ($error && substr($error,0,8) == 'NOSCRIPT') {
- $response = NULL;
- } else if ($error) {
- throw new CredisException($error);
- }
- break;
- default:
- $error = $this->redis->getLastError();
- $this->redis->clearLastError();
- if ($error) {
- throw new CredisException($error);
- }
- break;
- }
- }
-
- return $response;
- }
-
- protected function write_command($command)
- {
- // Reconnect on lost connection (Redis server "timeout" exceeded since last command)
- if(feof($this->redis)) {
- $this->close();
- // If a watch or transaction was in progress and connection was lost, throw error rather than reconnect
- // since transaction/watch state will be lost.
- if(($this->isMulti && ! $this->usePipeline) || $this->isWatching) {
- $this->isMulti = $this->isWatching = FALSE;
- throw new CredisException('Lost connection to Redis server during watch or transaction.');
- }
- $this->connected = FALSE;
- $this->connect();
- if($this->authPassword) {
- $this->auth($this->authPassword);
- }
- if($this->selectedDb != 0) {
- $this->select($this->selectedDb);
- }
- }
-
- $commandLen = strlen($command);
- for ($written = 0; $written < $commandLen; $written += $fwrite) {
- $fwrite = fwrite($this->redis, substr($command, $written));
- if ($fwrite === FALSE || $fwrite == 0 ) {
- $this->connected = FALSE;
- throw new CredisException('Failed to write entire command to stream');
- }
- }
- }
-
- protected function read_reply($name = '')
- {
- $reply = fgets($this->redis);
- if($reply === FALSE) {
- $info = stream_get_meta_data($this->redis);
- if ($info['timed_out']) {
- throw new CredisException('Read operation timed out.', CredisException::CODE_TIMED_OUT);
- } else {
- $this->connected = FALSE;
- throw new CredisException('Lost connection to Redis server.', CredisException::CODE_DISCONNECTED);
- }
- }
- $reply = rtrim($reply, CRLF);
- #echo "> $name: $reply\n";
- $replyType = substr($reply, 0, 1);
- switch ($replyType) {
- /* Error reply */
- case '-':
- if($this->isMulti || $this->usePipeline) {
- $response = FALSE;
- } else if ($name == 'evalsha' && substr($reply,0,9) == '-NOSCRIPT') {
- $response = NULL;
- } else {
- throw new CredisException(substr($reply,0,4) == '-ERR' ? substr($reply, 5) : substr($reply,1));
- }
- break;
- /* Inline reply */
- case '+':
- $response = substr($reply, 1);
- if($response == 'OK' || $response == 'QUEUED') {
- return TRUE;
- }
- break;
- /* Bulk reply */
- case '$':
- if ($reply == '$-1') return FALSE;
- $size = (int) substr($reply, 1);
- $response = stream_get_contents($this->redis, $size + 2);
- if( ! $response) {
- $this->connected = FALSE;
- throw new CredisException('Error reading reply.');
- }
- $response = substr($response, 0, $size);
- break;
- /* Multi-bulk reply */
- case '*':
- $count = substr($reply, 1);
- if ($count == '-1') return FALSE;
-
- $response = array();
- for ($i = 0; $i < $count; $i++) {
- $response[] = $this->read_reply();
- }
- break;
- /* Integer reply */
- case ':':
- $response = intval(substr($reply, 1));
- break;
- default:
- throw new CredisException('Invalid response: '.print_r($reply, TRUE));
- break;
- }
-
- // Smooth over differences between phpredis and standalone response
- switch($name)
- {
- case '': // Minor optimization for multi-bulk replies
- break;
- case 'config':
- case 'hgetall':
- $keys = $values = array();
- while($response) {
- $keys[] = array_shift($response);
- $values[] = array_shift($response);
- }
- $response = count($keys) ? array_combine($keys, $values) : array();
- break;
- case 'info':
- $lines = explode(CRLF, trim($response,CRLF));
- $response = array();
- foreach($lines as $line) {
- if ( ! $line || substr($line, 0, 1) == '#') {
- continue;
- }
- list($key, $value) = explode(':', $line, 2);
- $response[$key] = $value;
- }
- break;
- case 'ttl':
- if($response === -1) {
- $response = FALSE;
- }
- break;
- }
-
- return $response;
- }
-
- /**
- * Build the Redis unified protocol command
- *
- * @param array $args
- * @return string
- */
- private static function _prepare_command($args)
- {
- return sprintf('*%d%s%s%s', count($args), CRLF, implode(array_map(array('self', '_map'), $args), CRLF), CRLF);
- }
-
- private static function _map($arg)
- {
- return sprintf('$%d%s%s', strlen($arg), CRLF, $arg);
- }
-
-}
--- Magento-CE-2.0.5/vendor/magento/magento2-base/pub/errors/processor.php 2016-04-28 06:15:26.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/magento2-base/pub/errors/processor.php 2016-05-16 20:17:58.000000000 -0300
@@ -454,11 +454,10 @@
$this->_setReportData($reportData);
if (!file_exists($this->_reportDir)) {
- @mkdir($this->_reportDir, DriverInterface::WRITEABLE_DIRECTORY_MODE, true);
+ @mkdir($this->_reportDir, 0777, true);
}
@file_put_contents($this->_reportFile, serialize($reportData));
- @chmod($this->_reportFile, DriverInterface::WRITEABLE_FILE_MODE);
if (isset($reportData['skin']) && self::DEFAULT_SKIN != $reportData['skin']) {
$this->_setSkin($reportData['skin']);
--- Magento-CE-2.0.5/vendor/magento/magento2-base/setup/src/Magento/Setup/Console/Command/AbstractModuleCommand.php 2016-04-28 06:15:28.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/magento2-base/setup/src/Magento/Setup/Console/Command/AbstractModuleCommand.php 2016-05-16 20:18:00.000000000 -0300
@@ -84,14 +84,18 @@
/** @var \Magento\Framework\App\State\CleanupFiles $cleanupFiles */
$cleanupFiles = $this->objectManager->get('Magento\Framework\App\State\CleanupFiles');
$cleanupFiles->clearCodeGeneratedClasses();
- $output->writeln('<info>Generated classes cleared successfully. Please re-run Magento compile command</info>');
+ $output->writeln(
+ "<info>Generated classes cleared successfully. Please run the 'setup:di:compile' command to "
+ . 'generate classes.</info>'
+ );
if ($input->getOption(self::INPUT_KEY_CLEAR_STATIC_CONTENT)) {
$cleanupFiles->clearMaterializedViewFiles();
$output->writeln('<info>Generated static view files cleared successfully.</info>');
} else {
$output->writeln(
- '<info>Info: Some modules might require static view files to be cleared. Use the optional --' .
- self::INPUT_KEY_CLEAR_STATIC_CONTENT . ' option to clear them.</info>'
+ "<info>Info: Some modules might require static view files to be cleared. To do this, run '"
+ . $this->getName() . "' with the --" . self::INPUT_KEY_CLEAR_STATIC_CONTENT
+ . ' option to clear them.</info>'
);
}
}
--- Magento-CE-2.0.5/vendor/magento/magento2-base/setup/src/Magento/Setup/Console/Command/AbstractModuleManageCommand.php 2016-04-28 06:15:28.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/magento2-base/setup/src/Magento/Setup/Console/Command/AbstractModuleManageCommand.php 2016-05-16 20:18:00.000000000 -0300
@@ -6,8 +6,10 @@
namespace Magento\Setup\Console\Command;
use Symfony\Component\Console\Input\InputInterface;
-use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
+use Symfony\Component\Console\Input\InputOption;
+use Magento\Framework\App\DeploymentConfig;
+use Magento\Framework\Module\Status;
abstract class AbstractModuleManageCommand extends AbstractModuleCommand
{
@@ -18,6 +20,11 @@
const INPUT_KEY_FORCE = 'force';
/**
+ * @var DeploymentConfig
+ */
+ protected $deploymentConfig;
+
+ /**
* {@inheritdoc}
*/
protected function configure()
@@ -64,12 +71,8 @@
$output->writeln(implode(PHP_EOL, $messages));
return;
}
- /**
- * @var \Magento\Framework\Module\Status $status
- */
- $status = $this->objectManager->get('Magento\Framework\Module\Status');
try {
- $modulesToChange = $status->getModulesToChange($isEnable, $modules);
+ $modulesToChange = $this->getStatus()->getModulesToChange($isEnable, $modules);
} catch (\LogicException $e) {
$output->writeln('<error>' . $e->getMessage() . '</error>');
return;
@@ -77,7 +80,7 @@
if (!empty($modulesToChange)) {
$force = $input->getOption(self::INPUT_KEY_FORCE);
if (!$force) {
- $constraints = $status->checkConstraints($isEnable, $modulesToChange);
+ $constraints = $this->getStatus()->checkConstraints($isEnable, $modulesToChange);
if ($constraints) {
$output->writeln(
"<error>Unable to change status of modules because of the following constraints:</error>"
@@ -86,30 +89,55 @@
return;
}
}
- $status->setIsEnabled($isEnable, $modulesToChange);
+ $this->setIsEnabled($isEnable, $modulesToChange, $output);
+ $this->cleanup($input, $output);
+ if ($force) {
+ $output->writeln(
+ '<error>Alert: You used the --force option.'
+ . ' As a result, modules might not function properly.</error>'
+ );
+ }
+ } else {
+ $output->writeln('<info>No modules were changed.</info>');
+ }
+ }
+
+ /**
+ * Enable/disable modules
+ *
+ * @param bool $isEnable
+ * @param string[] $modulesToChange
+ * @param OutputInterface $output
+ * @return void
+ */
+ private function setIsEnabled($isEnable, $modulesToChange, $output)
+ {
+ $this->getStatus()->setIsEnabled($isEnable, $modulesToChange);
if ($isEnable) {
$output->writeln('<info>The following modules have been enabled:</info>');
$output->writeln('<info>- ' . implode("\n- ", $modulesToChange) . '</info>');
$output->writeln('');
+ if ($this->getDeploymentConfig()->isAvailable()) {
$output->writeln(
'<info>To make sure that the enabled modules are properly registered,'
. " run 'setup:upgrade'.</info>"
);
+ }
} else {
$output->writeln('<info>The following modules have been disabled:</info>');
$output->writeln('<info>- ' . implode("\n- ", $modulesToChange) . '</info>');
$output->writeln('');
}
- $this->cleanup($input, $output);
- if ($force) {
- $output->writeln(
- '<error>Alert: You used the --force option.'
- . ' As a result, modules might not function properly.</error>'
- );
- }
- } else {
- $output->writeln('<info>No modules were changed.</info>');
}
+
+ /**
+ * Get module status
+ *
+ * @return Status
+ */
+ private function getStatus()
+ {
+ return $this->objectManager->get(Status::class);
}
/**
@@ -134,4 +162,18 @@
* @return bool
*/
abstract protected function isEnable();
+
+ /**
+ * Get deployment config
+ *
+ * @return DeploymentConfig
+ * @deprecated
+ */
+ private function getDeploymentConfig()
+ {
+ if (!($this->deploymentConfig instanceof DeploymentConfig)) {
+ return $this->objectManager->get(DeploymentConfig::class);
+ }
+ return $this->deploymentConfig;
+ }
}
--- Magento-CE-2.0.5/vendor/magento/magento2-base/setup/src/Magento/Setup/Console/Command/DiCompileCommand.php 2016-04-28 06:15:28.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/magento2-base/setup/src/Magento/Setup/Console/Command/DiCompileCommand.php 2016-05-16 20:18:00.000000000 -0300
@@ -3,15 +3,17 @@
* Copyright © 2016 Magento. All rights reserved.
* See COPYING.txt for license details.
*/
-
namespace Magento\Setup\Console\Command;
+use Magento\Framework\ObjectManagerInterface;
+use Magento\Framework\Filesystem\DriverInterface;
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Output\OutputInterface;
use Magento\Framework\Filesystem;
use Magento\Framework\App\Filesystem\DirectoryList;
-use Magento\Framework\Filesystem\DriverInterface;
-use Magento\Framework\ObjectManagerInterface;
use Magento\Framework\App\DeploymentConfig;
use Magento\Framework\Component\ComponentRegistrar;
+use Magento\Framework\Config\ConfigOptionsListConstants;
use Magento\Setup\Model\ObjectManagerProvider;
use Magento\Setup\Module\Di\App\Task\Manager;
use Magento\Setup\Module\Di\App\Task\OperationFactory;
@@ -19,8 +21,6 @@
use Magento\Setup\Module\Di\App\Task\OperationInterface;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Helper\ProgressBar;
-use Symfony\Component\Console\Input\InputInterface;
-use Symfony\Component\Console\Output\OutputInterface;
/**
* Command to run compile in single-tenant mode
@@ -107,8 +107,10 @@
private function checkEnvironment()
{
$messages = [];
- if (!$this->deploymentConfig->isAvailable()) {
- $messages[] = 'You cannot run this command because the Magento application is not installed.';
+ $config = $this->deploymentConfig->get(ConfigOptionsListConstants::KEY_MODULES);
+ if (!$config) {
+ $messages[] = 'You cannot run this command because modules are not enabled. You can enable modules by'
+ . ' running the \'module:enable --all\' command.';
}
/**
--- Magento-CE-2.0.5/vendor/magento/magento2-base/setup/src/Magento/Setup/Console/Command/DiCompileMultiTenantCommand.php 2016-04-28 06:15:28.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/magento2-base/setup/src/Magento/Setup/Console/Command/DiCompileMultiTenantCommand.php 2016-05-16 20:18:00.000000000 -0300
@@ -407,7 +407,7 @@
// 2.2 Compression
$relationsFileDir = dirname($relationsFile);
if (!file_exists($relationsFileDir)) {
- mkdir($relationsFileDir, DriverInterface::WRITEABLE_DIRECTORY_MODE, true);
+ mkdir($relationsFileDir, 0777, true);
}
$relations = array_filter($relations);
file_put_contents($relationsFile, $serializer->serialize($relations));
@@ -425,7 +425,7 @@
$outputContent = $serializer->serialize($pluginDefinitions);
$pluginDefFileDir = dirname($pluginDefFile);
if (!file_exists($pluginDefFileDir)) {
- mkdir($pluginDefFileDir, DriverInterface::WRITEABLE_DIRECTORY_MODE, true);
+ mkdir($pluginDefFileDir, 0777, true);
}
file_put_contents($pluginDefFile, $outputContent);
}
--- Magento-CE-2.0.5/vendor/magento/magento2-base/setup/src/Magento/Setup/Controller/ComponentGrid.php 2016-04-28 06:15:28.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/magento2-base/setup/src/Magento/Setup/Controller/ComponentGrid.php 2016-05-16 20:18:00.000000000 -0300
@@ -6,6 +6,8 @@
namespace Magento\Setup\Controller;
+use Magento\Setup\Model\DateTime\TimezoneProvider;
+
/**
* Controller for component grid tasks
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
@@ -52,10 +54,15 @@
private $timezone;
/**
+ * @var \Magento\Framework\ObjectManagerInterface
+ */
+ private $objectManager;
+
+ /**
* @param \Magento\Framework\Composer\ComposerInformation $composerInformation
* @param \Magento\Setup\Model\ObjectManagerProvider $objectManagerProvider
- * @param \Magento\Setup\Model\MarketplaceManager $marketplaceManager
* @param \Magento\Setup\Model\UpdatePackagesCache $updatePackagesCache
+ * @param \Magento\Setup\Model\MarketplaceManager $marketplaceManager
*/
public function __construct(
\Magento\Framework\Composer\ComposerInformation $composerInformation,
@@ -64,13 +71,40 @@
\Magento\Setup\Model\MarketplaceManager $marketplaceManager
) {
$this->composerInformation = $composerInformation;
- $objectManager = $objectManagerProvider->get();
- $this->enabledModuleList = $objectManager->get('Magento\Framework\Module\ModuleList');
- $this->fullModuleList = $objectManager->get('Magento\Framework\Module\FullModuleList');
- $this->packageInfo = $objectManager->get('Magento\Framework\Module\PackageInfoFactory')->create();
+ $this->objectManager = $objectManagerProvider->get();
+ $this->enabledModuleList = $this->objectManager->get('Magento\Framework\Module\ModuleList');
+ $this->fullModuleList = $this->objectManager->get('Magento\Framework\Module\FullModuleList');
+ $this->packageInfo = $this->objectManager->get('Magento\Framework\Module\PackageInfoFactory')->create();
$this->marketplaceManager = $marketplaceManager;
$this->updatePackagesCache = $updatePackagesCache;
- $this->timezone = $objectManager->get('Magento\Framework\Stdlib\DateTime\TimezoneInterface');
+ }
+
+ /**
+ * Get timezone
+ *
+ * @return \Magento\Framework\Stdlib\DateTime\TimezoneInterface|null
+ */
+ private function getTimezone()
+ {
+ if ($this->timezone === null) {
+ $this->timezone = $this->objectManager->get('Magento\Setup\Model\DateTime\TimezoneProvider')->get();
+ }
+ return $this->timezone;
+ }
+
+ /**
+ * Set timezone
+ *
+ * @param \Magento\Framework\Stdlib\DateTime\TimezoneInterface $timezone
+ * @return void
+ * @throws \Exception
+ */
+ public function setTimezone(\Magento\Framework\Stdlib\DateTime\TimezoneInterface $timezone)
+ {
+ if ($this->timezone !== null) {
+ throw new \Exception('timezone is already set');
+ }
+ $this->timezone = $timezone;
}
/**
@@ -214,12 +248,12 @@
private function formatSyncDate($syncDate)
{
return [
- 'date' => $this->timezone->formatDateTime(
+ 'date' => $this->getTimezone()->formatDateTime(
new \DateTime('@'.$syncDate),
\IntlDateFormatter::MEDIUM,
\IntlDateFormatter::NONE
),
- 'time' => $this->timezone->formatDateTime(
+ 'time' => $this->getTimezone()->formatDateTime(
new \DateTime('@'.$syncDate),
\IntlDateFormatter::NONE,
\IntlDateFormatter::MEDIUM
--- Magento-CE-2.0.5/vendor/magento/magento2-base/setup/src/Magento/Setup/Controller/Install.php 2016-04-28 06:15:28.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/magento2-base/setup/src/Magento/Setup/Controller/Install.php 2016-05-16 20:18:00.000000000 -0300
@@ -49,6 +49,11 @@
protected $sampleDataState;
/**
+ * @var \Magento\Framework\App\DeploymentConfig
+ */
+ private $deploymentConfig;
+
+ /**
* Default Constructor
*
* @param WebLogger $logger
@@ -89,6 +94,7 @@
$this->log->clear();
$json = new JsonModel;
try {
+ $this->checkForPriorInstall();
$data = array_merge(
$this->importDeploymentConfigForm(),
$this->importUserConfigForm(),
@@ -106,6 +112,7 @@
$json->setVariable('messages', $this->installer->getInstallInfo()[Installer::INFO_MESSAGE]);
} catch (\Exception $e) {
$this->log->logError($e);
+ $json->setVariable('messages', $e->getMessage());
$json->setVariable('success', false);
}
return $json;
@@ -146,6 +153,19 @@
}
/**
+ * Checks for prior install
+ *
+ * @return void
+ * @throws \Magento\Setup\Exception
+ */
+ private function checkForPriorInstall()
+ {
+ if ($this->getDeploymentConfig()->isAvailable()) {
+ throw new \Magento\Setup\Exception('Magento application is already installed.');
+ }
+ }
+
+ /**
* Maps data from request to format of deployment config model
*
* @return array
@@ -242,4 +262,20 @@
$result[AdminAccount::KEY_LAST_NAME] = $result[AdminAccount::KEY_USER];
return $result;
}
+
+ /**
+ * Get Deployment Config
+ *
+ * @return \Magento\Framework\App\DeploymentConfig
+ *
+ * @deprecated
+ */
+ private function getDeploymentConfig()
+ {
+ if ($this->deploymentConfig === null) {
+ $this->deploymentConfig = $this->installer->getObjectManagerProvider()->get()
+ ->get(\Magento\Framework\App\DeploymentConfig::class);
+ }
+ return $this->deploymentConfig;
+ }
}
--- Magento-CE-2.0.5/vendor/magento/magento2-base/setup/src/Magento/Setup/Model/ConfigGenerator.php 2016-04-28 06:15:28.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/magento2-base/setup/src/Magento/Setup/Model/ConfigGenerator.php 2016-05-16 20:18:00.000000000 -0300
@@ -64,6 +64,8 @@
/**
* Creates install segment config data
*
+ * @deprecated
+ *
* @return ConfigData
*/
public function createInstallConfig()
--- Magento-CE-2.0.5/vendor/magento/magento2-base/setup/src/Magento/Setup/Model/ConfigOptionsList.php 2016-04-28 06:15:28.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/magento2-base/setup/src/Magento/Setup/Model/ConfigOptionsList.php 2016-05-16 20:18:00.000000000 -0300
@@ -163,7 +163,6 @@
public function createConfig(array $data, DeploymentConfig $deploymentConfig)
{
$configData = [];
- $configData[] = $this->configGenerator->createInstallConfig($deploymentConfig);
$configData[] = $this->configGenerator->createCryptConfig($data, $deploymentConfig);
$configData[] = $this->configGenerator->createSessionConfig($data);
$definitionConfig = $this->configGenerator->createDefinitionsConfig($data);
--- Magento-CE-2.0.5/vendor/magento/magento2-base/setup/src/Magento/Setup/Model/DateTime/DateTimeProvider.php 1969-12-31 21:00:00.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/magento2-base/setup/src/Magento/Setup/Model/DateTime/DateTimeProvider.php 2016-05-16 20:18:00.000000000 -0300
@@ -0,0 +1,63 @@
+<?php
+/**
+ * Copyright © 2016 Magento. All rights reserved.
+ * See COPYING.txt for license details.
+ */
+namespace Magento\Setup\Model\DateTime;
+
+use Magento\Setup\Model\ObjectManagerProvider;
+
+/**
+ * Provider of DateTime instance
+ */
+class DateTimeProvider
+{
+ /**
+ * Timezone provider
+ *
+ * @var TimezoneProvider
+ */
+ private $tzProvider;
+
+ /**
+ * Object Manager provider
+ *
+ * @var ObjectManagerProvider
+ */
+ private $objectManagerProvider;
+
+ /**
+ * DateTime instance
+ *
+ * @var \Magento\Framework\Stdlib\DateTime\DateTime
+ */
+ private $dateTime;
+
+ /**
+ * Init
+ *
+ * @param TimezoneProvider $tzProvider
+ * @param ObjectManagerProvider $objectManagerProvider
+ */
+ public function __construct(TimezoneProvider $tzProvider, ObjectManagerProvider $objectManagerProvider)
+ {
+ $this->tzProvider = $tzProvider;
+ $this->objectManagerProvider = $objectManagerProvider;
+ }
+
+ /**
+ * Get instance of DateTime
+ *
+ * @return \Magento\Framework\Stdlib\DateTime\DateTime
+ */
+ public function get()
+ {
+ if (!$this->dateTime) {
+ $this->dateTime = $this->objectManagerProvider->get()->create(
+ 'Magento\Framework\Stdlib\DateTime\DateTime',
+ ['localeDate' => $this->tzProvider->get()]
+ );
+ }
+ return $this->dateTime;
+ }
+}
--- Magento-CE-2.0.5/vendor/magento/magento2-base/setup/src/Magento/Setup/Model/DateTime/TimezoneProvider.php 1969-12-31 21:00:00.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/magento2-base/setup/src/Magento/Setup/Model/DateTime/TimezoneProvider.php 2016-05-16 20:18:00.000000000 -0300
@@ -0,0 +1,55 @@
+<?php
+/**
+ * Copyright © 2016 Magento. All rights reserved.
+ * See COPYING.txt for license details.
+ */
+namespace Magento\Setup\Model\DateTime;
+
+use Magento\Framework\App\Config\ScopeConfigInterface;
+use Magento\Setup\Model\ObjectManagerProvider;
+
+/**
+ * Provider of Timezone instance
+ */
+class TimezoneProvider
+{
+ /**
+ * Object Manager provider
+ *
+ * @var ObjectManagerProvider
+ */
+ private $objectManagerProvider;
+
+ /**
+ * Instance of Timezone
+ *
+ * @var \Magento\Framework\Stdlib\DateTime\Timezone
+ */
+ private $timezone;
+
+ /**
+ * Init
+ *
+ * @param ObjectManagerProvider $objectManagerProvider
+ */
+ public function __construct(ObjectManagerProvider $objectManagerProvider)
+ {
+ $this->objectManagerProvider = $objectManagerProvider;
+ }
+
+ /**
+ * Get instance of Timezone
+ *
+ * @return \Magento\Framework\Stdlib\DateTime\Timezone
+ */
+ public function get()
+ {
+ if (!$this->timezone) {
+ $this->timezone = $this->objectManagerProvider->get()->create(
+ 'Magento\Framework\Stdlib\DateTime\Timezone',
+ ['scopeType' => ScopeConfigInterface::SCOPE_TYPE_DEFAULT]
+ );
+ }
+ return $this->timezone;
+ }
+}
--- Magento-CE-2.0.5/vendor/magento/magento2-base/setup/src/Magento/Setup/Model/Installer.php 2016-04-28 06:15:28.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/magento2-base/setup/src/Magento/Setup/Model/Installer.php 2016-05-16 20:18:00.000000000 -0300
@@ -13,6 +13,7 @@
use Magento\Framework\App\ResourceConnection\Config;
use Magento\Framework\Component\ComponentRegistrar;
use Magento\Framework\Config\ConfigOptionsListConstants;
+use Magento\Framework\Config\Data\ConfigData;
use Magento\Framework\Filesystem;
use Magento\Framework\Exception\FileSystemException;
use Magento\Framework\Model\ResourceModel\Db\Context;
@@ -319,6 +320,7 @@
$script[] = ['Caches clearing:', 'cleanCaches', []];
$script[] = ['Disabling Maintenance Mode:', 'setMaintenanceMode', [0]];
$script[] = ['Post installation file permissions check...', 'checkApplicationFilePermissions', []];
+ $script[] = ['Write installation date...', 'writeInstallationDate', []];
$estimatedModules = $this->createModulesConfig($request);
$total = count($script) + 3 * count(array_filter($estimatedModules));
@@ -347,6 +349,20 @@
}
/**
+ * Writes installation date to the configuration
+ *
+ * @return void
+ * @SuppressWarnings(PHPMD.UnusedPrivateMethod) Called by install() via callback.
+ */
+ private function writeInstallationDate()
+ {
+ $dateData = new ConfigData(ConfigFilePool::APP_ENV);
+ $dateData->set(ConfigOptionsListConstants::CONFIG_PATH_INSTALL_DATE, date('r'));
+ $configData = [$dateData->getFileKey() => $dateData->getData()];
+ $this->deploymentConfigWriter->saveConfig($configData);
+ }
+
+ /**
* Creates modules deployment configuration segment
*
* @param \ArrayObject|array $request
@@ -356,11 +372,9 @@
private function createModulesConfig($request)
{
$all = array_keys($this->moduleLoader->load());
- $currentModules = [];
- if ($this->deploymentConfig->isAvailable()) {
$deploymentConfig = $this->deploymentConfigReader->load();
- $currentModules = isset($deploymentConfig['modules']) ? $deploymentConfig['modules'] : [] ;
- }
+ $currentModules = isset($deploymentConfig[ConfigOptionsListConstants::KEY_MODULES])
+ ? $deploymentConfig[ConfigOptionsListConstants::KEY_MODULES] : [] ;
$enable = $this->readListOfModules($all, $request, self::ENABLE_MODULES);
$disable = $this->readListOfModules($all, $request, self::DISABLE_MODULES);
$result = [];
@@ -466,17 +480,25 @@
$this->checkInstallationFilePermissions();
$userData = is_array($data) ? $data : $data->getArrayCopy();
$this->setupConfigModel->process($userData);
- if ($this->deploymentConfig->isAvailable()) {
$deploymentConfigData = $this->deploymentConfig->get(ConfigOptionsListConstants::CONFIG_PATH_CRYPT_KEY);
if (isset($deploymentConfigData)) {
$this->installInfo[ConfigOptionsListConstants::KEY_ENCRYPTION_KEY] = $deploymentConfigData;
}
- }
// reset object manager now that there is a deployment config
$this->objectManagerProvider->reset();
}
/**
+ * Get Object Manager Provider
+ *
+ * @return ObjectManagerProvider
+ */
+ public function getObjectManagerProvider()
+ {
+ return $this->objectManagerProvider;
+ }
+
+ /**
* Set up setup_module table to register modules' versions, skip this process if it already exists
*
* @param SchemaSetupInterface $setup
@@ -725,6 +747,8 @@
*/
public function installSchema()
{
+ $this->assertDbConfigExists();
+ $this->assertDbAccessible();
$setup = $this->setupFactory->create($this->context->getResources());
$this->setupModuleRegistry($setup);
$this->setupCoreTables($setup);
@@ -740,6 +764,8 @@
*/
public function installDataFixtures()
{
+ $this->assertDbConfigExists();
+ $this->assertDbAccessible();
$setup = $this->dataSetupFactory->create();
$this->checkInstallationFilePermissions();
$this->log->log('Data install/update:');
@@ -763,9 +789,6 @@
throw new \Magento\Setup\Exception("Unsupported operation type $type is requested");
}
- $this->assertDeploymentConfigExists();
- $this->assertDbAccessible();
-
$resource = new \Magento\Framework\Module\ModuleResource($this->context);
$verType = $type . '-version';
$installType = $type . '-install';
@@ -826,6 +849,20 @@
}
/**
+ * @return void
+ * @throws \Magento\Setup\Exception
+ */
+ private function assertDbConfigExists()
+ {
+ $config = $this->deploymentConfig->get(ConfigOptionsListConstants::CONFIG_PATH_DB_CONNECTION_DEFAULT);
+ if (!$config) {
+ throw new \Magento\Setup\Exception(
+ "Can't run this operation: configuration for DB connection is absent."
+ );
+ }
+ }
+
+ /**
* Installs user configuration
*
* @param \ArrayObject|array $data
@@ -922,7 +959,7 @@
*/
public function installAdminUser($data)
{
- $this->assertDeploymentConfigExists();
+ $this->assertDbConfigExists();
$setup = $this->setupFactory->create($this->context->getResources());
$adminAccount = $this->adminAccountFactory->create($setup, (array)$data);
$adminAccount->save();
@@ -936,10 +973,15 @@
*/
public function updateModulesSequence($keepGeneratedCode = false)
{
- $this->assertDeploymentConfigExists();
+ $config = $this->deploymentConfig->get(ConfigOptionsListConstants::KEY_MODULES);
+ if (!$config) {
+ throw new \Magento\Setup\Exception(
+ "Can't run this operation: deployment configuration is absent."
+ . " Run 'magento setup:config:set --help' for options."
+ );
+ }
$this->cleanCaches();
-
if (!$keepGeneratedCode) {
$this->cleanupGeneratedCode();
}
@@ -1035,8 +1077,6 @@
*/
public function cleanupDb()
{
- // stops cleanup if configuration does not exist
- if ($this->deploymentConfig->isAvailable()) {
$config = $this->deploymentConfig->get(ConfigOptionsListConstants::CONFIG_PATH_DB_CONNECTION_DEFAULT);
if ($config) {
try {
@@ -1052,11 +1092,10 @@
$this->log->log("Cleaning up database {$dbName}");
$connection->query("DROP DATABASE IF EXISTS {$dbName}");
$connection->query("CREATE DATABASE IF NOT EXISTS {$dbName}");
- return;
- }
- }
+ } else {
$this->log->log('No database connection defined - skipping database cleanup');
}
+ }
/**
* Removes deployment configuration
@@ -1085,8 +1124,12 @@
/**
* Validates that deployment configuration exists
*
+ * @deprecated
+ *
* @throws \Magento\Setup\Exception
* @return void
+ *
+ * @SuppressWarnings(PHPMD.UnusedPrivateMethod)
*/
private function assertDeploymentConfigExists()
{
--- Magento-CE-2.0.5/vendor/magento/magento2-base/setup/src/Magento/Setup/Model/MarketplaceManager.php 2016-04-28 06:15:28.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/magento2-base/setup/src/Magento/Setup/Model/MarketplaceManager.php 2016-05-16 20:18:00.000000000 -0300
@@ -313,9 +313,6 @@
return $this->getDirectory()->writeFile(
DirectoryList::COMPOSER_HOME . DIRECTORY_SEPARATOR . $this->pathToAuthFile,
$jsonContent
- ) && $this->getDirectory()->changePermissions(
- DirectoryList::COMPOSER_HOME . DIRECTORY_SEPARATOR . $this->pathToAuthFile,
- \Magento\Framework\Filesystem\DriverInterface::WRITEABLE_FILE_MODE
);
}
--- Magento-CE-2.0.5/vendor/magento/magento2-base/setup/src/Magento/Setup/Model/ObjectManagerProvider.php 2016-04-28 06:15:28.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/magento2-base/setup/src/Magento/Setup/Model/ObjectManagerProvider.php 2016-05-16 20:18:00.000000000 -0300
@@ -51,15 +51,6 @@
$initParams = $this->serviceLocator->get(InitParamListener::BOOTSTRAP_PARAM);
$factory = Bootstrap::createObjectManagerFactory(BP, $initParams);
$this->objectManager = $factory->create($initParams);
- $this->objectManager->configure(
- [
- 'Magento\Framework\Stdlib\DateTime\Timezone' => [
- 'arguments' => [
- 'scopeType' => \Magento\Framework\App\Config\ScopeConfigInterface::SCOPE_TYPE_DEFAULT
- ]
- ]
- ]
- );
}
return $this->objectManager;
}
--- Magento-CE-2.0.5/vendor/magento/magento2-base/setup/src/Magento/Setup/Model/UpdatePackagesCache.php 2016-04-28 06:15:28.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/magento2-base/setup/src/Magento/Setup/Model/UpdatePackagesCache.php 2016-05-16 20:18:00.000000000 -0300
@@ -11,9 +11,12 @@
use Magento\Framework\App\Filesystem\DirectoryList;
use Magento\Framework\Filesystem;
use Magento\Framework\Composer\MagentoComposerApplicationFactory;
+use Magento\Framework\ObjectManagerInterface;
/**
* Class UpdatePackagesCache manages information about available for update packages though the cache file.
+ *
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*/
class UpdatePackagesCache
{
@@ -52,6 +55,11 @@
private $pathToCacheFile = 'update_composer_packages.json';
/**
+ * @var ObjectManagerInterface
+ */
+ private $objectManager;
+
+ /**
* Constructor
*
* @param MagentoComposerApplicationFactory $applicationFactory
@@ -68,11 +76,39 @@
) {
$this->application = $applicationFactory->create();
$this->directory = $filesystem->getDirectoryWrite(DirectoryList::VAR_DIR);
- $this->dateTime = $objectManagerProvider->get()->get('Magento\Framework\Stdlib\DateTime\DateTime');
+ $this->objectManager = $objectManagerProvider->get();
$this->composerInformation = $composerInformation;
}
/**
+ * Get datetime
+ *
+ * @return \Magento\Framework\Stdlib\DateTime\DateTime
+ */
+ private function getDateTime()
+ {
+ if ($this->dateTime === null) {
+ $this->dateTime = $this->objectManager->get('Magento\Setup\Model\DateTime\DateTimeProvider')->get();
+ }
+ return $this->dateTime;
+ }
+
+ /**
+ * Set datetime
+ *
+ * @param \Magento\Framework\Stdlib\DateTime\DateTime $dateTime
+ * @return void
+ * @throws \Exception
+ */
+ public function setDateTime(\Magento\Framework\Stdlib\DateTime\DateTime $dateTime)
+ {
+ if ($this->dateTime !== null) {
+ throw new \Exception('dateTime is already set');
+ }
+ $this->dateTime = $dateTime;
+ }
+
+ /**
* Sync and cache list of available for update versions for packages
*
* @return bool
@@ -172,7 +208,7 @@
private function savePackagesForUpdateToCache($availableVersions)
{
$syncInfo = [];
- $syncInfo['lastSyncDate'] = $this->dateTime->gmtTimestamp();
+ $syncInfo['lastSyncDate'] = $this->getDateTime()->gmtTimestamp();
$syncInfo['packages'] = $availableVersions;
$data = json_encode($syncInfo, JSON_UNESCAPED_SLASHES);
try {
--- Magento-CE-2.0.5/vendor/magento/magento2-base/setup/src/Magento/Setup/Module/Di/Compiler/Config/Writer/Filesystem.php 2016-04-28 06:15:28.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/magento2-base/setup/src/Magento/Setup/Module/Di/Compiler/Config/Writer/Filesystem.php 2016-05-16 20:18:00.000000000 -0300
@@ -51,7 +51,7 @@
private function initialize()
{
if (!file_exists($this->directoryList->getPath(DirectoryList::DI))) {
- mkdir($this->directoryList->getPath(DirectoryList::DI), DriverInterface::WRITEABLE_DIRECTORY_MODE);
+ mkdir($this->directoryList->getPath(DirectoryList::DI));
}
}
}
--- Magento-CE-2.0.5/vendor/magento/magento2-base/setup/src/Magento/Setup/Module/I18n/Pack/Writer/File/AbstractFile.php 2016-04-28 06:15:28.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/magento2-base/setup/src/Magento/Setup/Module/I18n/Pack/Writer/File/AbstractFile.php 2016-05-16 20:18:00.000000000 -0300
@@ -143,7 +143,7 @@
* @param bool $recursive Allows the creation of nested directories specified in the $destinationPath
* @return void
*/
- protected function _createDirectoryIfNotExist($destinationPath, $mode = 0750, $recursive = true)
+ protected function _createDirectoryIfNotExist($destinationPath, $mode = 0777, $recursive = true)
{
if (!is_dir($destinationPath)) {
mkdir($destinationPath, $mode, $recursive);
--- Magento-CE-2.0.5/vendor/magento/magento2-base/setup/src/Magento/Setup/Mvc/Bootstrap/InitParamListener.php 2016-04-28 06:15:28.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/magento2-base/setup/src/Magento/Setup/Mvc/Bootstrap/InitParamListener.php 2016-05-16 20:18:00.000000000 -0300
@@ -8,6 +8,7 @@
use Magento\Framework\App\Bootstrap as AppBootstrap;
use Magento\Framework\App\Filesystem\DirectoryList;
+use Magento\Framework\App\Request\Http;
use Magento\Framework\App\State;
use Magento\Framework\Filesystem;
use Magento\Framework\Shell\ComplexParameter;
@@ -47,9 +48,7 @@
*/
private $controllersToSkip = [
'Magento\Setup\Controller\Session',
- 'Magento\Setup\Controller\Install',
'Magento\Setup\Controller\Success'
-
];
/**
@@ -102,7 +101,7 @@
/**
* Check if user login
*
- * @param object $event
+ * @param \Zend\Mvc\MvcEvent $event
* @return bool
* @throws \Magento\Framework\Exception\LocalizedException
*/
@@ -117,25 +116,31 @@
$application = $event->getApplication();
$serviceManager = $application->getServiceManager();
if ($serviceManager->get('Magento\Framework\App\DeploymentConfig')->isAvailable()) {
+ /** @var \Magento\Setup\Model\ObjectManagerProvider $objectManagerProvider */
$objectManagerProvider = $serviceManager->get('Magento\Setup\Model\ObjectManagerProvider');
/** @var \Magento\Framework\ObjectManagerInterface $objectManager */
$objectManager = $objectManagerProvider->get();
/** @var \Magento\Framework\App\State $adminAppState */
$adminAppState = $objectManager->get('Magento\Framework\App\State');
$adminAppState->setAreaCode(\Magento\Framework\App\Area::AREA_ADMIN);
- $objectManager->create(
- 'Magento\Backend\Model\Auth\Session',
+ /** @var \Magento\Backend\Model\Session\AdminConfig $sessionConfig */
+ $sessionConfig = $objectManager->get(\Magento\Backend\Model\Session\AdminConfig::class);
+ $cookiePath = $this->getSetupCookiePath($objectManager);
+ $sessionConfig->setCookiePath($cookiePath);
+ /** @var \Magento\Backend\Model\Auth\Session $adminSession */
+ $adminSession = $objectManager->create(
+ \Magento\Backend\Model\Auth\Session::class,
[
- 'sessionConfig' => $objectManager->get('Magento\Backend\Model\Session\AdminConfig'),
+ 'sessionConfig' => $sessionConfig,
'appState' => $adminAppState
]
);
-
- if (!$objectManager->get('Magento\Backend\Model\Auth')->isLoggedIn()) {
+ if (!$objectManager->get(\Magento\Backend\Model\Auth::class)->isLoggedIn()) {
+ $adminSession->destroy();
$response = $event->getResponse();
- $response->getHeaders()->addHeaderLine('Location', 'index.php/session/unlogin');
+ $baseUrl = Http::getDistroBaseUrlPath($_SERVER);
+ $response->getHeaders()->addHeaderLine('Location', $baseUrl . 'index.php/session/unlogin');
$response->setStatusCode(302);
-
$event->stopPropagation();
return $response;
}
@@ -145,6 +150,25 @@
}
/**
+ * Get cookie path
+ *
+ * @param \Magento\Framework\ObjectManagerInterface $objectManager
+ * @return string
+ */
+ private function getSetupCookiePath(\Magento\Framework\ObjectManagerInterface $objectManager)
+ {
+ /** @var \Magento\Backend\App\BackendAppList $backendAppList */
+ $backendAppList = $objectManager->get(\Magento\Backend\App\BackendAppList::class);
+ $backendApp = $backendAppList->getBackendApp('setup');
+ /** @var \Magento\Backend\Model\UrlFactory $backendUrlFactory */
+ $backendUrlFactory = $objectManager->get(\Magento\Backend\Model\UrlFactory::class);
+ $baseUrl = parse_url($backendUrlFactory->create()->getBaseUrl(), PHP_URL_PATH);
+ $baseUrl = \Magento\Framework\App\Request\Http::getUrlNoScript($baseUrl);
+ $cookiePath = $baseUrl . $backendApp->getCookiePath();
+ return $cookiePath;
+ }
+
+ /**
* {@inheritdoc}
*/
public function createService(ServiceLocatorInterface $serviceLocator)
--- Magento-CE-2.0.5/vendor/magento/magento2-base/setup/src/Magento/Setup/Test/Unit/Console/Command/DiCompileCommandTest.php 2016-04-28 06:15:28.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/magento2-base/setup/src/Magento/Setup/Test/Unit/Console/Command/DiCompileCommandTest.php 2016-05-16 20:18:00.000000000 -0300
@@ -12,13 +12,13 @@
class DiCompileCommandTest extends \PHPUnit_Framework_TestCase
{
/** @var \Magento\Framework\App\DeploymentConfig|\PHPUnit_Framework_MockObject_MockObject */
- private $deploymentConfig;
+ private $deploymentConfigMock;
/** @var \Magento\Setup\Module\Di\App\Task\Manager|\PHPUnit_Framework_MockObject_MockObject */
- private $manager;
+ private $managerMock;
/** @var \Magento\Framework\ObjectManagerInterface|\PHPUnit_Framework_MockObject_MockObject */
- private $objectManager;
+ private $objectManagerMock;
/** @var DiCompileCommand|\PHPUnit_Framework_MockObject_MockObject */
private $command;
@@ -27,28 +27,28 @@
private $cacheMock;
/** @var \Magento\Framework\Filesystem|\PHPUnit_Framework_MockObject_MockObject */
- private $filesystem;
+ private $filesystemMock;
/** @var \Magento\Framework\Filesystem\Driver\File | \PHPUnit_Framework_MockObject_MockObject*/
- private $fileDriver;
+ private $fileDriverMock;
/** @var \Magento\Framework\App\Filesystem\DirectoryList | \PHPUnit_Framework_MockObject_MockObject*/
- private $directoryList;
+ private $directoryListMock;
/** @var \Magento\Framework\Component\ComponentRegistrar|\PHPUnit_Framework_MockObject_MockObject */
- private $componentRegistrar;
+ private $componentRegistrarMock;
public function setUp()
{
- $this->deploymentConfig = $this->getMock('Magento\Framework\App\DeploymentConfig', [], [], '', false);
- $objectManagerProvider = $this->getMock(
+ $this->deploymentConfigMock = $this->getMock('Magento\Framework\App\DeploymentConfig', [], [], '', false);
+ $objectManagerProviderMock = $this->getMock(
'Magento\Setup\Model\ObjectManagerProvider',
[],
[],
'',
false
);
- $this->objectManager = $this->getMockForAbstractClass(
+ $this->objectManagerMock = $this->getMockForAbstractClass(
'Magento\Framework\ObjectManagerInterface',
[],
'',
@@ -58,91 +58,87 @@
->disableOriginalConstructor()
->getMock();
- $objectManagerProvider->expects($this->once())
+ $objectManagerProviderMock->expects($this->once())
->method('get')
- ->willReturn($this->objectManager);
- $this->manager = $this->getMock('Magento\Setup\Module\Di\App\Task\Manager', [], [], '', false);
- $this->directoryList = $this->getMock('Magento\Framework\App\Filesystem\DirectoryList', [], [], '', false);
- $this->filesystem = $this->getMockBuilder('Magento\Framework\Filesystem')
+ ->willReturn($this->objectManagerMock);
+ $this->managerMock = $this->getMock('Magento\Setup\Module\Di\App\Task\Manager', [], [], '', false);
+ $this->directoryListMock = $this->getMock('Magento\Framework\App\Filesystem\DirectoryList', [], [], '', false);
+ $this->filesystemMock = $this->getMockBuilder('Magento\Framework\Filesystem')
->disableOriginalConstructor()
->getMock();
- $this->fileDriver = $this->getMockBuilder('Magento\Framework\Filesystem\Driver\File')
+ $this->fileDriverMock = $this->getMockBuilder('Magento\Framework\Filesystem\Driver\File')
->disableOriginalConstructor()
->getMock();
- $this->componentRegistrar = $this->getMock(
+ $this->componentRegistrarMock = $this->getMock(
'\Magento\Framework\Component\ComponentRegistrar',
[],
[],
'',
false
);
- $this->componentRegistrar->expects($this->any())->method('getPaths')->willReturnMap([
+ $this->componentRegistrarMock->expects($this->any())->method('getPaths')->willReturnMap([
[ComponentRegistrar::MODULE, ['/path/to/module/one', '/path/to/module/two']],
[ComponentRegistrar::LIBRARY, ['/path/to/library/one', '/path/to/library/two']],
]);
$this->command = new DiCompileCommand(
- $this->deploymentConfig,
- $this->directoryList,
- $this->manager,
- $objectManagerProvider,
- $this->filesystem,
- $this->fileDriver,
- $this->componentRegistrar
+ $this->deploymentConfigMock,
+ $this->directoryListMock,
+ $this->managerMock,
+ $objectManagerProviderMock,
+ $this->filesystemMock,
+ $this->fileDriverMock,
+ $this->componentRegistrarMock
);
}
- public function testExecuteDiExists()
+ public function testExecuteModulesNotEnabled()
{
- $diPath = '/root/magento/var/di';
- $this->deploymentConfig->expects($this->once())->method('isAvailable')->willReturn(true);
- $this->fileDriver->expects($this->atLeastOnce())->method('isExists')->with($diPath)->willReturn(true);
- $this->directoryList->expects($this->atLeastOnce())->method('getPath')->willReturn($diPath);
- $tester = new CommandTester($this->command);
- $tester->execute([]);
- $this->assertContains("delete '/root/magento/var/di'", $tester->getDisplay());
- }
-
- public function testExecuteNotInstalled()
- {
- $this->directoryList->expects($this->atLeastOnce())->method('getPath')->willReturn(null);
- $this->deploymentConfig->expects($this->once())->method('isAvailable')->willReturn(false);
+ $this->directoryListMock->expects($this->atLeastOnce())->method('getPath')->willReturn(null);
+ $this->deploymentConfigMock->expects($this->once())
+ ->method('get')
+ ->with(\Magento\Framework\Config\ConfigOptionsListConstants::KEY_MODULES)
+ ->willReturn(null);
$tester = new CommandTester($this->command);
$tester->execute([]);
$this->assertEquals(
- 'You cannot run this command because the Magento application is not installed.' . PHP_EOL,
+ 'You cannot run this command because modules are not enabled. You can enable modules by running the '
+ . "'module:enable --all' command." . PHP_EOL,
$tester->getDisplay()
);
}
public function testExecute()
{
- $this->directoryList->expects($this->atLeastOnce())->method('getPath')->willReturn(null);
- $this->objectManager->expects($this->once())
+ $this->directoryListMock->expects($this->atLeastOnce())->method('getPath')->willReturn(null);
+ $this->objectManagerMock->expects($this->once())
->method('get')
->with('Magento\Framework\App\Cache')
->willReturn($this->cacheMock);
$this->cacheMock->expects($this->once())->method('clean');
$writeDirectory = $this->getMock('Magento\Framework\Filesystem\Directory\WriteInterface');
$writeDirectory->expects($this->atLeastOnce())->method('delete');
- $this->filesystem->expects($this->atLeastOnce())->method('getDirectoryWrite')->willReturn($writeDirectory);
+ $this->filesystemMock->expects($this->atLeastOnce())->method('getDirectoryWrite')->willReturn($writeDirectory);
- $this->deploymentConfig->expects($this->once())->method('isAvailable')->willReturn(true);
+ $this->deploymentConfigMock->expects($this->once())
+ ->method('get')
+ ->with(\Magento\Framework\Config\ConfigOptionsListConstants::KEY_MODULES)
+ ->willReturn(['Magento_Catalog' => 1]);
$progressBar = $this->getMockBuilder(
'Symfony\Component\Console\Helper\ProgressBar'
)
->disableOriginalConstructor()
->getMock();
- $this->objectManager->expects($this->once())->method('configure');
- $this->objectManager
+ $this->objectManagerMock->expects($this->once())->method('configure');
+ $this->objectManagerMock
->expects($this->once())
->method('create')
->with('Symfony\Component\Console\Helper\ProgressBar')
->willReturn($progressBar);
- $this->manager->expects($this->exactly(7))->method('addOperation');
- $this->manager->expects($this->once())->method('process');
+ $this->managerMock->expects($this->exactly(7))->method('addOperation');
+ $this->managerMock->expects($this->once())->method('process');
$tester = new CommandTester($this->command);
$tester->execute([]);
$this->assertContains(
--- Magento-CE-2.0.5/vendor/magento/magento2-base/setup/src/Magento/Setup/Test/Unit/Console/Command/ModuleEnableDisableCommandTest.php 2016-04-28 06:15:28.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/magento2-base/setup/src/Magento/Setup/Test/Unit/Console/Command/ModuleEnableDisableCommandTest.php 2016-05-16 20:18:00.000000000 -0300
@@ -14,46 +14,58 @@
/**
* @var \Magento\Setup\Model\ObjectManagerProvider|\PHPUnit_Framework_MockObject_MockObject
*/
- private $objectManagerProvider;
+ private $objectManagerProviderMock;
/**
* @var \Magento\Framework\Module\Status|\PHPUnit_Framework_MockObject_MockObject
*/
- private $status;
+ private $statusMock;
/**
* @var \Magento\Framework\App\Cache|\PHPUnit_Framework_MockObject_MockObject
*/
- private $cache;
+ private $cacheMock;
/**
* @var \Magento\Framework\App\State\CleanupFiles|\PHPUnit_Framework_MockObject_MockObject
*/
- private $cleanupFiles;
+ private $cleanupFilesMock;
/**
* @var \Magento\Framework\Module\FullModuleList|\PHPUnit_Framework_MockObject_MockObject
*/
- private $fullModuleList;
+ private $fullModuleListMock;
+
+ /**
+ * @var \Magento\Framework\App\DeploymentConfig|\PHPUnit_Framework_MockObject_MockObject
+ */
+ private $deploymentConfigMock;
protected function setUp()
{
- $this->objectManagerProvider = $this->getMock('Magento\Setup\Model\ObjectManagerProvider', [], [], '', false);
+ $this->objectManagerProviderMock = $this->getMock(
+ 'Magento\Setup\Model\ObjectManagerProvider',
+ [],
+ [],
+ '',
+ false
+ );
$objectManager = $this->getMockForAbstractClass('Magento\Framework\ObjectManagerInterface');
- $this->objectManagerProvider->expects($this->any())
+ $this->objectManagerProviderMock->expects($this->any())
->method('get')
->will($this->returnValue($objectManager));
- $this->status = $this->getMock('Magento\Framework\Module\Status', [], [], '', false);
- $this->cache = $this->getMock('Magento\Framework\App\Cache', [], [], '', false);
- $this->cleanupFiles = $this->getMock('Magento\Framework\App\State\CleanupFiles', [], [], '', false);
- $this->fullModuleList = $this->getMock('Magento\Framework\Module\FullModuleList', [], [], '', false);
+ $this->statusMock = $this->getMock('Magento\Framework\Module\Status', [], [], '', false);
+ $this->cacheMock = $this->getMock('Magento\Framework\App\Cache', [], [], '', false);
+ $this->cleanupFilesMock = $this->getMock('Magento\Framework\App\State\CleanupFiles', [], [], '', false);
+ $this->fullModuleListMock = $this->getMock('Magento\Framework\Module\FullModuleList', [], [], '', false);
+ $this->deploymentConfigMock = $this->getMock(\Magento\Framework\App\DeploymentConfig::class, [], [], '', false);
$objectManager->expects($this->any())
->method('get')
->will($this->returnValueMap([
- ['Magento\Framework\Module\Status', $this->status],
- ['Magento\Framework\App\Cache', $this->cache],
- ['Magento\Framework\App\State\CleanupFiles', $this->cleanupFiles],
- ['Magento\Framework\Module\FullModuleList', $this->fullModuleList],
+ ['Magento\Framework\Module\Status', $this->statusMock],
+ ['Magento\Framework\App\Cache', $this->cacheMock],
+ ['Magento\Framework\App\State\CleanupFiles', $this->cleanupFilesMock],
+ ['Magento\Framework\Module\FullModuleList', $this->fullModuleListMock],
]));
}
@@ -66,35 +78,30 @@
*/
public function testExecute($isEnable, $clearStaticContent, $expectedMessage)
{
- $this->status->expects($this->once())
+ $this->statusMock->expects($this->once())
->method('getModulesToChange')
->with($isEnable, ['Magento_Module1', 'Magento_Module2'])
->will($this->returnValue(['Magento_Module1']));
-
- $this->status->expects($this->any())
+ $this->statusMock->expects($this->any())
->method('checkConstraints')
->will($this->returnValue([]));
-
- $this->status->expects($this->once())
+ $this->statusMock->expects($this->once())
->method('setIsEnabled')
->with($isEnable, ['Magento_Module1']);
-
- $this->cache->expects($this->once())
+ $this->cacheMock->expects($this->once())
->method('clean');
- $this->cleanupFiles->expects($this->once())
+ $this->cleanupFilesMock->expects($this->once())
->method('clearCodeGeneratedClasses');
- $this->cleanupFiles->expects($clearStaticContent ? $this->once() : $this->never())
+ $this->cleanupFilesMock->expects($clearStaticContent ? $this->once() : $this->never())
->method('clearMaterializedViewFiles');
-
- $commandTester = $isEnable
- ? new CommandTester(new ModuleEnableCommand($this->objectManagerProvider))
- : new CommandTester(new ModuleDisableCommand($this->objectManagerProvider));
+ $commandTester = $this->getCommandTester($isEnable);
$input = ['module' => ['Magento_Module1', 'Magento_Module2']];
if ($clearStaticContent) {
$input['--clear-static-content'] = true;
}
$commandTester->execute($input);
- $this->assertStringMatchesFormat($expectedMessage, $commandTester->getDisplay());
+ $display = $commandTester->getDisplay();
+ $this->assertStringMatchesFormat($expectedMessage, $display);
}
/**
@@ -106,14 +113,16 @@
'enable, do not clear static content' => [
true,
false,
- '%amodules have been enabled%aMagento_Module1%a' .
- 'Info: Some modules might require static view files to be cleared.%a'
+ '%amodules have been enabled%aMagento_Module1%a'
+ . "Info: Some modules might require static view files to be cleared. To do this, run "
+ . "'module:enable' with the --clear-static-content%a"
],
'disable, do not clear static content' => [
false,
false,
- '%amodules have been disabled%aMagento_Module1%a' .
- 'Info: Some modules might require static view files to be cleared.%a'
+ '%amodules have been disabled%aMagento_Module1%a'
+ . "Info: Some modules might require static view files to be cleared. To do this, run "
+ . "'module:disable' with the --clear-static-content%a"
],
'enable, clear static content' => [
true,
@@ -124,17 +133,17 @@
false,
true,
'%amodules have been disabled%aMagento_Module1%aGenerated static view files cleared%a'
- ],
+ ]
];
}
public function testExecuteEnableInvalidModule()
{
- $this->status->expects($this->once())
+ $this->statusMock->expects($this->once())
->method('getModulesToChange')
->with(true, ['invalid'])
->willThrowException(new \LogicException('Unknown module(s): invalid'));
- $commandTester = new CommandTester(new ModuleEnableCommand($this->objectManagerProvider));
+ $commandTester = $this->getCommandTester(true);
$input = ['module' => ['invalid']];
$commandTester->execute($input);
$this->assertEquals('Unknown module(s): invalid' . PHP_EOL, $commandTester->getDisplay());
@@ -142,11 +151,11 @@
public function testExecuteDisableInvalidModule()
{
- $this->status->expects($this->once())
+ $this->statusMock->expects($this->once())
->method('getModulesToChange')
->with(false, ['invalid'])
->willThrowException(new \LogicException('Unknown module(s): invalid'));
- $commandTester = new CommandTester(new ModuleDisableCommand($this->objectManagerProvider));
+ $commandTester = $this->getCommandTester(false);
$input = ['module' => ['invalid']];
$commandTester->execute($input);
$this->assertEquals('Unknown module(s): invalid' . PHP_EOL, $commandTester->getDisplay());
@@ -155,34 +164,44 @@
/**
* @param bool $isEnable
* @param string $expectedMessage
+ * @param bool $isInstalled
*
* @dataProvider executeAllDataProvider
*/
public function testExecuteAll($isEnable, $expectedMessage)
{
- $this->fullModuleList->expects($this->once())
+ $setupUpgradeMessage = 'To make sure that the enabled modules are properly registered, run \'setup:upgrade\'.';
+ $this->fullModuleListMock->expects($this->once())
->method('getNames')
->will($this->returnValue(['Magento_Module1', 'Magento_Module2']));
-
- $this->status->expects($this->once())
+ $this->statusMock->expects($this->once())
->method('getModulesToChange')
->with($isEnable, ['Magento_Module1', 'Magento_Module2'])
->will($this->returnValue(['Magento_Module1']));
-
- $this->status->expects($this->any())
+ $this->statusMock->expects($this->any())
->method('checkConstraints')
->will($this->returnValue([]));
-
- $this->status->expects($this->once())
+ $this->statusMock->expects($this->once())
->method('setIsEnabled')
->with($isEnable, ['Magento_Module1']);
-
- $commandTester = $isEnable
- ? new CommandTester(new ModuleEnableCommand($this->objectManagerProvider))
- : new CommandTester(new ModuleDisableCommand($this->objectManagerProvider));
+ if ($isEnable) {
+ $this->deploymentConfigMock->expects($this->once())
+ ->method('isAvailable')
+ ->willReturn(['Magento_Module1']);
+ } else {
+ $this->deploymentConfigMock->expects($this->never())
+ ->method('isAvailable');
+ }
+ $commandTester = $this->getCommandTester($isEnable);
$input = ['--all' => true];
$commandTester->execute($input);
- $this->assertStringMatchesFormat($expectedMessage, $commandTester->getDisplay());
+ $output = $commandTester->getDisplay();
+ $this->assertStringMatchesFormat($expectedMessage, $output);
+ if ($isEnable) {
+ $this->assertContains($setupUpgradeMessage, $output);
+ } else {
+ $this->assertNotContains($setupUpgradeMessage, $output);
+ }
}
/**
@@ -203,21 +222,16 @@
*/
public function testExecuteWithConstraints($isEnable)
{
- $this->status->expects($this->once())
+ $this->statusMock->expects($this->once())
->method('getModulesToChange')
->with($isEnable, ['Magento_Module1', 'Magento_Module2'])
->will($this->returnValue(['Magento_Module1']));
-
- $this->status->expects($this->any())
+ $this->statusMock->expects($this->any())
->method('checkConstraints')
->will($this->returnValue(['constraint1', 'constraint2']));
-
- $this->status->expects($this->never())
+ $this->statusMock->expects($this->never())
->method('setIsEnabled');
-
- $commandTester = $isEnable
- ? new CommandTester(new ModuleEnableCommand($this->objectManagerProvider))
- : new CommandTester(new ModuleDisableCommand($this->objectManagerProvider));
+ $commandTester = $this->getCommandTester($isEnable);
$commandTester->execute(['module' => ['Magento_Module1', 'Magento_Module2']]);
$this->assertStringMatchesFormat(
'Unable to change status of modules%aconstraint1%aconstraint2%a',
@@ -244,21 +258,16 @@
*/
public function testExecuteForce($isEnable, $expectedMessage)
{
- $this->status->expects($this->once())
+ $this->statusMock->expects($this->once())
->method('getModulesToChange')
->with($isEnable, ['Magento_Module1', 'Magento_Module2'])
->will($this->returnValue(['Magento_Module1']));
-
- $this->status->expects($this->never())
+ $this->statusMock->expects($this->never())
->method('checkConstraints');
-
- $this->status->expects($this->once())
+ $this->statusMock->expects($this->once())
->method('setIsEnabled')
->with($isEnable, ['Magento_Module1']);
-
- $commandTester = $isEnable
- ? new CommandTester(new ModuleEnableCommand($this->objectManagerProvider))
- : new CommandTester(new ModuleDisableCommand($this->objectManagerProvider));
+ $commandTester = $this->getCommandTester($isEnable);
$commandTester->execute(['module' => ['Magento_Module1', 'Magento_Module2'], '--force' => true]);
$this->assertStringMatchesFormat(
$expectedMessage . '%amodules might not function properly%a',
@@ -284,21 +293,31 @@
*/
public function testExecuteNoChanges($isEnable)
{
- $this->status->expects($this->once())
+ $this->statusMock->expects($this->once())
->method('getModulesToChange')
->with($isEnable, ['Magento_Module1', 'Magento_Module2'])
->will($this->returnValue([]));
-
- $this->status->expects($this->never())
+ $this->statusMock->expects($this->never())
->method('setIsEnabled');
-
- $commandTester = $isEnable
- ? new CommandTester(new ModuleEnableCommand($this->objectManagerProvider))
- : new CommandTester(new ModuleDisableCommand($this->objectManagerProvider));
+ $commandTester = $this->getCommandTester($isEnable);
$commandTester->execute(['module' => ['Magento_Module1', 'Magento_Module2']]);
$this->assertStringMatchesFormat(
'No modules were changed%a',
$commandTester->getDisplay()
);
}
+
+ /**
+ * @param bool $isEnable
+ * @return CommandTester
+ */
+ private function getCommandTester($isEnable)
+ {
+ $class = $isEnable ? ModuleEnableCommand::class : ModuleDisableCommand::class;
+ $command = new $class($this->objectManagerProviderMock);
+ $deploymentConfigProperty = new \ReflectionProperty($class, 'deploymentConfig');
+ $deploymentConfigProperty->setAccessible(true);
+ $deploymentConfigProperty->setValue($command, $this->deploymentConfigMock);
+ return new CommandTester($command);
+ }
}
--- Magento-CE-2.0.5/vendor/magento/magento2-base/setup/src/Magento/Setup/Test/Unit/Controller/ComponentGridTest.php 1969-12-31 21:00:00.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/magento2-base/setup/src/Magento/Setup/Test/Unit/Controller/ComponentGridTest.php 2016-05-16 20:18:00.000000000 -0300
@@ -0,0 +1,280 @@
+<?php
+/**
+ * Copyright © 2016 Magento. All rights reserved.
+ * See COPYING.txt for license details.
+ */
+
+namespace Magento\Setup\Test\Unit\Controller;
+
+use Magento\Framework\Composer\ComposerInformation;
+use Magento\Framework\Module\PackageInfo;
+use Magento\Framework\Module\PackageInfoFactory;
+use Magento\Setup\Controller\ComponentGrid;
+use Magento\Setup\Model\DateTime\TimezoneProvider;
+use Magento\Setup\Model\ObjectManagerProvider;
+use Magento\Setup\Model\UpdatePackagesCache;
+use Magento\Framework\Module\FullModuleList;
+use Magento\Framework\Module\ModuleList;
+use Magento\Framework\Stdlib\DateTime\TimezoneInterface;
+use Magento\Setup\Model\MarketplaceManager;
+
+class ComponentGridTest extends \PHPUnit_Framework_TestCase
+{
+ /**
+ * @var ComposerInformation|\PHPUnit_Framework_MockObject_MockObject
+ */
+ private $composerInformationMock;
+
+ /**
+ * @var UpdatePackagesCache|\PHPUnit_Framework_MockObject_MockObject
+ */
+ private $updatePackagesCacheMock;
+
+ /**
+ * @var TimezoneInterface|\PHPUnit_Framework_MockObject_MockObject
+ *
+ */
+ private $timezoneMock;
+
+ /**
+ * @var FullModuleList|\PHPUnit_Framework_MockObject_MockObject
+ */
+ private $fullModuleListMock;
+
+ /**
+ * @var ModuleList|\PHPUnit_Framework_MockObject_MockObject
+ */
+ private $enabledModuleListMock;
+
+ /**
+ * @var PackageInfoFactory|\PHPUnit_Framework_MockObject_MockObject
+ */
+ private $packageInfoFactoryMock;
+
+ /**
+ * Module package info
+ *
+ * @var PackageInfo
+ */
+ private $packageInfo;
+
+ /**
+ * Controller
+ *
+ * @var ComponentGrid
+ */
+ private $controller;
+
+ /**
+ * @var MarketplaceManager
+ */
+ private $marketplaceManagerMock;
+
+ /**
+ * @var array
+ */
+ private $componentData = [];
+
+ /**
+ * @var array
+ */
+ private $lastSyncData = [];
+
+ /**
+ * @var array
+ */
+ private $convertedLastSyncDate = [];
+
+ /**#@+
+ * Canned formatted date and time to return from mock
+ */
+ const FORMATTED_DATE = 'Jan 15, 1980';
+ const FORMATTED_TIME = '1:55:55 PM';
+ /**#@-*/
+
+ public function setUp()
+ {
+ $this->convertedLastSyncDate = [
+ 'lastSyncDate' => [
+ 'date' => self::FORMATTED_DATE,
+ 'time' => self::FORMATTED_TIME,
+ ],
+ ];
+
+ $this->lastSyncData = [
+ "lastSyncDate" => "1447271496",
+ "packages" => [
+ 'magento/sample-module-one' => [
+ 'name' => 'magento/sample-module-one',
+ 'type' => 'magento2-module',
+ 'version' => '1.0.0'
+ ]
+ ],
+ 'countOfInstall' => 0,
+ 'countOfUpdate' => 1
+ ];
+ $this->componentData = [
+ 'magento/sample-module-one' => [
+ 'name' => 'magento/sample-module-one',
+ 'type' => 'magento2-module',
+ 'version' => '1.0.0'
+ ]
+ ];
+ $allComponentData = [
+ 'magento/sample-module-two' => [
+ 'name' => 'magento/sample-module-two',
+ 'type' => 'magento2-module',
+ 'version' => '1.0.0'
+ ]
+ ];
+ $allComponentData = array_merge($allComponentData, $this->componentData);
+ $this->composerInformationMock = $this->getMock(
+ 'Magento\Framework\Composer\ComposerInformation',
+ [],
+ [],
+ '',
+ false
+ );
+ /** @var ObjectManagerProvider|\PHPUnit_Framework_MockObject_MockObject $objectManagerProvider */
+ $objectManagerProvider = $this->getMock('Magento\Setup\Model\ObjectManagerProvider', [], [], '', false);
+ $objectManager = $this->getMock('Magento\Framework\ObjectManagerInterface', [], [], '', false);
+ $objectManagerProvider->expects($this->once())
+ ->method('get')
+ ->willReturn($objectManager);
+ $this->packageInfoFactoryMock = $this
+ ->getMock('Magento\Framework\Module\PackageInfoFactory', [], [], '', false);
+ $this->enabledModuleListMock = $this->getMock('Magento\Framework\Module\ModuleList', [], [], '', false);
+ $this->enabledModuleListMock->expects($this->any())->method('has')->willReturn(true);
+ $this->fullModuleListMock = $this->getMock('Magento\Framework\Module\FullModuleList', [], [], '', false);
+ $this->fullModuleListMock->expects($this->any())->method('getNames')->willReturn($allComponentData);
+ $this->timezoneMock = $this->getMock('Magento\Framework\Stdlib\DateTime\TimezoneInterface', [], [], '', false);
+ $objectManager->expects($this->any())
+ ->method('get')
+ ->willReturnMap([
+ ['Magento\Framework\Module\PackageInfoFactory', $this->packageInfoFactoryMock],
+ ['Magento\Framework\Module\FullModuleList', $this->fullModuleListMock],
+ ['Magento\Framework\Module\ModuleList', $this->enabledModuleListMock],
+ ['Magento\Framework\Stdlib\DateTime\TimezoneInterface', $this->timezoneMock]
+ ]);
+
+ /** @var TimezoneProvider|\PHPUnit_Framework_MockObject_MockObject $timezoneProviderMock */
+ $timezoneProviderMock = $this->getMock('\Magento\Setup\Model\DateTime\TimezoneProvider', [], [], '', false);
+ $timezoneProviderMock->expects($this->any())
+ ->method('get')
+ ->willReturn($this->timezoneMock);
+ $this->packageInfo = $this->getMock('Magento\Framework\Module\PackageInfo', [], [], '', false);
+ $this->updatePackagesCacheMock = $this->getMock('Magento\Setup\Model\UpdatePackagesCache', [], [], '', false);
+ $this->marketplaceManagerMock = $this->getMock('Magento\Setup\Model\MarketplaceManager', [], [], '', false);
+ $this->packageInfoFactoryMock->expects($this->once())->method('create')->willReturn($this->packageInfo);
+ $this->controller = new ComponentGrid(
+ $this->composerInformationMock,
+ $objectManagerProvider,
+ $this->updatePackagesCacheMock,
+ $this->marketplaceManagerMock
+ );
+ $this->controller->setTimezone($timezoneProviderMock->get());
+ }
+
+ public function testIndexAction()
+ {
+ $viewModel = $this->controller->indexAction();
+ $this->assertInstanceOf('Zend\View\Model\ViewModel', $viewModel);
+ $this->assertTrue($viewModel->terminate());
+ }
+
+ public function testComponentsAction()
+ {
+ $this->fullModuleListMock->expects($this->once())
+ ->method('getNames')
+ ->willReturn(['magento/sample-module1']);
+ $this->packageInfo->expects($this->once())
+ ->method('getModuleName')
+ ->willReturn('Sample_Module');
+ $this->packageInfo->expects($this->exactly(2))
+ ->method('getPackageName')
+ ->willReturn($this->componentData['magento/sample-module-one']['name']);
+ $this->packageInfo->expects($this->exactly(2))
+ ->method('getVersion')
+ ->willReturn($this->componentData['magento/sample-module-one']['version']);
+ $this->enabledModuleListMock->expects($this->once())
+ ->method('has')
+ ->willReturn(true);
+ $this->composerInformationMock->expects($this->once())
+ ->method('getInstalledMagentoPackages')
+ ->willReturn($this->componentData);
+ $this->composerInformationMock->expects($this->once())
+ ->method('isPackageInComposerJson')
+ ->willReturn(true);
+ $this->updatePackagesCacheMock->expects($this->once())
+ ->method('getPackagesForUpdate')
+ ->willReturn($this->lastSyncData);
+ $this->setupTimezoneMock();
+ $jsonModel = $this->controller->componentsAction();
+ $this->assertInstanceOf('Zend\View\Model\JsonModel', $jsonModel);
+ $variables = $jsonModel->getVariables();
+ $this->assertArrayHasKey('success', $variables);
+ $this->assertTrue($variables['success']);
+ $expected = [[
+ 'name' => 'magento/sample-module-one',
+ 'type' => 'magento2-module',
+ 'version' => '1.0.0',
+ 'update' => false,
+ 'uninstall' => true,
+ 'vendor' => 'magento',
+ 'moduleName' => 'Sample_Module',
+ 'enable' => true,
+ 'disable' => false
+ ]];
+ $this->assertEquals($expected, $variables['components']);
+ $this->assertArrayHasKey('total', $variables);
+ $this->assertEquals(1, $variables['total']);
+ $expectedLastSyncData = array_replace($this->lastSyncData, $this->convertedLastSyncDate);
+ $this->assertEquals($expectedLastSyncData, $variables['lastSyncData']);
+ }
+
+ public function testSyncAction()
+ {
+ $this->updatePackagesCacheMock->expects($this->once())
+ ->method('syncPackagesForUpdate');
+ $this->updatePackagesCacheMock->expects($this->once())
+ ->method('getPackagesForUpdate')
+ ->willReturn($this->lastSyncData);
+ $this->setupTimezoneMock();
+ $jsonModel = $this->controller->syncAction();
+ $this->assertInstanceOf('Zend\View\Model\JsonModel', $jsonModel);
+ $variables = $jsonModel->getVariables();
+ $this->assertArrayHasKey('success', $variables);
+ $this->assertTrue($variables['success']);
+ $expectedLastSyncData = array_replace($this->lastSyncData, $this->convertedLastSyncDate);
+ $this->assertEquals($expectedLastSyncData, $variables['lastSyncData']);
+ }
+
+ /**
+ * Prepare the timezone mock to expect calls and return formatted date and time
+ *
+ * @return none
+ */
+ private function setupTimezoneMock()
+ {
+ $this->timezoneMock->expects($this->at(0))
+ ->method('formatDateTime')
+ ->with(
+ $this->isInstanceOf('\DateTime'),
+ \IntlDateFormatter::MEDIUM,
+ \IntlDateFormatter::NONE,
+ null,
+ null,
+ null
+ )->willReturn(self::FORMATTED_DATE);
+ $this->timezoneMock->expects($this->at(1))
+ ->method('formatDateTime')
+ ->with(
+ $this->isInstanceOf('\DateTime'),
+ \IntlDateFormatter::NONE,
+ \IntlDateFormatter::MEDIUM,
+ null,
+ null,
+ null
+ )->willReturn(self::FORMATTED_TIME);
+ }
+}
--- Magento-CE-2.0.5/vendor/magento/magento2-base/setup/src/Magento/Setup/Test/Unit/Controller/InstallTest.php 2016-04-28 06:15:28.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/magento2-base/setup/src/Magento/Setup/Test/Unit/Controller/InstallTest.php 2016-05-16 20:18:00.000000000 -0300
@@ -35,6 +35,11 @@
*/
private $sampleDataState;
+ /**
+ * @var \Magento\Framework\App\DeploymentConfig|\PHPUnit_Framework_MockObject_MockObject
+ */
+ private $deploymentConfig;
+
public function setUp()
{
$this->webLogger = $this->getMock('\Magento\Setup\Model\WebLogger', [], [], '', false);
@@ -42,6 +47,7 @@
$this->installer = $this->getMock('\Magento\Setup\Model\Installer', [], [], '', false);
$this->progressFactory = $this->getMock('\Magento\Setup\Model\Installer\ProgressFactory', [], [], '', false);
$this->sampleDataState = $this->getMock('\Magento\Framework\Setup\SampleData\State', [], [], '', false);
+ $this->deploymentConfig = $this->getMock('\Magento\Framework\App\DeploymentConfig', [], [], '', false);
$installerFactory->expects($this->once())->method('create')->with($this->webLogger)
->willReturn($this->installer);
@@ -51,6 +57,11 @@
$this->progressFactory,
$this->sampleDataState
);
+
+ $deploymentConfigReflection = new \ReflectionClass(get_class($this->controller));
+ $deploymentConfigReflectionProperty = $deploymentConfigReflection->getProperty('deploymentConfig');
+ $deploymentConfigReflectionProperty->setAccessible(true);
+ $deploymentConfigReflectionProperty->setValue($this->controller, $this->deploymentConfig);
}
public function testIndexAction()
@@ -65,6 +76,7 @@
$this->webLogger->expects($this->once())->method('clear');
$this->installer->expects($this->once())->method('install');
$this->installer->expects($this->exactly(2))->method('getInstallInfo');
+ $this->deploymentConfig->expects($this->once())->method('isAvailable')->willReturn(false);
$jsonModel = $this->controller->startAction();
$this->assertInstanceOf('\Zend\View\Model\JsonModel', $jsonModel);
$variables = $jsonModel->getVariables();
@@ -74,9 +86,23 @@
$this->assertTrue($variables['success']);
}
- public function testStartActionException()
+ public function testStartActionPriorInstallException()
+ {
+ $this->webLogger->expects($this->once())->method('clear');
+ $this->installer->expects($this->never())->method('install');
+ $this->installer->expects($this->never())->method('getInstallInfo');
+ $this->deploymentConfig->expects($this->once())->method('isAvailable')->willReturn(true);
+ $jsonModel = $this->controller->startAction();
+ $this->assertInstanceOf('\Zend\View\Model\JsonModel', $jsonModel);
+ $variables = $jsonModel->getVariables();
+ $this->assertArrayHasKey('success', $variables);
+ $this->assertArrayHasKey('messages', $variables);
+ $this->assertFalse($variables['success']);
+ }
+ public function testStartActionInstallException()
{
$this->webLogger->expects($this->once())->method('clear');
+ $this->deploymentConfig->expects($this->once())->method('isAvailable')->willReturn(false);
$this->installer->expects($this->once())->method('install')
->willThrowException($this->getMock('\Exception'));
$jsonModel = $this->controller->startAction();
@@ -87,6 +113,7 @@
{
$this->webLogger->expects($this->once())->method('clear');
$this->webLogger->expects($this->never())->method('logError');
+ $this->deploymentConfig->expects($this->once())->method('isAvailable')->willReturn(false);
$this->installer->method('install');
$this->sampleDataState->expects($this->once())->method('hasError')->willReturn(true);
$jsonModel = $this->controller->startAction();
--- Magento-CE-2.0.5/vendor/magento/magento2-base/setup/src/Magento/Setup/Test/Unit/Model/ConfigOptionsListTest.php 1969-12-31 21:00:00.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/magento2-base/setup/src/Magento/Setup/Test/Unit/Model/ConfigOptionsListTest.php 2016-05-16 20:18:00.000000000 -0300
@@ -0,0 +1,183 @@
+<?php
+/**
+ * Copyright © 2016 Magento. All rights reserved.
+ * See COPYING.txt for license details.
+ */
+
+namespace Magento\Setup\Test\Unit\Model;
+
+use Magento\Setup\Model\ConfigGenerator;
+use Magento\Setup\Model\ConfigOptionsList;
+use Magento\Setup\Validator\DbValidator;
+use Magento\Framework\Config\ConfigOptionsListConstants;
+
+class ConfigOptionsListTest extends \PHPUnit_Framework_TestCase
+{
+ /**
+ * @var ConfigOptionsList
+ */
+ private $object;
+
+ /**
+ * @var ConfigGenerator|\PHPUnit_Framework_MockObject_MockObject
+ */
+ private $generator;
+
+ /**
+ * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Framework\App\DeploymentConfig
+ */
+ private $deploymentConfig;
+
+ /**
+ * @var DbValidator|\PHPUnit_Framework_MockObject_MockObject
+ */
+ private $dbValidator;
+
+ protected function setUp()
+ {
+ $this->generator = $this->getMock('Magento\Setup\Model\ConfigGenerator', [], [], '', false);
+ $this->deploymentConfig = $this->getMock('Magento\Framework\App\DeploymentConfig', [], [], '', false);
+ $this->dbValidator = $this->getMock('Magento\Setup\Validator\DbValidator', [], [], '', false);
+ $this->object = new ConfigOptionsList($this->generator, $this->dbValidator);
+ }
+
+ public function testGetOptions()
+ {
+ $options = $this->object->getOptions();
+ $this->assertInstanceOf('Magento\Framework\Setup\Option\TextConfigOption', $options[0]);
+ $this->assertSame('Encryption key', $options[0]->getDescription());
+ $this->assertInstanceOf('Magento\Framework\Setup\Option\SelectConfigOption', $options[1]);
+ $this->assertSame('Session save handler', $options[1]->getDescription());
+ $this->assertInstanceOf('Magento\Framework\Setup\Option\SelectConfigOption', $options[2]);
+ $this->assertSame('Type of definitions used by Object Manager', $options[2]->getDescription());
+ $this->assertInstanceOf('Magento\Framework\Setup\Option\TextConfigOption', $options[3]);
+ $this->assertSame('Database server host', $options[3]->getDescription());
+ $this->assertInstanceOf('Magento\Framework\Setup\Option\TextConfigOption', $options[4]);
+ $this->assertSame('Database name', $options[4]->getDescription());
+ $this->assertInstanceOf('Magento\Framework\Setup\Option\TextConfigOption', $options[5]);
+ $this->assertSame('Database server username', $options[5]->getDescription());
+ $this->assertInstanceOf('Magento\Framework\Setup\Option\TextConfigOption', $options[6]);
+ $this->assertSame('Database server engine', $options[6]->getDescription());
+ $this->assertInstanceOf('Magento\Framework\Setup\Option\TextConfigOption', $options[7]);
+ $this->assertSame('Database server password', $options[7]->getDescription());
+ $this->assertInstanceOf('Magento\Framework\Setup\Option\TextConfigOption', $options[8]);
+ $this->assertSame('Database table prefix', $options[8]->getDescription());
+ $this->assertInstanceOf('Magento\Framework\Setup\Option\TextConfigOption', $options[9]);
+ $this->assertSame('Database type', $options[9]->getDescription());
+ $this->assertInstanceOf('Magento\Framework\Setup\Option\TextConfigOption', $options[10]);
+ $this->assertSame('Database initial set of commands', $options[10]->getDescription());
+ $this->assertInstanceOf('Magento\Framework\Setup\Option\FlagConfigOption', $options[11]);
+ $this->assertSame(
+ 'If specified, then db connection validation will be skipped',
+ $options[11]->getDescription()
+ );
+ $this->assertInstanceOf('Magento\Framework\Setup\Option\TextConfigOption', $options[12]);
+ $this->assertSame('http Cache hosts', $options[12]->getDescription());
+ $this->assertEquals(13, count($options));
+ }
+
+ public function testCreateOptions()
+ {
+ $configDataMock = $this->getMock('Magento\Framework\Config\Data\ConfigData', [], [], '', false);
+ $this->generator->expects($this->once())->method('createCryptConfig')->willReturn($configDataMock);
+ $this->generator->expects($this->once())->method('createSessionConfig')->willReturn($configDataMock);
+ $this->generator->expects($this->once())->method('createDefinitionsConfig')->willReturn($configDataMock);
+ $this->generator->expects($this->once())->method('createDbConfig')->willReturn($configDataMock);
+ $this->generator->expects($this->once())->method('createResourceConfig')->willReturn($configDataMock);
+ $this->generator->expects($this->once())->method('createXFrameConfig')->willReturn($configDataMock);
+ $this->generator->expects($this->once())->method('createCacheHostsConfig')->willReturn($configDataMock);
+ $configData = $this->object->createConfig([], $this->deploymentConfig);
+ $this->assertEquals(8, count($configData));
+ }
+
+ public function testCreateOptionsWithOptionalNull()
+ {
+ $configDataMock = $this->getMock('Magento\Framework\Config\Data\ConfigData', [], [], '', false);
+ $this->generator->expects($this->once())->method('createCryptConfig')->willReturn($configDataMock);
+ $this->generator->expects($this->once())->method('createSessionConfig')->willReturn($configDataMock);
+ $this->generator->expects($this->once())->method('createDefinitionsConfig')->willReturn(null);
+ $this->generator->expects($this->once())->method('createDbConfig')->willReturn($configDataMock);
+ $this->generator->expects($this->once())->method('createResourceConfig')->willReturn($configDataMock);
+ $this->generator->expects($this->once())->method('createXFrameConfig')->willReturn($configDataMock);
+ $this->generator->expects($this->once())->method('createCacheHostsConfig')->willReturn($configDataMock);
+ $configData = $this->object->createConfig([], $this->deploymentConfig);
+ $this->assertEquals(7, count($configData));
+ }
+
+ public function testValidateSuccess()
+ {
+ $options = [
+ ConfigOptionsListConstants::INPUT_KEY_DB_PREFIX => 'prefix',
+ ConfigOptionsListConstants::INPUT_KEY_SESSION_SAVE => 'files',
+ ConfigOptionsListConstants::INPUT_KEY_SKIP_DB_VALIDATION => false,
+ ConfigOptionsListConstants::INPUT_KEY_DB_NAME => 'name',
+ ConfigOptionsListConstants::INPUT_KEY_DB_HOST => 'host',
+ ConfigOptionsListConstants::INPUT_KEY_DB_USER => 'user',
+ ConfigOptionsListConstants::INPUT_KEY_DB_PASSWORD => 'pass'
+ ];
+ $this->prepareValidationMocks();
+ $this->assertEquals([], $this->object->validate($options, $this->deploymentConfig));
+ }
+
+ public function testValidateInvalidSessionHandler()
+ {
+ $invalidSaveHandler = 'clay-tablet';
+
+ $options = [
+ ConfigOptionsListConstants::INPUT_KEY_DB_PREFIX => 'prefix',
+ ConfigOptionsListConstants::INPUT_KEY_SESSION_SAVE => $invalidSaveHandler,
+ ConfigOptionsListConstants::INPUT_KEY_SKIP_DB_VALIDATION => false,
+ ConfigOptionsListConstants::INPUT_KEY_DB_NAME => 'name',
+ ConfigOptionsListConstants::INPUT_KEY_DB_HOST => 'host',
+ ConfigOptionsListConstants::INPUT_KEY_DB_USER => 'user',
+ ConfigOptionsListConstants::INPUT_KEY_DB_PASSWORD => 'pass'
+ ];
+ $this->prepareValidationMocks();
+ $this->assertEquals(
+ ["Invalid session handler '$invalidSaveHandler'"],
+ $this->object->validate($options, $this->deploymentConfig)
+ );
+ }
+
+ private function prepareValidationMocks()
+ {
+ $configDataMock = $this->getMockBuilder('Magento\Framework\Config\Data\ConfigData')
+ ->disableOriginalConstructor()
+ ->getMock();
+ $this->dbValidator->expects($this->once())->method('checkDatabaseTablePrefix')->willReturn($configDataMock);
+ $this->dbValidator->expects($this->once())->method('checkDatabaseConnection')->willReturn($configDataMock);
+ }
+
+ /**
+ * @param string $hosts
+ * @param bool $expectedError
+ * @dataProvider validateCacheHostsDataProvider
+ */
+ public function testValidateCacheHosts($hosts, $expectedError)
+ {
+ $options = [
+ ConfigOptionsListConstants::INPUT_KEY_SKIP_DB_VALIDATION => true,
+ ConfigOptionsListConstants::INPUT_KEY_CACHE_HOSTS => $hosts
+ ];
+ $result = $this->object->validate($options, $this->deploymentConfig);
+ if ($expectedError) {
+ $this->assertCount(1, $result);
+ $this->assertEquals("Invalid http cache hosts '$hosts'", $result[0]);
+ } else {
+ $this->assertCount(0, $result);
+ }
+
+ }
+
+ public function validateCacheHostsDataProvider()
+ {
+ return [
+ ['localhost', false],
+ ['122.11.2.34:800', false],
+ ['122.11.2.34:800,localhost', false],
+ ['website.com:9000', false],
+ ['website.com/m2ce:9000', true],
+ ['website.com+:9000', true],
+ ];
+ }
+}
--- Magento-CE-2.0.5/vendor/magento/magento2-base/setup/src/Magento/Setup/Test/Unit/Model/DateTime/DateTimeProviderTest.php 1969-12-31 21:00:00.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/magento2-base/setup/src/Magento/Setup/Test/Unit/Model/DateTime/DateTimeProviderTest.php 2016-05-16 20:18:00.000000000 -0300
@@ -0,0 +1,41 @@
+<?php
+/**
+ * Copyright © 2016 Magento. All rights reserved.
+ * See COPYING.txt for license details.
+ */
+namespace Magento\Setup\Test\Unit\Model\DateTime;
+
+use Magento\Setup\Model\DateTime\DateTimeProvider;
+use Magento\Setup\Model\DateTime\TimezoneProvider;
+use Magento\Setup\Model\ObjectManagerProvider;
+
+class DateTimeProviderTest extends \PHPUnit_Framework_TestCase
+{
+ public function testGet()
+ {
+ $dateTime = $this->getMock('\Magento\Framework\Stdlib\DateTime\DateTime', [], [], '', false);
+ /** @var TimezoneProvider|\PHPUnit_Framework_MockObject_MockObject $timeZoneProvider */
+ $timeZoneProvider = $this->getMock('\Magento\Setup\Model\DateTime\TimezoneProvider', [], [], '', false);
+ $timeZone = $this->getMock('\Magento\Framework\Stdlib\DateTime\Timezone', [], [], '', false);
+ $timeZoneProvider->expects($this->any())
+ ->method('get')
+ ->willReturn($timeZone);
+ $objectManager = $this->getMockForAbstractClass('\Magento\Framework\ObjectManagerInterface', [], '', false);
+ $objectManager->expects($this->once())
+ ->method('create')
+ ->with(
+ 'Magento\Framework\Stdlib\DateTime\DateTime',
+ ['localeDate' => $timeZone]
+ )
+ ->willReturn($dateTime);
+ /** @var ObjectManagerProvider|\PHPUnit_Framework_MockObject_MockObject $objectManagerProvider */
+ $objectManagerProvider = $this->getMock('\Magento\Setup\Model\ObjectManagerProvider', [], [], '', false);
+ $objectManagerProvider->expects($this->any())
+ ->method('get')
+ ->willReturn($objectManager);
+ $object = new DateTimeProvider($timeZoneProvider, $objectManagerProvider);
+ $this->assertSame($dateTime, $object->get());
+ // Assert that the provider always returns the same object
+ $this->assertSame($dateTime, $object->get());
+ }
+}
--- Magento-CE-2.0.5/vendor/magento/magento2-base/setup/src/Magento/Setup/Test/Unit/Model/DateTime/TimezoneProviderTest.php 1969-12-31 21:00:00.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/magento2-base/setup/src/Magento/Setup/Test/Unit/Model/DateTime/TimezoneProviderTest.php 2016-05-16 20:18:00.000000000 -0300
@@ -0,0 +1,35 @@
+<?php
+/**
+ * Copyright © 2016 Magento. All rights reserved.
+ * See COPYING.txt for license details.
+ */
+namespace Magento\Setup\Test\Unit\Model\DateTime;
+
+use Magento\Framework\App\Config\ScopeConfigInterface;
+use Magento\Setup\Model\DateTime\TimezoneProvider;
+use Magento\Setup\Model\ObjectManagerProvider;
+
+class TimezoneProviderTest extends \PHPUnit_Framework_TestCase
+{
+ public function testGet()
+ {
+ $timeZone = $this->getMock('\Magento\Framework\Stdlib\DateTime\Timezone', [], [], '', false);
+ $objectManager = $this->getMockForAbstractClass('\Magento\Framework\ObjectManagerInterface', [], '', false);
+ $objectManager->expects($this->once())
+ ->method('create')
+ ->with(
+ 'Magento\Framework\Stdlib\DateTime\Timezone',
+ ['scopeType' => ScopeConfigInterface::SCOPE_TYPE_DEFAULT]
+ )
+ ->willReturn($timeZone);
+ /** @var ObjectManagerProvider|\PHPUnit_Framework_MockObject_MockObject $objectManagerProvider */
+ $objectManagerProvider = $this->getMock('\Magento\Setup\Model\ObjectManagerProvider', [], [], '', false);
+ $objectManagerProvider->expects($this->any())
+ ->method('get')
+ ->willReturn($objectManager);
+ $object = new TimezoneProvider($objectManagerProvider);
+ $this->assertSame($timeZone, $object->get());
+ // Assert that the provider always returns the same object
+ $this->assertSame($timeZone, $object->get());
+ }
+}
--- Magento-CE-2.0.5/vendor/magento/magento2-base/setup/src/Magento/Setup/Test/Unit/Model/InstallerTest.php 2016-04-28 06:15:28.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/magento2-base/setup/src/Magento/Setup/Test/Unit/Model/InstallerTest.php 2016-05-16 20:18:00.000000000 -0300
@@ -233,7 +233,14 @@
ConfigOptionsListConstants::INPUT_KEY_ENCRYPTION_KEY => 'encryption_key',
ConfigOptionsList::INPUT_KEY_BACKEND_FRONTNAME => 'backend',
];
- $this->config->expects($this->atLeastOnce())->method('isAvailable')->willReturn(true);
+ $this->config->expects($this->atLeastOnce())
+ ->method('get')
+ ->willReturnMap(
+ [
+ [ConfigOptionsListConstants::CONFIG_PATH_DB_CONNECTION_DEFAULT, null, true],
+ [ConfigOptionsListConstants::CONFIG_PATH_CRYPT_KEY, null, true],
+ ]
+ );
$allModules = ['Foo_One' => [], 'Bar_Two' => []];
$this->moduleLoader->expects($this->any())->method('load')->willReturn($allModules);
$setup = $this->getMock('Magento\Setup\Module\Setup', [], [], '', false);
@@ -296,8 +303,9 @@
$this->logger->expects($this->at(34))->method('log')->with('Caches clearing:');
$this->logger->expects($this->at(37))->method('log')->with('Disabling Maintenance Mode:');
$this->logger->expects($this->at(39))->method('log')->with('Post installation file permissions check...');
- $this->logger->expects($this->at(41))->method('logSuccess')->with('Magento installation complete.');
- $this->logger->expects($this->at(43))->method('log')
+ $this->logger->expects($this->at(41))->method('log')->with('Write installation date...');
+ $this->logger->expects($this->at(43))->method('logSuccess')->with('Magento installation complete.');
+ $this->logger->expects($this->at(45))->method('log')
->with('Sample Data is installed with errors. See log file for details');
$this->object->install($request);
}
@@ -368,7 +376,6 @@
public function testUninstall()
{
- $this->config->expects($this->once())->method('isAvailable')->willReturn(false);
$this->configReader->expects($this->once())->method('getFiles')->willReturn(['ConfigOne.php', 'ConfigTwo.php']);
$configDir = $this->getMockForAbstractClass('Magento\Framework\Filesystem\Directory\WriteInterface');
$configDir
@@ -433,7 +440,6 @@
public function testCleanupDb()
{
- $this->config->expects($this->once())->method('isAvailable')->willReturn(true);
$this->config->expects($this->once())
->method('get')
->with(ConfigOptionsListConstants::CONFIG_PATH_DB_CONNECTION_DEFAULT)
@@ -452,7 +458,6 @@
*/
private function prepareForUpdateModulesTests()
{
-
$allModules = [
'Foo_One' => [],
'Bar_Two' => [],
@@ -479,7 +484,10 @@
]
];
- $this->config->expects($this->atLeastOnce())->method('isAvailable')->willReturn(true);
+ $this->config->expects($this->atLeastOnce())
+ ->method('get')
+ ->with(ConfigOptionsListConstants::KEY_MODULES)
+ ->willReturn(true);
$newObject = $this->createObject(false, false);
$this->configReader->expects($this->once())->method('load')
--- Magento-CE-2.0.5/vendor/magento/magento2-base/setup/src/Magento/Setup/Test/Unit/Module/ConfigGeneratorTest.php 2016-04-28 06:15:28.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/magento2-base/setup/src/Magento/Setup/Test/Unit/Module/ConfigGeneratorTest.php 2016-05-16 20:18:00.000000000 -0300
@@ -25,13 +25,6 @@
$this->configGeneratorObject = new ConfigGenerator($random, $deployConfig);
}
- public function testCreateInstallConfig()
- {
- $returnValue = $this->configGeneratorObject->createInstallConfig([]);
- $this->assertInstanceOf('Magento\Framework\Config\Data\ConfigData', $returnValue);
- $this->assertEquals(ConfigFilePool::APP_ENV, $returnValue->getFileKey());
- }
-
public function testCreateCryptConfigWithInput()
{
$testData = [ConfigOptionsListConstants::INPUT_KEY_ENCRYPTION_KEY => 'some-test_key'];
@@ -47,6 +40,16 @@
$this->assertEquals(['crypt' => ['key' => md5('key')]], $returnValue->getData());
}
+ /**
+ * @deprecated
+ */
+ public function testCreateInstallConfig()
+ {
+ $returnValue = $this->configGeneratorObject->createInstallConfig([]);
+ $this->assertInstanceOf('Magento\Framework\Config\Data\ConfigData', $returnValue);
+ $this->assertEquals(ConfigFilePool::APP_ENV, $returnValue->getFileKey());
+ }
+
public function testCreateSessionConfigWithInput()
{
$testData = [ConfigOptionsListConstants::INPUT_KEY_SESSION_SAVE => 'files'];
--- Magento-CE-2.0.5/vendor/magento/magento2-base/setup/src/Magento/Setup/Test/Unit/Module/ConfigOptionsListTest.php 2016-04-28 06:15:28.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/magento2-base/setup/src/Magento/Setup/Test/Unit/Module/ConfigOptionsListTest.php 1969-12-31 21:00:00.000000000 -0300
@@ -1,185 +0,0 @@
-<?php
-/**
- * Copyright © 2016 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-
-namespace Magento\Setup\Test\Unit\Module;
-
-use Magento\Setup\Model\ConfigGenerator;
-use Magento\Setup\Model\ConfigOptionsList;
-use Magento\Setup\Validator\DbValidator;
-use Magento\Framework\Config\ConfigOptionsListConstants;
-
-class ConfigOptionsListTest extends \PHPUnit_Framework_TestCase
-{
- /**
- * @var ConfigOptionsList
- */
- private $object;
-
- /**
- * @var ConfigGenerator|\PHPUnit_Framework_MockObject_MockObject
- */
- private $generator;
-
- /**
- * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Framework\App\DeploymentConfig
- */
- private $deploymentConfig;
-
- /**
- * @var DbValidator|\PHPUnit_Framework_MockObject_MockObject
- */
- private $dbValidator;
-
- protected function setUp()
- {
- $this->generator = $this->getMock('Magento\Setup\Model\ConfigGenerator', [], [], '', false);
- $this->deploymentConfig = $this->getMock('Magento\Framework\App\DeploymentConfig', [], [], '', false);
- $this->dbValidator = $this->getMock('Magento\Setup\Validator\DbValidator', [], [], '', false);
- $this->object = new ConfigOptionsList($this->generator, $this->dbValidator);
- }
-
- public function testGetOptions()
- {
- $options = $this->object->getOptions();
- $this->assertInstanceOf('Magento\Framework\Setup\Option\TextConfigOption', $options[0]);
- $this->assertSame('Encryption key', $options[0]->getDescription());
- $this->assertInstanceOf('Magento\Framework\Setup\Option\SelectConfigOption', $options[1]);
- $this->assertSame('Session save handler', $options[1]->getDescription());
- $this->assertInstanceOf('Magento\Framework\Setup\Option\SelectConfigOption', $options[2]);
- $this->assertSame('Type of definitions used by Object Manager', $options[2]->getDescription());
- $this->assertInstanceOf('Magento\Framework\Setup\Option\TextConfigOption', $options[3]);
- $this->assertSame('Database server host', $options[3]->getDescription());
- $this->assertInstanceOf('Magento\Framework\Setup\Option\TextConfigOption', $options[4]);
- $this->assertSame('Database name', $options[4]->getDescription());
- $this->assertInstanceOf('Magento\Framework\Setup\Option\TextConfigOption', $options[5]);
- $this->assertSame('Database server username', $options[5]->getDescription());
- $this->assertInstanceOf('Magento\Framework\Setup\Option\TextConfigOption', $options[6]);
- $this->assertSame('Database server engine', $options[6]->getDescription());
- $this->assertInstanceOf('Magento\Framework\Setup\Option\TextConfigOption', $options[7]);
- $this->assertSame('Database server password', $options[7]->getDescription());
- $this->assertInstanceOf('Magento\Framework\Setup\Option\TextConfigOption', $options[8]);
- $this->assertSame('Database table prefix', $options[8]->getDescription());
- $this->assertInstanceOf('Magento\Framework\Setup\Option\TextConfigOption', $options[9]);
- $this->assertSame('Database type', $options[9]->getDescription());
- $this->assertInstanceOf('Magento\Framework\Setup\Option\TextConfigOption', $options[10]);
- $this->assertSame('Database initial set of commands', $options[10]->getDescription());
- $this->assertInstanceOf('Magento\Framework\Setup\Option\FlagConfigOption', $options[11]);
- $this->assertSame(
- 'If specified, then db connection validation will be skipped',
- $options[11]->getDescription()
- );
- $this->assertInstanceOf('Magento\Framework\Setup\Option\TextConfigOption', $options[12]);
- $this->assertSame('http Cache hosts', $options[12]->getDescription());
- $this->assertEquals(13, count($options));
- }
-
- public function testCreateOptions()
- {
- $configDataMock = $this->getMock('Magento\Framework\Config\Data\ConfigData', [], [], '', false);
- $this->generator->expects($this->once())->method('createInstallConfig')->willReturn($configDataMock);
- $this->generator->expects($this->once())->method('createCryptConfig')->willReturn($configDataMock);
- $this->generator->expects($this->once())->method('createSessionConfig')->willReturn($configDataMock);
- $this->generator->expects($this->once())->method('createDefinitionsConfig')->willReturn($configDataMock);
- $this->generator->expects($this->once())->method('createDbConfig')->willReturn($configDataMock);
- $this->generator->expects($this->once())->method('createResourceConfig')->willReturn($configDataMock);
- $this->generator->expects($this->once())->method('createXFrameConfig')->willReturn($configDataMock);
- $this->generator->expects($this->once())->method('createCacheHostsConfig')->willReturn($configDataMock);
- $configData = $this->object->createConfig([], $this->deploymentConfig);
- $this->assertEquals(9, count($configData));
- }
-
- public function testCreateOptionsWithOptionalNull()
- {
- $configDataMock = $this->getMock('Magento\Framework\Config\Data\ConfigData', [], [], '', false);
- $this->generator->expects($this->once())->method('createInstallConfig')->willReturn($configDataMock);
- $this->generator->expects($this->once())->method('createCryptConfig')->willReturn($configDataMock);
- $this->generator->expects($this->once())->method('createSessionConfig')->willReturn($configDataMock);
- $this->generator->expects($this->once())->method('createDefinitionsConfig')->willReturn(null);
- $this->generator->expects($this->once())->method('createDbConfig')->willReturn($configDataMock);
- $this->generator->expects($this->once())->method('createResourceConfig')->willReturn($configDataMock);
- $this->generator->expects($this->once())->method('createXFrameConfig')->willReturn($configDataMock);
- $this->generator->expects($this->once())->method('createCacheHostsConfig')->willReturn($configDataMock);
- $configData = $this->object->createConfig([], $this->deploymentConfig);
- $this->assertEquals(8, count($configData));
- }
-
- public function testValidateSuccess()
- {
- $options = [
- ConfigOptionsListConstants::INPUT_KEY_DB_PREFIX => 'prefix',
- ConfigOptionsListConstants::INPUT_KEY_SESSION_SAVE => 'files',
- ConfigOptionsListConstants::INPUT_KEY_SKIP_DB_VALIDATION => false,
- ConfigOptionsListConstants::INPUT_KEY_DB_NAME => 'name',
- ConfigOptionsListConstants::INPUT_KEY_DB_HOST => 'host',
- ConfigOptionsListConstants::INPUT_KEY_DB_USER => 'user',
- ConfigOptionsListConstants::INPUT_KEY_DB_PASSWORD => 'pass'
- ];
- $this->prepareValidationMocks();
- $this->assertEquals([], $this->object->validate($options, $this->deploymentConfig));
- }
-
- public function testValidateInvalidSessionHandler()
- {
- $invalidSaveHandler = 'clay-tablet';
-
- $options = [
- ConfigOptionsListConstants::INPUT_KEY_DB_PREFIX => 'prefix',
- ConfigOptionsListConstants::INPUT_KEY_SESSION_SAVE => $invalidSaveHandler,
- ConfigOptionsListConstants::INPUT_KEY_SKIP_DB_VALIDATION => false,
- ConfigOptionsListConstants::INPUT_KEY_DB_NAME => 'name',
- ConfigOptionsListConstants::INPUT_KEY_DB_HOST => 'host',
- ConfigOptionsListConstants::INPUT_KEY_DB_USER => 'user',
- ConfigOptionsListConstants::INPUT_KEY_DB_PASSWORD => 'pass'
- ];
- $this->prepareValidationMocks();
- $this->assertEquals(
- ["Invalid session handler '$invalidSaveHandler'"],
- $this->object->validate($options, $this->deploymentConfig)
- );
- }
-
- private function prepareValidationMocks()
- {
- $configDataMock = $this->getMockBuilder('Magento\Framework\Config\Data\ConfigData')
- ->disableOriginalConstructor()
- ->getMock();
- $this->dbValidator->expects($this->once())->method('checkDatabaseTablePrefix')->willReturn($configDataMock);
- $this->dbValidator->expects($this->once())->method('checkDatabaseConnection')->willReturn($configDataMock);
- }
-
- /**
- * @param string $hosts
- * @param bool $expectedError
- * @dataProvider validateCacheHostsDataProvider
- */
- public function testValidateCacheHosts($hosts, $expectedError)
- {
- $options = [
- ConfigOptionsListConstants::INPUT_KEY_SKIP_DB_VALIDATION => true,
- ConfigOptionsListConstants::INPUT_KEY_CACHE_HOSTS => $hosts
- ];
- $result = $this->object->validate($options, $this->deploymentConfig);
- if ($expectedError) {
- $this->assertCount(1, $result);
- $this->assertEquals("Invalid http cache hosts '$hosts'", $result[0]);
- } else {
- $this->assertCount(0, $result);
- }
-
- }
-
- public function validateCacheHostsDataProvider()
- {
- return [
- ['localhost', false],
- ['122.11.2.34:800', false],
- ['122.11.2.34:800,localhost', false],
- ['website.com:9000', false],
- ['website.com/m2ce:9000', true],
- ['website.com+:9000', true],
- ];
- }
-}
--- Magento-CE-2.0.5/vendor/magento/module-authorizenet/composer.json 2016-04-01 02:09:40.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/module-authorizenet/composer.json 2016-05-16 20:18:04.000000000 -0300
@@ -13,7 +13,7 @@
"magento/framework": "100.0.*"
},
"type": "magento2-module",
- "version": "100.0.5",
+ "version": "100.0.6",
"license": [
"proprietary"
],
--- Magento-CE-2.0.5/vendor/magento/module-authorizenet/Controller/Directpost/Payment/Redirect.php 2016-04-01 02:09:40.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/module-authorizenet/Controller/Directpost/Payment/Redirect.php 2016-05-16 20:18:04.000000000 -0300
@@ -8,7 +8,6 @@
use Magento\Framework\App\ObjectManager;
use Magento\Payment\Block\Transparent\Iframe;
-use Magento\Framework\Escaper;
/**
* Class Redirect
@@ -16,11 +15,6 @@
class Redirect extends \Magento\Authorizenet\Controller\Directpost\Payment
{
/**
- * @var Escaper
- */
- private $escaper;
-
- /**
* Retrieve params and put javascript into iframe
*
* @return void
@@ -29,7 +23,7 @@
{
$helper = $this->dataFactory->create('frontend');
- $redirectParams = $this->filterData($this->getRequest()->getParams());
+ $redirectParams = $this->getRequest()->getParams();
$params = [];
if (!empty($redirectParams['success'])
&& isset($redirectParams['x_invoice_num'])
@@ -38,9 +32,11 @@
$this->_getDirectPostSession()->unsetData('quote_id');
$params['redirect_parent'] = $helper->getSuccessOrderUrl([]);
}
+
if (!empty($redirectParams['error_msg'])) {
$cancelOrder = empty($redirectParams['x_invoice_num']);
$this->_returnCustomerQuote($cancelOrder, $redirectParams['error_msg']);
+ $params['error_msg'] = $redirectParams['error_msg'];
}
if (isset($redirectParams['controller_action_name'])
@@ -50,34 +46,8 @@
unset($params['redirect_parent']);
}
- $this->_coreRegistry->register(Iframe::REGISTRY_KEY, array_merge($params, $redirectParams));
+ $this->_coreRegistry->register(Iframe::REGISTRY_KEY, $params);
$this->_view->addPageLayoutHandles();
$this->_view->loadLayout(false)->renderLayout();
}
-
- /**
- * Escape xss in request data
- * @param array $data
- * @return array
- */
- private function filterData(array $data)
- {
- $self = $this;
- array_walk($data, function (&$item) use ($self) {
- $item = $self->getEscaper()->escapeXssInUrl($item);
- });
- return $data;
- }
-
- /**
- * Get Escaper instance
- * @return Escaper
- */
- private function getEscaper()
- {
- if (!$this->escaper) {
- $this->escaper = ObjectManager::getInstance()->get(Escaper::class);
- }
- return $this->escaper;
- }
}
--- Magento-CE-2.0.5/vendor/magento/module-authorizenet/Test/Unit/Controller/Directpost/Payment/RedirectTest.php 2016-04-01 02:09:40.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/module-authorizenet/Test/Unit/Controller/Directpost/Payment/RedirectTest.php 2016-05-16 20:18:04.000000000 -0300
@@ -8,7 +8,6 @@
use Magento\Authorizenet\Controller\Directpost\Payment\Redirect;
use Magento\Framework\App\RequestInterface;
use Magento\Framework\App\ViewInterface;
-use Magento\Framework\Escaper;
use Magento\Framework\Registry;
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager;
use Magento\Payment\Block\Transparent\Iframe;
@@ -35,11 +34,6 @@
private $coreRegistry;
/**
- * @var Escaper|MockObject
- */
- private $escaper;
-
- /**
* @var Redirect
*/
private $controller;
@@ -57,21 +51,11 @@
->setMethods(['register'])
->getMock();
- $this->escaper = static::getMockBuilder(Escaper::class)
- ->disableOriginalConstructor()
- ->setMethods(['escapeXssInUrl'])
- ->getMock();
-
$this->controller = $objectManager->getObject(Redirect::class, [
'request' => $this->request,
'view' => $this->view,
'coreRegistry' => $this->coreRegistry
]);
-
- $refClass = new \ReflectionClass(Redirect::class);
- $refProperty = $refClass->getProperty('escaper');
- $refProperty->setAccessible(true);
- $refProperty->setValue($this->controller, $this->escaper);
}
/**
@@ -87,14 +71,9 @@
->method('getParams')
->willReturn($params);
- $this->escaper->expects(static::once())
- ->method('escapeXssInUrl')
- ->with($url)
- ->willReturn($url);
-
$this->coreRegistry->expects(static::once())
->method('register')
- ->with(Iframe::REGISTRY_KEY, $params);
+ ->with(Iframe::REGISTRY_KEY, []);
$this->view->expects(static::once())
->method('addPageLayoutHandles');
--- Magento-CE-2.0.5/vendor/magento/module-backend/App/BackendAppList.php 2016-04-28 06:15:04.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/module-backend/App/BackendAppList.php 2016-05-16 20:18:06.000000000 -0300
@@ -44,6 +44,7 @@
if ($appName && isset($this->backendApps[$appName])) {
return $this->backendApps[$appName];
}
+ return null;
}
/**
--- Magento-CE-2.0.5/vendor/magento/module-backend/composer.json 2016-04-28 06:15:04.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/module-backend/composer.json 2016-05-16 20:18:06.000000000 -0300
@@ -21,7 +21,7 @@
"magento/framework": "100.0.*"
},
"type": "magento2-module",
- "version": "100.0.6",
+ "version": "100.0.7",
"license": [
"OSL-3.0",
"AFL-3.0"
--- Magento-CE-2.0.5/vendor/magento/module-backend/Model/Session/AdminConfig.php 2016-04-28 06:15:04.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/module-backend/Model/Session/AdminConfig.php 2016-05-16 20:18:06.000000000 -0300
@@ -14,8 +14,6 @@
/**
* Magento Backend session configuration
- *
- * @method Config setSaveHandler()
*/
class AdminConfig extends Config
{
--- Magento-CE-2.0.5/vendor/magento/module-backup/composer.json 2016-04-01 02:10:40.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/module-backup/composer.json 2016-05-16 20:18:08.000000000 -0300
@@ -9,7 +9,7 @@
"magento/framework": "100.0.*"
},
"type": "magento2-module",
- "version": "100.0.5",
+ "version": "100.0.6",
"license": [
"OSL-3.0",
"AFL-3.0"
--- Magento-CE-2.0.5/vendor/magento/module-backup/Model/Fs/Collection.php 2016-04-01 02:10:40.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/module-backup/Model/Fs/Collection.php 2016-05-16 20:18:08.000000000 -0300
@@ -91,7 +91,6 @@
$filename = '.htaccess';
if (!$this->_varDirectory->isFile($filename)) {
$this->_varDirectory->writeFile($filename, 'deny from all');
- $this->_varDirectory->changePermissions($filename, 0640);
}
}
--- Magento-CE-2.0.5/vendor/magento/module-braintree/composer.json 2016-04-01 02:09:54.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/module-braintree/composer.json 2016-05-16 20:17:52.000000000 -0300
@@ -22,7 +22,7 @@
"magento/module-checkout-agreements": "100.0.*"
},
"type": "magento2-module",
- "version": "100.0.5",
+ "version": "100.0.6",
"license": [
"proprietary"
],
--- Magento-CE-2.0.5/vendor/magento/module-braintree/Model/PaymentMethod/PayPal.php 2016-04-01 02:09:54.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/module-braintree/Model/PaymentMethod/PayPal.php 2016-05-16 20:17:52.000000000 -0300
@@ -10,6 +10,7 @@
use \Braintree_Exception;
use \Braintree_Transaction;
use \Braintree_Result_Successful;
+use Magento\Framework\DataObject;
use Magento\Framework\Exception\LocalizedException;
use Magento\Braintree\Model\PaymentMethod;
use Magento\Payment\Model\InfoInterface;
@@ -152,8 +153,18 @@
*/
public function assignData(\Magento\Framework\DataObject $data)
{
+ $additionalData = $data->getAdditionalData();
+
+ if (!is_array($data->getAdditionalData())) {
+ return $this;
+ }
+ $additionalData = new DataObject($additionalData);
+
$infoInstance = $this->getInfoInstance();
- $infoInstance->setAdditionalInformation('payment_method_nonce', $data->getPaymentMethodNonce());
+ $infoInstance->setAdditionalInformation(
+ 'payment_method_nonce',
+ $additionalData->getData('payment_method_nonce')
+ );
return $this;
}
--- Magento-CE-2.0.5/vendor/magento/module-braintree/Model/PaymentMethod.php 2016-04-01 02:09:54.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/module-braintree/Model/PaymentMethod.php 2016-05-16 20:17:52.000000000 -0300
@@ -10,6 +10,7 @@
use \Braintree_Exception;
use \Braintree_Transaction;
use \Braintree_Result_Successful;
+use Magento\Framework\DataObject;
use Magento\Framework\Exception\LocalizedException;
use Magento\Sales\Model\Order\Payment\Transaction;
use Magento\Sales\Model\ResourceModel\Order\Payment\Transaction\CollectionFactory as TransactionCollectionFactory;
@@ -254,15 +255,29 @@
*/
public function assignData(\Magento\Framework\DataObject $data)
{
- parent::assignData($data);
+ $additionalData = $data->getAdditionalData();
+
+ if (!is_array($data->getAdditionalData())) {
+ return $this;
+ }
+ $additionalData = new DataObject($additionalData);
+
$infoInstance = $this->getInfoInstance();
if ($this->getConfigData('fraudprotection') > 0) {
- $infoInstance->setAdditionalInformation('device_data', $data->getData('device_data'));
+ $infoInstance->setAdditionalInformation('device_data', $additionalData->getData('device_data'));
}
- $infoInstance->setAdditionalInformation('cc_last4', $data->getData('cc_last4'));
- $infoInstance->setAdditionalInformation('cc_token', $data->getCcToken());
- $infoInstance->setAdditionalInformation('payment_method_nonce', $data->getPaymentMethodNonce());
- $infoInstance->setAdditionalInformation('store_in_vault', $data->getStoreInVault());
+
+ $infoInstance->setAdditionalInformation('cc_last4', $additionalData->getData('cc_last4'));
+ $infoInstance->setAdditionalInformation('cc_token', $additionalData->getData('cc_token'));
+ $infoInstance->setAdditionalInformation(
+ 'payment_method_nonce',
+ $additionalData->getData('payment_method_nonce')
+ );
+
+ $infoInstance->setCcLast4($additionalData->getData('cc_last4'));
+ $infoInstance->setCcType($additionalData->getData('cc_type'));
+ $infoInstance->setCcExpMonth($additionalData->getData('cc_exp_month'));
+ $infoInstance->setCcExpYear($additionalData->getData('cc_exp_year'));
return $this;
}
--- Magento-CE-2.0.5/vendor/magento/module-braintree/Test/Unit/Model/PaymentMethod/PayPalTest.php 2016-04-01 02:09:54.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/module-braintree/Test/Unit/Model/PaymentMethod/PayPalTest.php 2016-05-16 20:17:52.000000000 -0300
@@ -230,10 +230,12 @@
$paymentMethodNonce = 'nonce';
$storeInVault = true;
$data = [
+ 'additional_data' => [
'cc_last4' => $ccLast4,
'cc_token' => $ccToken,
'payment_method_nonce' => $paymentMethodNonce,
- 'store_in_vault' => $storeInVault,
+ 'store_in_vault' => $storeInVault
+ ]
];
$data = new \Magento\Framework\DataObject($data);
$this->model->setInfoInstance($this->infoInstanceMock);
--- Magento-CE-2.0.5/vendor/magento/module-braintree/Test/Unit/Model/PaymentMethodTest.php 2016-04-01 02:09:54.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/module-braintree/Test/Unit/Model/PaymentMethodTest.php 2016-05-16 20:17:52.000000000 -0300
@@ -8,6 +8,8 @@
use Magento\Braintree\Model\PaymentMethod;
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper;
+use Magento\Payment\Model\InfoInterface;
+use Magento\Quote\Model\Quote\Payment;
use Magento\Sales\Model\Order\Payment\Transaction;
use \Magento\Sales\Model\ResourceModel\Order\Payment\Transaction\CollectionFactory as TransactionCollectionFactory;
use Magento\Framework\Exception\LocalizedException;
@@ -62,7 +64,7 @@
protected $registryMock;
/**
- * @var \Magento\Payment\Model\InfoInterface|\PHPUnit_Framework_MockObject_MockObject
+ * @var Payment|\PHPUnit_Framework_MockObject_MockObject
*/
protected $infoInstanceMock;
@@ -200,13 +202,9 @@
'orderRepository' => $this->orderRepository
]
);
- $this->infoInstanceMock = $this->getMockForAbstractClass(
- '\Magento\Payment\Model\InfoInterface',
- [],
- '',
- false,
- false,
- false,
+ $this->infoInstanceMock = $this->getMockBuilder(InfoInterface::class)
+ ->disableOriginalConstructor()
+ ->setMethods(
[
'setCcType',
'setCcOwner',
@@ -220,9 +218,9 @@
'setCcSsStartYear',
'getOrder',
'getQuote',
- 'getCcType',
+ 'getCcType'
]
- );
+ )->getMockForAbstractClass();
$this->productMetaDataMock->expects($this->any())
->method('getEdition')
->willReturn('Community Edition');
@@ -234,7 +232,6 @@
public function testAssignData()
{
$ccType = 'VI';
- $ccOwner = 'John Doe';
$ccExpMonth = '10';
$ccExpYear = '2020';
@@ -244,15 +241,16 @@
$storeInVault = true;
$deviceData = 'mobile';
$data = [
+ 'additional_data' => [
'cc_type' => $ccType,
- 'cc_owner' => $ccOwner,
'cc_exp_month' => $ccExpMonth,
'cc_exp_year' => $ccExpYear,
'cc_last4' => $ccLast4,
'cc_token' => $ccToken,
'payment_method_nonce' => $paymentMethodNonce,
'store_in_vault' => $storeInVault,
- 'device_data' => $deviceData,
+ 'device_data' => $deviceData
+ ]
];
$data = new \Magento\Framework\DataObject($data);
$this->model->setInfoInstance($this->infoInstanceMock);
@@ -266,20 +264,8 @@
->with($ccType)
->willReturnSelf();
$this->infoInstanceMock->expects($this->once())
- ->method('setCcOwner')
- ->with($ccOwner)
- ->willReturnSelf();
- $this->infoInstanceMock->expects($this->once())
->method('setCcLast4')
- ->with(false)
- ->willReturnSelf();
- $this->infoInstanceMock->expects($this->once())
- ->method('setCcNumber')
- ->with(null)
- ->willReturnSelf();
- $this->infoInstanceMock->expects($this->once())
- ->method('setCcCid')
- ->with(null)
+ ->with($ccLast4)
->willReturnSelf();
$this->infoInstanceMock->expects($this->once())
->method('setCcExpMonth')
@@ -289,34 +275,19 @@
->method('setCcExpYear')
->with($ccExpYear)
->willReturnSelf();
- $this->infoInstanceMock->expects($this->once())
- ->method('setCcSsIssue')
- ->with(null)
- ->willReturnSelf();
- $this->infoInstanceMock->expects($this->once())
- ->method('setCcSsStartMonth')
- ->with(null)
- ->willReturnSelf();
- $this->infoInstanceMock->expects($this->once())
- ->method('setCcSsStartYear')
- ->with(null)
- ->willReturnSelf();
- $this->infoInstanceMock->expects($this->at(10))
- ->method('setAdditionalInformation')
- ->with('device_data', $deviceData);
- $this->infoInstanceMock->expects($this->at(11))
- ->method('setAdditionalInformation')
- ->with('cc_last4', $ccLast4);
- $this->infoInstanceMock->expects($this->at(12))
- ->method('setAdditionalInformation')
- ->with('cc_token', $ccToken);
- $this->infoInstanceMock->expects($this->at(13))
+ $this->infoInstanceMock->expects($this->atLeastOnce())
->method('setAdditionalInformation')
- ->with('payment_method_nonce', $paymentMethodNonce);
- $this->infoInstanceMock->expects($this->at(14))
- ->method('setAdditionalInformation')
- ->with('store_in_vault', $storeInVault);
+ ->willReturnMap(
+ [
+ ['device_data', $deviceData],
+ ['cc_last4', $ccLast4],
+ ['cc_token', $ccToken],
+ ['payment_method_nonce', $paymentMethodNonce],
+ ['store_in_vault', $storeInVault]
+ ]
+ );
+
$this->model->assignData($data);
}
--- Magento-CE-2.0.5/vendor/magento/module-captcha/composer.json 2016-04-28 06:15:04.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/module-captcha/composer.json 2016-05-16 20:17:50.000000000 -0300
@@ -10,7 +10,7 @@
"magento/framework": "100.0.*"
},
"type": "magento2-module",
- "version": "100.0.6",
+ "version": "100.0.7",
"license": [
"OSL-3.0",
"AFL-3.0"
--- Magento-CE-2.0.5/vendor/magento/module-captcha/Helper/Data.php 2016-04-28 06:15:04.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/module-captcha/Helper/Data.php 2016-05-16 20:17:50.000000000 -0300
@@ -150,8 +150,6 @@
$mediaDir = $this->_filesystem->getDirectoryWrite(DirectoryList::MEDIA);
$captchaDir = '/captcha/' . $this->_getWebsiteCode($website);
$mediaDir->create($captchaDir);
- $mediaDir->changePermissions($captchaDir, DriverInterface::WRITEABLE_DIRECTORY_MODE);
-
return $mediaDir->getAbsolutePath($captchaDir) . '/';
}
--- Magento-CE-2.0.5/vendor/magento/module-catalog/composer.json 2016-04-28 06:15:08.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/module-catalog/composer.json 2016-05-16 20:17:52.000000000 -0300
@@ -34,7 +34,7 @@
"magento/module-catalog-sample-data": "Sample Data version:100.0.*"
},
"type": "magento2-module",
- "version": "100.0.6",
+ "version": "100.0.7",
"license": [
"OSL-3.0",
"AFL-3.0"
--- Magento-CE-2.0.5/vendor/magento/module-catalog/Model/Product/Attribute/Backend/AbstractMedia.php 2016-04-28 06:15:08.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/module-catalog/Model/Product/Attribute/Backend/AbstractMedia.php 2016-05-16 20:17:54.000000000 -0300
@@ -170,9 +170,7 @@
$storageHelper->saveFile($this->mediaConfig->getTmpMediaShortUrl($fileName));
} else {
$this->mediaDirectory->copyFile($file, $destinationFile);
-
$storageHelper->saveFile($this->mediaConfig->getTmpMediaShortUrl($fileName));
- $this->mediaDirectory->changePermissions($destinationFile, DriverInterface::WRITEABLE_FILE_MODE);
}
} catch (\Exception $e) {
throw new LocalizedException(__('We couldn\'t move this file: %1.', $e->getMessage()));
--- Magento-CE-2.0.5/vendor/magento/module-deploy/composer.json 2016-04-01 02:10:10.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/module-deploy/composer.json 2016-05-16 20:17:52.000000000 -0300
@@ -9,7 +9,7 @@
"magento/module-require-js": "100.0.*"
},
"type": "magento2-module",
- "version": "100.0.5",
+ "version": "100.0.6",
"license": [
"OSL-3.0",
"AFL-3.0"
--- Magento-CE-2.0.5/vendor/magento/module-deploy/Model/Filesystem.php 2016-04-01 02:10:10.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/module-deploy/Model/Filesystem.php 2016-05-16 20:17:52.000000000 -0300
@@ -18,11 +18,15 @@
{
/**
* File access permissions
+ *
+ * @deprecated
*/
const PERMISSIONS_FILE = 0640;
/**
* Directory access permissions
+ *
+ * @deprecated
*/
const PERMISSIONS_DIR = 0750;
@@ -107,19 +111,11 @@
DirectoryList::TMP_MATERIALIZATION_DIR
]
);
- $this->changePermissions(
- [
- DirectoryList::STATIC_VIEW
- ],
- self::PERMISSIONS_DIR,
- self::PERMISSIONS_DIR
- );
// Trigger static assets compilation and deployment
$this->deployStaticContent($output);
// Trigger code generation
$this->compile($output);
- $this->lockStaticResources();
}
/**
@@ -215,6 +211,8 @@
* @param int $dirPermissions
* @param int $filePermissions
* @return void
+ *
+ * @deprecated
*/
protected function changePermissions($directoryCodeList, $dirPermissions, $filePermissions)
{
@@ -233,6 +231,8 @@
* Chenge permissions on static resources
*
* @return void
+ *
+ * @deprecated
*/
public function lockStaticResources()
{
--- Magento-CE-2.0.5/vendor/magento/module-deploy/Model/Mode.php 2016-04-01 02:10:10.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/module-deploy/Model/Mode.php 2016-05-16 20:17:52.000000000 -0300
@@ -92,7 +92,6 @@
*/
public function enableProductionModeMinimal()
{
- $this->filesystem->lockStaticResources();
$this->setStoreMode(State::MODE_PRODUCTION);
}
--- Magento-CE-2.0.5/vendor/magento/module-integration/composer.json 2016-04-01 02:09:52.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/module-integration/composer.json 2016-05-16 20:18:10.000000000 -0300
@@ -11,7 +11,7 @@
"magento/module-authorization": "100.0.*"
},
"type": "magento2-module",
- "version": "100.0.5",
+ "version": "100.0.6",
"license": [
"OSL-3.0",
"AFL-3.0"
--- Magento-CE-2.0.5/vendor/magento/module-integration/Model/Oauth/Consumer.php 2016-04-01 02:09:52.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/module-integration/Model/Oauth/Consumer.php 2016-05-16 20:18:10.000000000 -0300
@@ -44,6 +44,11 @@
protected $dataHelper;
/**
+ * @var \Magento\Framework\Stdlib\DateTime\DateTime
+ */
+ private $_dateHelper;
+
+ /**
* @param \Magento\Framework\Model\Context $context
* @param \Magento\Framework\Registry $registry
* @param \Magento\Integration\Model\Oauth\Consumer\Validator\KeyLength $keyLength
@@ -81,6 +86,22 @@
}
/**
+ * The getter function to get the new DateTime dependency
+ *
+ * @return \Magento\Framework\Stdlib\DateTime\DateTime
+ *
+ * @deprecated
+ */
+ private function getDateHelper()
+ {
+ if ($this->_dateHelper === null) {
+ $this->_dateHelper = \Magento\Framework\App\ObjectManager::getInstance()
+ ->get(\Magento\Framework\Stdlib\DateTime\DateTime::class);
+ }
+ return $this->_dateHelper;
+ }
+
+ /**
* BeforeSave actions
*
* @return $this
@@ -176,6 +197,8 @@
public function isValidForTokenExchange()
{
$expiry = $this->dataHelper->getConsumerExpirationPeriod();
- return $expiry > $this->getResource()->getTimeInSecondsSinceCreation($this->getId());
+ $currentTimestamp = $this->getDateHelper()->gmtTimestamp();
+ $updatedTimestamp = $this->getDateHelper()->gmtTimestamp($this->getUpdatedAt());
+ return $expiry > ($currentTimestamp - $updatedTimestamp);
}
}
--- Magento-CE-2.0.5/vendor/magento/module-integration/Model/OauthService.php 2016-04-01 02:09:52.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/module-integration/Model/OauthService.php 2016-05-16 20:18:10.000000000 -0300
@@ -62,6 +62,11 @@
protected $_tokenProvider;
/**
+ * @var \Magento\Framework\Stdlib\DateTime\DateTime
+ */
+ private $_dateHelper;
+
+ /**
* Initialize dependencies.
*
* @param \Magento\Store\Model\StoreManagerInterface $storeManager
@@ -94,6 +99,22 @@
}
/**
+ * The getter function to get the new DateTime dependency
+ *
+ * @return \Magento\Framework\Stdlib\DateTime\DateTime
+ *
+ * @deprecated
+ */
+ private function getDateHelper()
+ {
+ if ($this->_dateHelper === null) {
+ $this->_dateHelper = \Magento\Framework\App\ObjectManager::getInstance()
+ ->get(\Magento\Framework\Stdlib\DateTime\DateTime::class);
+ }
+ return $this->_dateHelper;
+ }
+
+ /**
* {@inheritdoc}
*/
public function createConsumer($consumerData)
@@ -193,6 +214,8 @@
{
try {
$consumer = $this->_consumerFactory->create()->load($consumerId);
+ $consumer->setUpdatedAt($this->getDateHelper()->gmtDate());
+ $consumer->save();
if (!$consumer->getId()) {
throw new \Magento\Framework\Oauth\Exception(
__('A consumer with ID %1 does not exist', $consumerId)
--- Magento-CE-2.0.5/vendor/magento/module-integration/Model/ResourceModel/Oauth/Consumer.php 2016-04-01 02:09:52.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/module-integration/Model/ResourceModel/Oauth/Consumer.php 2016-05-16 20:18:10.000000000 -0300
@@ -45,6 +45,8 @@
/**
* Compute time in seconds since consumer was created.
*
+ * @deprecated
+ *
* @param int $consumerId - The consumer id
* @return int - time lapsed in seconds
*/
--- Magento-CE-2.0.5/vendor/magento/module-integration/Test/Unit/Helper/Oauth/ConsumerTest.php 2016-04-01 02:09:52.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/module-integration/Test/Unit/Helper/Oauth/ConsumerTest.php 2016-05-16 20:18:10.000000000 -0300
@@ -5,6 +5,11 @@
*/
namespace Magento\Integration\Test\Unit\Helper\Oauth;
+/**
+ * Test for \Magento\Integration\Model\Oauth\Consumer
+ *
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ */
class ConsumerTest extends \PHPUnit_Framework_TestCase
{
/** @var \Magento\Store\Model\StoreManagerInterface */
@@ -152,6 +157,16 @@
)->will(
$this->returnSelf()
);
+
+ $dateHelperMock = $this->getMockBuilder('Magento\Framework\Stdlib\DateTime\DateTime')
+ ->disableOriginalConstructor()
+ ->getMock();
+ $dateHelperMock->expects($this->any())->method('gmtDate');
+
+ $dateHelper = new \ReflectionProperty('Magento\Integration\Model\OauthService', '_dateHelper');
+ $dateHelper->setAccessible(true);
+ $dateHelper->setValue($this->_oauthService, $dateHelperMock);
+
$this->_consumerMock->expects($this->once())->method('getId')->will($this->returnValue($consumerId));
$this->_consumerMock->expects($this->once())->method('getData')->will($this->returnValue($consumerData));
$this->_httpClientMock->expects(
--- Magento-CE-2.0.5/vendor/magento/module-integration/Test/Unit/Model/Oauth/ConsumerTest.php 2016-04-01 02:09:52.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/module-integration/Test/Unit/Model/Oauth/ConsumerTest.php 2016-05-16 20:18:10.000000000 -0300
@@ -110,7 +110,7 @@
$this->resourceMock = $this->getMock(
'Magento\Integration\Model\ResourceModel\Oauth\Consumer',
- ['getTimeInSecondsSinceCreation', 'getIdFieldName', 'selectByCompositeKey', 'deleteOldEntries'],
+ ['getIdFieldName', 'selectByCompositeKey', 'deleteOldEntries'],
[],
'',
false,
@@ -215,21 +215,33 @@
public function testGetConsumerExpirationPeriodValid()
{
- $this->resourceMock->expects($this->once())
- ->method('getTimeInSecondsSinceCreation')
- ->will($this->returnValue(30));
+ $dateHelperMock = $this->getMockBuilder('Magento\Framework\Stdlib\DateTime\DateTime')
+ ->disableOriginalConstructor()
+ ->getMock();
+ $dateHelperMock->expects($this->at(0))->method('gmtTimestamp')->willReturn(time());
+ $dateHelperMock->expects($this->at(1))->method('gmtTimestamp')->willReturn(time() - 100);
+
+ $dateHelper = new \ReflectionProperty('Magento\Integration\Model\Oauth\Consumer', '_dateHelper');
+ $dateHelper->setAccessible(true);
+ $dateHelper->setValue($this->consumerModel, $dateHelperMock);
- $this->consumerModel->setCreatedAt(time());
+ $this->consumerModel->setUpdatedAt(time());
$this->assertTrue($this->consumerModel->isValidForTokenExchange());
}
public function testGetConsumerExpirationPeriodExpired()
{
- $this->resourceMock->expects($this->once())
- ->method('getTimeInSecondsSinceCreation')
- ->will($this->returnValue(400));
+ $dateHelperMock = $this->getMockBuilder('Magento\Framework\Stdlib\DateTime\DateTime')
+ ->disableOriginalConstructor()
+ ->getMock();
+ $dateHelperMock->expects($this->at(0))->method('gmtTimestamp')->willReturn(time());
+ $dateHelperMock->expects($this->at(1))->method('gmtTimestamp')->willReturn(time() - 1000);
+
+ $dateHelper = new \ReflectionProperty('Magento\Integration\Model\Oauth\Consumer', '_dateHelper');
+ $dateHelper->setAccessible(true);
+ $dateHelper->setValue($this->consumerModel, $dateHelperMock);
- $this->consumerModel->setCreatedAt(time());
+ $this->consumerModel->setUpdatedAt(time());
$this->assertFalse($this->consumerModel->isValidForTokenExchange());
}
}
--- Magento-CE-2.0.5/vendor/magento/module-offline-payments/composer.json 2016-04-01 02:09:44.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/module-offline-payments/composer.json 2016-05-16 20:17:50.000000000 -0300
@@ -8,7 +8,7 @@
"magento/framework": "100.0.*"
},
"type": "magento2-module",
- "version": "100.0.5",
+ "version": "100.0.6",
"license": [
"OSL-3.0",
"AFL-3.0"
--- Magento-CE-2.0.5/vendor/magento/module-offline-payments/Model/Purchaseorder.php 2016-04-01 02:09:44.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/module-offline-payments/Model/Purchaseorder.php 2016-05-16 20:17:50.000000000 -0300
@@ -47,10 +47,6 @@
*/
public function assignData(\Magento\Framework\DataObject $data)
{
- if (!$data instanceof \Magento\Framework\DataObject) {
- $data = new \Magento\Framework\DataObject($data);
- }
-
$this->getInfoInstance()->setPoNumber($data->getPoNumber());
return $this;
}
--- Magento-CE-2.0.5/vendor/magento/module-page-cache/composer.json 2016-04-01 02:09:58.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/module-page-cache/composer.json 2016-05-16 20:18:20.000000000 -0300
@@ -9,7 +9,7 @@
"magento/framework": "100.0.*"
},
"type": "magento2-module",
- "version": "100.0.5",
+ "version": "100.0.6",
"license": [
"OSL-3.0",
"AFL-3.0"
--- Magento-CE-2.0.5/vendor/magento/module-page-cache/Model/Cache/Server.php 2016-04-01 02:09:58.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/module-page-cache/Model/Cache/Server.php 2016-05-16 20:18:20.000000000 -0300
@@ -5,16 +5,17 @@
*/
namespace Magento\PageCache\Model\Cache;
-use Zend\Uri\Uri;
+use Magento\Framework\UrlInterface;
use Magento\Framework\App\DeploymentConfig;
use Magento\Framework\Config\ConfigOptionsListConstants;
use Magento\Framework\App\RequestInterface;
+use Zend\Uri\Uri;
use Zend\Uri\UriFactory;
class Server
{
/**
- * @var \Magento\Framework\UrlInterface
+ * @var UrlInterface
*/
protected $urlBuilder;
@@ -33,12 +34,12 @@
/**
* Constructor
*
- * @param \Magento\Framework\UrlInterface $urlBuilder
+ * @param UrlInterface $urlBuilder
* @param DeploymentConfig $config
* @param RequestInterface $request
*/
public function __construct(
- \Magento\Framework\UrlInterface $urlBuilder,
+ UrlInterface $urlBuilder,
DeploymentConfig $config,
RequestInterface $request
) {
@@ -56,21 +57,25 @@
{
$servers = [];
$configuredHosts = $this->config->get(ConfigOptionsListConstants::CONFIG_PATH_CACHE_HOSTS);
- if (null == $configuredHosts) {
- $httpHost = $this->request->getHttpHost();
- $servers[] = $httpHost ?
- UriFactory::factory('')->setHost($httpHost)->setPort(self::DEFAULT_PORT)->setScheme('http') :
- UriFactory::factory($this->urlBuilder->getUrl('*', ['_nosid' => true])) // Don't use SID in building URL
- ->setScheme('http')
- ->setPath(null)
- ->setQuery(null);
- } else {
+ if (is_array($configuredHosts)) {
foreach ($configuredHosts as $host) {
- $servers[] = UriFactory::factory('')->setHost($host['host'])
- ->setPort(isset($host['port']) ? $host['port'] : self::DEFAULT_PORT)
- ->setScheme('http');
+ $servers[] = UriFactory::factory('')
+ ->setHost($host['host'])
+ ->setPort(isset($host['port']) ? $host['port'] : self::DEFAULT_PORT);
}
+ } elseif ($this->request->getHttpHost()) {
+ $servers[] = UriFactory::factory('')
+ ->setHost($this->request->getHttpHost())
+ ->setPort(self::DEFAULT_PORT);
+ } else {
+ $servers[] = UriFactory::factory($this->urlBuilder->getUrl('*', ['_nosid' => true]));
+ }
+
+ foreach (array_keys($servers) as $key) {
+ $servers[$key]->setScheme('http')
+ ->setPath('/')
+ ->setQuery(null);
}
return $servers;
}
--- Magento-CE-2.0.5/vendor/magento/module-page-cache/Test/Unit/Model/Cache/ServerTest.php 2016-04-01 02:09:58.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/module-page-cache/Test/Unit/Model/Cache/ServerTest.php 2016-05-16 20:18:20.000000000 -0300
@@ -5,11 +5,13 @@
*/
namespace Magento\PageCache\Test\Unit\Model\Cache;
+use \Magento\Framework\TestFramework\Unit\Helper\ObjectManager;
+use \Magento\PageCache\Model\Cache\Server;
use \Zend\Uri\UriFactory;
class ServerTest extends \PHPUnit_Framework_TestCase
{
- /** @var \Magento\PageCache\Model\Cache\Server */
+ /** @var Server */
protected $model;
/** @var \PHPUnit_Framework_MockObject_MockObject | \Magento\Framework\App\DeploymentConfig */
@@ -30,7 +32,7 @@
->disableOriginalConstructor()
->getMock();
- $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
+ $objectManager = new ObjectManager($this);
$this->model = $objectManager->getObject(
'Magento\PageCache\Model\Cache\Server',
[
@@ -56,12 +58,9 @@
$url,
$hostConfig = null
) {
- $this->configMock->expects($this->once())
- ->method('get')
- ->willReturn($hostConfig);
- $this->requestMock->expects($this->exactly($getHttpHostCallCtr))
- ->method('getHttpHost')
- ->willReturn($httpHost);
+ $this->configMock->expects($this->once())->method('get')->willReturn($hostConfig);
+ $this->requestMock->expects($this->exactly($getHttpHostCallCtr))->method('getHttpHost')->willReturn($httpHost);
+
$this->urlBuilderMock->expects($this->exactly($getUrlCallCtr))
->method('getUrl')
->with('*', ['_nosid' => true])
@@ -70,20 +69,22 @@
$uris = [];
if (null === $hostConfig) {
if (!empty($httpHost)) {
- $uris[] = UriFactory::factory('')->setHost($httpHost)
- ->setPort(\Magento\PageCache\Model\Cache\Server::DEFAULT_PORT)
- ->setScheme('http');
+ $uris[] = UriFactory::factory('')->setHost($httpHost)->setPort(Server::DEFAULT_PORT);
}
if (!empty($url)) {
$uris[] = UriFactory::factory($url);
}
} else {
foreach ($hostConfig as $host) {
- $port = isset($host['port']) ? $host['port'] : \Magento\PageCache\Model\Cache\Server::DEFAULT_PORT;
- $uris[] = UriFactory::factory('')->setHost($host['host'])
- ->setPort($port)
- ->setScheme('http');
+ $port = isset($host['port']) ? $host['port'] : Server::DEFAULT_PORT;
+ $uris[] = UriFactory::factory('')->setHost($host['host'])->setPort($port);
+ }
}
+
+ foreach (array_keys($uris) as $key) {
+ $uris[$key]->setScheme('http')
+ ->setPath('/')
+ ->setQuery(null);
}
$this->assertEquals($uris, $this->model->getUris());
@@ -92,8 +93,8 @@
public function getUrisDataProvider()
{
return [
- 'http host' => [1, '127.0.0.1', 0, '',],
- 'url' => [1, '', 1, 'http://host',],
+ 'http host' => [2, '127.0.0.1', 0, ''],
+ 'url' => [1, '', 1, 'http://host'],
'config' => [
0,
'',
--- Magento-CE-2.0.5/vendor/magento/module-payment/composer.json 2016-04-01 02:09:44.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/module-payment/composer.json 2016-05-16 20:18:14.000000000 -0300
@@ -12,7 +12,7 @@
"magento/framework": "100.0.*"
},
"type": "magento2-module",
- "version": "100.0.5",
+ "version": "100.0.6",
"license": [
"OSL-3.0",
"AFL-3.0"
--- Magento-CE-2.0.5/vendor/magento/module-payment/Model/Info.php 2016-04-01 02:09:44.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/module-payment/Model/Info.php 2016-05-16 20:18:14.000000000 -0300
@@ -217,9 +217,6 @@
{
$additionalInfo = $this->_getData('additional_information');
if (empty($this->_additionalInformation) && $additionalInfo) {
- if (!is_array($additionalInfo)) {
- $additionalInfo = unserialize($additionalInfo);
- }
$this->_additionalInformation = $additionalInfo;
}
}
--- Magento-CE-2.0.5/vendor/magento/module-payment/Model/Method/AbstractMethod.php 2016-04-01 02:09:44.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/module-payment/Model/Method/AbstractMethod.php 2016-05-16 20:18:14.000000000 -0300
@@ -20,6 +20,7 @@
* @SuppressWarnings(PHPMD.ExcessivePublicCount)
* @SuppressWarnings(PHPMD.TooManyFields)
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @deprecated
*/
abstract class AbstractMethod extends \Magento\Framework\Model\AbstractExtensibleModel implements
MethodInterface,
@@ -765,14 +766,10 @@
* @return $this
* @throws \Magento\Framework\Exception\LocalizedException
* @api
+ * @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
public function assignData(\Magento\Framework\DataObject $data)
{
- if (is_array($data)) {
- $this->getInfoInstance()->addData($data);
- } elseif ($data instanceof \Magento\Framework\DataObject) {
- $this->getInfoInstance()->addData($data->getData());
- }
return $this;
}
--- Magento-CE-2.0.5/vendor/magento/module-payment/Model/Method/Adapter.php 2016-04-01 02:09:44.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/module-payment/Model/Method/Adapter.php 2016-05-16 20:18:14.000000000 -0300
@@ -612,7 +612,6 @@
]
);
- $this->getInfoInstance()->addData($data->getData());
return $this;
}
--- Magento-CE-2.0.5/vendor/magento/module-payment/Test/Unit/Model/InfoTest.php 2016-04-01 02:09:44.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/module-payment/Test/Unit/Model/InfoTest.php 2016-05-16 20:18:14.000000000 -0300
@@ -90,7 +90,6 @@
];
}
-
public function testGetMethodInstanceWithRealMethod()
{
$method = 'real_method';
@@ -108,7 +107,6 @@
$this->info->getMethodInstance();
}
-
public function testGetMethodInstanceWithUnrealMethod()
{
$method = 'unreal_method';
@@ -131,7 +129,6 @@
$this->info->getMethodInstance();
}
-
/**
* @expectedException \Magento\Framework\Exception\LocalizedException
* @expectedExceptionMessage The payment method you requested is not available.
@@ -142,7 +139,6 @@
$this->info->getMethodInstance();
}
-
public function testGetMethodInstanceRequestedMethod()
{
$code = 'real_method';
@@ -251,9 +247,9 @@
public function testInitAdditionalInformationWithUnserialize()
{
- $data = serialize(['key1' => 'data1', 'key2' => 'data2']);
+ $data = ['key1' => 'data1', 'key2' => 'data2'];
$this->info->setData('additional_information', $data);
- $this->assertEquals(unserialize($data), $this->info->getAdditionalInformation());
+ $this->assertEquals($data, $this->info->getAdditionalInformation());
}
}
--- Magento-CE-2.0.5/vendor/magento/module-payment/Test/Unit/Model/Method/AbstractMethodTest.php 2016-04-01 02:09:44.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/module-payment/Test/Unit/Model/Method/AbstractMethodTest.php 2016-05-16 20:18:14.000000000 -0300
@@ -5,6 +5,9 @@
*/
namespace Magento\Payment\Test\Unit\Model\Method;
+use Magento\Framework\DataObject;
+use Magento\Payment\Model\InfoInterface;
+use Magento\Payment\Observer\AbstractDataAssignObserver;
use Magento\Store\Model\ScopeInterface;
use Magento\Payment\Test\Unit\Model\Method\AbstractMethod\Stub;
@@ -65,7 +68,7 @@
$helper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
$this->payment = $helper->getObject(
- 'Magento\Payment\Test\Unit\Model\Method\AbstractMethod\Stub',
+ Stub::class,
[
'scopeConfig' => $this->scopeConfigMock,
'context' => $contextMock,
--- Magento-CE-2.0.5/vendor/magento/module-paypal/composer.json 2016-04-01 02:09:58.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/module-paypal/composer.json 2016-05-16 20:18:08.000000000 -0300
@@ -24,7 +24,7 @@
"magento/module-checkout-agreements": "100.0.*"
},
"type": "magento2-module",
- "version": "100.0.5",
+ "version": "100.0.6",
"license": [
"proprietary"
],
--- Magento-CE-2.0.5/vendor/magento/module-paypal/Model/Express.php 2016-04-01 02:09:58.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/module-paypal/Model/Express.php 2016-05-16 20:18:08.000000000 -0300
@@ -8,6 +8,7 @@
use Magento\Paypal\Model\Api\Nvp;
use Magento\Paypal\Model\Api\ProcessableException as ApiProcessableException;
use Magento\Paypal\Model\Express\Checkout as ExpressCheckout;
+use Magento\Quote\Api\Data\PaymentInterface;
use Magento\Sales\Api\Data\OrderPaymentInterface;
use Magento\Sales\Model\Order\Payment;
use Magento\Sales\Model\Order\Payment\Transaction;
@@ -666,14 +667,24 @@
*/
public function assignData(\Magento\Framework\DataObject $data)
{
- $result = parent::assignData($data);
- $key = ExpressCheckout::PAYMENT_INFO_TRANSPORT_BILLING_AGREEMENT;
- if (is_array($data)) {
- $this->getInfoInstance()->setAdditionalInformation($key, isset($data[$key]) ? $data[$key] : null);
- } elseif ($data instanceof \Magento\Framework\DataObject) {
- $this->getInfoInstance()->setAdditionalInformation($key, $data->getData($key));
+ parent::assignData($data);
+
+ $additionalData = $data->getData(PaymentInterface::KEY_ADDITIONAL_DATA);
+
+ if (
+ !is_array($additionalData)
+ || !isset($additionalData[ExpressCheckout::PAYMENT_INFO_TRANSPORT_BILLING_AGREEMENT])
+ ) {
+ return $this;
}
- return $result;
+
+ $this->getInfoInstance()
+ ->setAdditionalInformation(
+ ExpressCheckout::PAYMENT_INFO_TRANSPORT_BILLING_AGREEMENT,
+ $additionalData[ExpressCheckout::PAYMENT_INFO_TRANSPORT_BILLING_AGREEMENT]
+ );
+
+ return $this;
}
/**
--- Magento-CE-2.0.5/vendor/magento/module-paypal/Model/Payment/Method/Billing/AbstractAgreement.php 2016-04-01 02:09:58.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/module-paypal/Model/Payment/Method/Billing/AbstractAgreement.php 2016-05-16 20:18:08.000000000 -0300
@@ -5,6 +5,9 @@
*/
namespace Magento\Paypal\Model\Payment\Method\Billing;
+use Magento\Paypal\Model\Billing\Agreement;
+use Magento\Quote\Api\Data\PaymentInterface;
+
/**
* Billing Agreement Payment Method Abstract model
*
@@ -110,29 +113,29 @@
*/
public function assignData(\Magento\Framework\DataObject $data)
{
- $result = parent::assignData($data);
+ parent::assignData($data);
+
+ $additionalData = $data->getData(PaymentInterface::KEY_ADDITIONAL_DATA);
+ if (!is_array($additionalData) || !isset($additionalData[self::TRANSPORT_BILLING_AGREEMENT_ID])) {
+ return $this;
+ }
- $key = self::TRANSPORT_BILLING_AGREEMENT_ID;
- $id = false;
- if (is_array($data) && isset($data[$key])) {
- $id = $data[$key];
- } elseif ($data instanceof \Magento\Framework\DataObject && $data->getData($key)) {
- $id = $data->getData($key);
+ $id = $additionalData[self::TRANSPORT_BILLING_AGREEMENT_ID];
+ if (!$id || !is_numeric($id)) {
+ return $this;
}
- if ($id) {
+
$info = $this->getInfoInstance();
- $ba = $this->_agreementFactory->create()->load($id);
+ /** @var Agreement $ba */
+ $ba = $this->_agreementFactory->create();
+ $ba->load($id);
+
if ($ba->getId() && $ba->getCustomerId() == $info->getQuote()->getCustomerId()) {
- $info->setAdditionalInformation(
- $key,
- $id
- )->setAdditionalInformation(
- self::PAYMENT_INFO_REFERENCE_ID,
- $ba->getReferenceId()
- );
+ $info->setAdditionalInformation(self::TRANSPORT_BILLING_AGREEMENT_ID, $id);
+ $info->setAdditionalInformation(self::PAYMENT_INFO_REFERENCE_ID, $ba->getReferenceId());
}
- }
- return $result;
+
+ return $this;
}
/**
--- Magento-CE-2.0.5/vendor/magento/module-paypal/Test/Unit/Model/ExpressTest.php 2016-04-01 02:09:58.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/module-paypal/Test/Unit/Model/ExpressTest.php 2016-05-16 20:18:08.000000000 -0300
@@ -5,7 +5,13 @@
*/
namespace Magento\Paypal\Test\Unit\Model;
+use Magento\Framework\DataObject;
+use Magento\Framework\Event\ManagerInterface;
+use Magento\Payment\Model\InfoInterface;
+use Magento\Payment\Observer\AbstractDataAssignObserver;
use Magento\Paypal\Model\Api\ProcessableException as ApiProcessableException;
+use Magento\Paypal\Model\Express;
+use Magento\Quote\Api\Data\PaymentInterface;
class ExpressTest extends \PHPUnit_Framework_TestCase
{
@@ -54,6 +60,11 @@
*/
protected $transactionBuilder;
+ /**
+ * @var ManagerInterface|\PHPUnit_Framework_MockObject_MockObject
+ */
+ private $eventManagerMock;
+
protected function setUp()
{
$this->_checkoutSession = $this->getMock(
@@ -78,24 +89,28 @@
false
);
$this->_pro = $this->getMock(
- 'Magento\Paypal\Model\ProFactory',
- ['create', 'setMethod', 'getApi', 'importPaymentInfo', 'resetApi'],
+ 'Magento\Paypal\Model\Pro',
+ ['setMethod', 'getApi', 'importPaymentInfo', 'resetApi'],
[],
'',
false
);
- $this->_pro->expects($this->any())->method('create')->will($this->returnSelf());
+ $this->eventManagerMock = $this->getMockBuilder(ManagerInterface::class)
+ ->setMethods(['dispatch'])
+ ->getMockForAbstractClass();
+
+ $this->_pro->expects($this->any())->method('getApi')->will($this->returnValue($this->_nvp));
$this->_helper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
}
public function testSetApiProcessableErrors()
{
$this->_nvp->expects($this->once())->method('setProcessableErrors')->with($this->errorCodes);
- $this->_pro->expects($this->any())->method('getApi')->will($this->returnValue($this->_nvp));
+
$this->_model = $this->_helper->getObject(
'Magento\Paypal\Model\Express',
[
- 'proFactory' => $this->_pro,
+ 'data' => [$this->_pro],
'checkoutSession' => $this->_checkoutSession,
'transactionBuilder' => $this->transactionBuilder
]
@@ -109,7 +124,7 @@
$this->_nvp->expects($this->any())->method('setCurrencyCode')->will($this->returnSelf());
$this->_nvp->expects($this->any())->method('setTransactionId')->will($this->returnSelf());
$this->_nvp->expects($this->any())->method('callDoAuthorization')->will($this->returnSelf());
- $this->_pro->expects($this->any())->method('getApi')->will($this->returnValue($this->_nvp));
+
$this->_checkoutSession->expects($this->once())->method('getPaypalTransactionData')->will(
$this->returnValue([])
);
@@ -147,11 +162,46 @@
$this->_model = $this->_helper->getObject(
'Magento\Paypal\Model\Express',
[
- 'proFactory' => $this->_pro,
+ 'data' => [$this->_pro],
'checkoutSession' => $this->_checkoutSession,
'transactionBuilder' => $this->transactionBuilder
]
);
$this->assertEquals($this->_model, $this->_model->order($paymentModel, 12.3));
}
+
+ public function testAssignData()
+ {
+ $transportValue = 'something';
+
+ $data = new DataObject(
+ [
+ PaymentInterface::KEY_ADDITIONAL_DATA => [
+ Express\Checkout::PAYMENT_INFO_TRANSPORT_BILLING_AGREEMENT => $transportValue
+ ]
+ ]
+ );
+
+ $this->_model = $this->_helper->getObject(
+ 'Magento\Paypal\Model\Express',
+ [
+ 'data' => [$this->_pro],
+ 'checkoutSession' => $this->_checkoutSession,
+ 'transactionBuilder' => $this->transactionBuilder,
+ 'eventDispatcher' => $this->eventManagerMock,
+ ]
+ );
+
+ $paymentInfo = $this->getMock(InfoInterface::class);
+ $this->_model->setInfoInstance($paymentInfo);
+
+ $paymentInfo->expects(static::once())
+ ->method('setAdditionalInformation')
+ ->with(
+ Express\Checkout::PAYMENT_INFO_TRANSPORT_BILLING_AGREEMENT,
+ $transportValue
+ );
+
+ $this->_model->assignData($data);
+ }
}
--- Magento-CE-2.0.5/vendor/magento/module-paypal/Test/Unit/Model/Payment/Method/Billing/AbstractAgreementStub.php 1969-12-31 21:00:00.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/module-paypal/Test/Unit/Model/Payment/Method/Billing/AbstractAgreementStub.php 2016-05-16 20:18:08.000000000 -0300
@@ -0,0 +1,31 @@
+<?php
+/**
+ * Copyright © 2016 Magento. All rights reserved.
+ * See COPYING.txt for license details.
+ */
+namespace Magento\Paypal\Test\Unit\Model\Payment\Method\Billing;
+
+use Magento\Paypal\Model\Payment\Method\Billing\AbstractAgreement;
+
+class AbstractAgreementStub extends AbstractAgreement
+{
+ const STUB_CODE = 'stub-code';
+
+ /**
+ * @return string
+ */
+ public function getCode()
+ {
+ return static::STUB_CODE;
+ }
+
+ /**
+ * @param object $quote
+ * @return bool
+ * @SuppressWarnings(PHPMD.UnusedFormalParameter)
+ */
+ protected function _isAvailable($quote)
+ {
+ return false;
+ }
+}
--- Magento-CE-2.0.5/vendor/magento/module-paypal/Test/Unit/Model/Payment/Method/Billing/AbstractAgreementTest.php 1969-12-31 21:00:00.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/module-paypal/Test/Unit/Model/Payment/Method/Billing/AbstractAgreementTest.php 2016-05-16 20:18:08.000000000 -0300
@@ -0,0 +1,107 @@
+<?php
+/**
+ * Copyright © 2016 Magento. All rights reserved.
+ * See COPYING.txt for license details.
+ */
+namespace Magento\Paypal\Test\Unit\Model\Payment\Method\Billing;
+
+use Magento\Framework\DataObject;
+use Magento\Framework\TestFramework\Unit\Helper\ObjectManager;
+use Magento\Paypal\Model\Billing\Agreement;
+use Magento\Paypal\Model\Payment\Method\Billing\AbstractAgreement;
+use Magento\Quote\Api\Data\PaymentInterface;
+use Magento\Quote\Model\Quote;
+use Magento\Quote\Model\Quote\Payment;
+
+class AbstractAgreementTest extends \PHPUnit_Framework_TestCase
+{
+ /**
+ * @var \Magento\Paypal\Model\Billing\AgreementFactory|\PHPUnit_Framework_MockObject_MockObject
+ */
+ private $agreementFactory;
+
+ /**
+ * @var AbstractAgreementStub
+ */
+ private $payment;
+
+ public function setUp()
+ {
+ $helper = new ObjectManager($this);
+
+ $this->agreementFactory = $this->getMockBuilder('Magento\Paypal\Model\Billing\AgreementFactory')
+ ->disableOriginalConstructor()
+ ->setMethods(['create'])
+ ->getMock();
+ $this->payment = $helper->getObject(
+ AbstractAgreementStub::class,
+ [
+ 'agreementFactory' => $this->agreementFactory
+ ]
+ );
+ }
+ public function testAssignData()
+ {
+ $baId = '1678235';
+ $customerId = 67;
+ $referenceId = '1234124';
+
+ $data = new DataObject(
+ [
+ PaymentInterface::KEY_ADDITIONAL_DATA => [
+ AbstractAgreement::TRANSPORT_BILLING_AGREEMENT_ID => $baId
+ ]
+ ]
+ );
+
+ $paymentInfo = $this->getMockBuilder(Payment::class)
+ ->disableOriginalConstructor()
+ ->getMock();
+ $quote = $this->getMockBuilder(Quote::class)
+ ->disableOriginalConstructor()
+ ->setMethods(['__wakeup', 'getCustomerId'])
+ ->getMock();
+
+ $this->payment->setInfoInstance($paymentInfo);
+
+ $agreementModel = $this->getMockBuilder(Agreement::class)
+ ->disableOriginalConstructor()
+ ->setMethods(['__wakeup', 'load', 'getCustomerId', 'getId', 'getReferenceId'])
+ ->getMock();
+
+ $this->agreementFactory->expects(static::once())
+ ->method('create')
+ ->willReturn($agreementModel);
+
+ $paymentInfo->expects(static::once())
+ ->method('getQuote')
+ ->willReturn($quote);
+
+ $agreementModel->expects(static::once())
+ ->method('load')
+ ->with($baId);
+ $agreementModel->expects(static::once())
+ ->method('getId')
+ ->willReturn($baId);
+ $agreementModel->expects(static::atLeastOnce())
+ ->method('getCustomerId')
+ ->willReturn($customerId);
+ $agreementModel->expects(static::atLeastOnce())
+ ->method('getReferenceId')
+ ->willReturn($referenceId);
+
+ $quote->expects(static::once())
+ ->method('getCustomerId')
+ ->willReturn($customerId);
+
+ $paymentInfo->expects(static::exactly(2))
+ ->method('setAdditionalInformation')
+ ->willReturnMap(
+ [
+ AbstractAgreement::TRANSPORT_BILLING_AGREEMENT_ID, $baId,
+ AbstractAgreement::PAYMENT_INFO_REFERENCE_ID, $referenceId
+ ]
+ );
+ $this->payment->assignData($data);
+ }
+}
--- Magento-CE-2.0.5/vendor/magento/module-quote/composer.json 2016-04-01 02:09:54.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/module-quote/composer.json 2016-05-16 20:17:52.000000000 -0300
@@ -20,7 +20,7 @@
"magento/framework": "100.0.*"
},
"type": "magento2-module",
- "version": "100.0.5",
+ "version": "100.0.6",
"license": [
"OSL-3.0",
"AFL-3.0"
--- Magento-CE-2.0.5/vendor/magento/module-quote/Model/PaymentMethodManagement.php 2016-04-01 02:09:54.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/module-quote/Model/PaymentMethodManagement.php 2016-05-16 20:17:52.000000000 -0300
@@ -61,10 +61,6 @@
$payment = $quote->getPayment();
$data = $method->getData();
- if (isset($data['additional_data'])) {
- $data = array_merge($data, (array)$data['additional_data']);
- unset($data['additional_data']);
- }
$payment->importData($data);
if ($quote->isVirtual()) {
--- Magento-CE-2.0.5/vendor/magento/module-quote/Model/Quote/Payment.php 2016-04-01 02:09:54.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/module-quote/Model/Quote/Payment.php 2016-05-16 20:17:52.000000000 -0300
@@ -5,6 +5,8 @@
*/
namespace Magento\Quote\Model\Quote;
+use Magento\Quote\Api\Data\PaymentInterface;
+
/**
* Quote payment information
*
@@ -143,6 +145,7 @@
*/
public function importData(array $data)
{
+ $data = $this->convertPaymentData($data);
$data = new \Magento\Framework\DataObject($data);
$this->_eventManager->dispatch(
$this->_eventPrefix . '_import_data_before',
@@ -175,6 +178,37 @@
}
/**
+ * Converts request to payment data
+ *
+ * @param array $rawData
+ * @return array
+ */
+ private function convertPaymentData(array $rawData)
+ {
+ $paymentData = [
+ PaymentInterface::KEY_METHOD => null,
+ PaymentInterface::KEY_PO_NUMBER => null,
+ PaymentInterface::KEY_ADDITIONAL_DATA => [],
+ 'checks' => []
+ ];
+
+ foreach (array_keys($rawData) as $requestKey) {
+ if (!array_key_exists($requestKey, $paymentData)) {
+ $paymentData[PaymentInterface::KEY_ADDITIONAL_DATA][$requestKey] = $rawData[$requestKey];
+ } elseif ($requestKey === PaymentInterface::KEY_ADDITIONAL_DATA) {
+ $paymentData[PaymentInterface::KEY_ADDITIONAL_DATA] = array_merge(
+ $paymentData[PaymentInterface::KEY_ADDITIONAL_DATA],
+ (array) $rawData[$requestKey]
+ );
+ } else {
+ $paymentData[$requestKey] = $rawData[$requestKey];
+ }
+ }
+
+ return $paymentData;
+ }
+
+ /**
* Prepare object for save
*
* @return $this
@@ -223,7 +257,7 @@
public function getMethodInstance()
{
$method = parent::getMethodInstance();
- $method->setStore($this->getQuote()->getStore()->getStoreId());
+ $method->setStore($this->getQuote()->getStoreId());
return $method;
}
--- Magento-CE-2.0.5/vendor/magento/module-quote/Model/QuoteManagement.php 2016-04-01 02:09:54.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/module-quote/Model/QuoteManagement.php 2016-05-16 20:17:52.000000000 -0300
@@ -21,6 +21,8 @@
use Magento\Sales\Api\OrderManagementInterface as OrderManagement;
use Magento\Store\Model\StoreManagerInterface;
use Magento\Quote\Model\Quote\Address;
+use Magento\Framework\App\ObjectManager;
+use Magento\Quote\Model\QuoteIdMaskFactory;
/**
* Class QuoteManagement
@@ -131,6 +133,11 @@
protected $quoteFactory;
/**
+ * @var QuoteIdMaskFactory
+ */
+ private $quoteIdMaskFactory;
+
+ /**
* @param EventManager $eventManager
* @param QuoteValidator $quoteValidator
* @param OrderFactory $orderFactory
@@ -262,6 +269,12 @@
$quote->setCustomer($customer);
$quote->setCustomerIsGuest(0);
+ $quoteIdMaskFactory = $this->getQuoteIdMaskFactory();
+ /** @var \Magento\Quote\Model\QuoteIdMask $quoteIdMask */
+ $quoteIdMask = $quoteIdMaskFactory->create()->load($cartId, 'quote_id');
+ if ($quoteIdMask->getId()) {
+ $quoteIdMask->delete();
+ }
$this->quoteRepository->save($quote);
return true;
@@ -547,4 +560,16 @@
$shipping->setIsDefaultBilling(true);
}
}
+
+ /**
+ * @return QuoteIdMaskFactory
+ * @deprecated
+ */
+ private function getQuoteIdMaskFactory()
+ {
+ if (!$this->quoteIdMaskFactory) {
+ $this->quoteIdMaskFactory = ObjectManager::getInstance()->get(QuoteIdMaskFactory::class);
+ }
+ return $this->quoteIdMaskFactory;
+ }
}
--- Magento-CE-2.0.5/vendor/magento/module-quote/Test/Unit/Model/PaymentMethodManagementTest.php 2016-04-01 02:09:54.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/module-quote/Test/Unit/Model/PaymentMethodManagementTest.php 2016-05-16 20:17:52.000000000 -0300
@@ -16,6 +16,7 @@
* @var \Magento\Framework\TestFramework\Unit\Helper\ObjectManager
*/
protected $objectManager;
+
/**
* @var \PHPUnit_Framework_MockObject_MockObject
*/
@@ -111,7 +112,7 @@
$cartId = 100;
$paymentId = 200;
$methodDataWithAdditionalData = ['method' => 'data', 'additional_data' => ['additional' => 'value']];
- $methodData = ['method' => 'data', 'additional' => 'value'];
+ $methodData = $methodDataWithAdditionalData;
$paymentMethod = 'checkmo';
$quoteMock = $this->getMock(
--- Magento-CE-2.0.5/vendor/magento/module-quote/Test/Unit/Model/Quote/PaymentTest.php 2016-04-01 02:09:54.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/module-quote/Test/Unit/Model/Quote/PaymentTest.php 2016-05-16 20:17:52.000000000 -0300
@@ -5,6 +5,13 @@
*/
namespace Magento\Quote\Test\Unit\Model\Quote;
+use Magento\Framework\DataObject;
+use Magento\Framework\Event\ManagerInterface;
+use Magento\Payment\Model\Checks\Composite;
+use Magento\Payment\Model\Checks\SpecificationFactory;
+use Magento\Payment\Model\MethodInterface;
+use Magento\Quote\Api\Data\PaymentInterface;
+use Magento\Quote\Model\Quote;
use \Magento\Quote\Model\Quote\Payment;
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager;
@@ -16,11 +23,31 @@
*/
private $model;
+ /**
+ * @var \PHPUnit_Framework_MockObject_MockObject|SpecificationFactory
+ */
+ private $specificationFactory;
+
+ /**
+ * @var \PHPUnit_Framework_MockObject_MockObject|ManagerInterface
+ */
+ private $eventManager;
+
protected function setUp()
{
$objectManager = new ObjectManager($this);
+ $this->specificationFactory = $this->getMockBuilder(
+ SpecificationFactory::class
+ )->disableOriginalConstructor()
+ ->getMock();
+ $this->eventManager = $this->getMock(ManagerInterface::class);
+
$this->model = $objectManager->getObject(
- '\Magento\Quote\Model\Quote\Payment'
+ Payment::class,
+ [
+ 'methodSpecificationFactory' => $this->specificationFactory,
+ 'eventDispatcher' => $this->eventManager
+ ]
);
}
@@ -32,7 +59,7 @@
public function testGetCcExpYearReturnsValidValue($databaseValue, $expectedValue)
{
$this->model->setData('cc_exp_year', $databaseValue);
- $this->assertEquals($expectedValue, $this->model->getCcExpYear());
+ static::assertEquals($expectedValue, $this->model->getCcExpYear());
}
/**
@@ -47,4 +74,141 @@
[1939, 1939],
];
}
+
+ /**
+ * @param array $data
+ * @param array $convertedData
+ * @param array $dataToAssign
+ * @param array $checks
+ * @dataProvider importDataPositiveCheckDataProvider
+ */
+ public function testImportDataPositiveCheck(
+ array $data,
+ array $convertedData,
+ array $dataToAssign,
+ array $checks
+ ) {
+ $quoteId = 1;
+ $storeId = 1;
+
+ $paymentMethod = $this->getMock(MethodInterface::class);
+ $quote = $this->getMockBuilder(Quote::class)
+ ->disableOriginalConstructor()
+ ->getMock();
+ $methodSpecification = $this->getMockBuilder(Composite::class)
+ ->disableOriginalConstructor()
+ ->getMock();
+
+ $quote->expects(static::once())
+ ->method('getId')
+ ->willReturn($quoteId);
+
+ $this->model->setQuote($quote);
+ $this->model->setMethodInstance($paymentMethod);
+ $this->eventManager->expects(static::once())
+ ->method('dispatch')
+ ->with(
+ 'sales_quote_payment_import_data_before',
+ [
+ 'payment' => $this->model,
+ 'input' => new DataObject($convertedData)
+ ]
+ );
+ $quote->expects(static::once())
+ ->method('getStoreId')
+ ->willReturn($storeId);
+
+ $quote->expects(static::once())
+ ->method('collectTotals');
+
+ $this->specificationFactory->expects(static::once())
+ ->method('create')
+ ->with($checks)
+ ->willReturn($methodSpecification);
+
+ $paymentMethod->expects(static::once())
+ ->method('isAvailable')
+ ->with($quote)
+ ->willReturn(true);
+ $methodSpecification->expects(static::once())
+ ->method('isApplicable')
+ ->with($paymentMethod, $quote)
+ ->willReturn(true);
+
+ $paymentMethod->expects(static::once())
+ ->method('assignData')
+ ->with(new DataObject($dataToAssign));
+ $paymentMethod->expects(static::once())
+ ->method('validate');
+
+ $this->model->importData($data);
+ }
+
+ /**
+ * @return array
+ */
+ public function importDataPositiveCheckDataProvider()
+ {
+ return [
+ [
+ [
+ PaymentInterface::KEY_METHOD => 'payment_method_code',
+ 'cc_number' => '1111',
+ 'cc_type' => 'VI',
+ 'cc_owner' => 'John Doe'
+ ],
+ [
+ PaymentInterface::KEY_METHOD => 'payment_method_code',
+ PaymentInterface::KEY_PO_NUMBER => null,
+ PaymentInterface::KEY_ADDITIONAL_DATA => [
+ 'cc_number' => '1111',
+ 'cc_type' => 'VI',
+ 'cc_owner' => 'John Doe'
+ ],
+ 'checks' => []
+ ],
+ [
+ PaymentInterface::KEY_METHOD => 'payment_method_code',
+ PaymentInterface::KEY_PO_NUMBER => null,
+ PaymentInterface::KEY_ADDITIONAL_DATA => [
+ 'cc_number' => '1111',
+ 'cc_type' => 'VI',
+ 'cc_owner' => 'John Doe'
+ ],
+ 'checks' => []
+ ],
+ []
+ ],
+ [
+ [
+ PaymentInterface::KEY_METHOD => 'payment_method_code',
+ 'cc_number' => '1111',
+ 'cc_type' => 'VI',
+ 'cc_owner' => 'John Doe',
+ 'checks' => ['check_code1', 'check_code2']
+ ],
+ [
+ PaymentInterface::KEY_METHOD => 'payment_method_code',
+ PaymentInterface::KEY_PO_NUMBER => null,
+ PaymentInterface::KEY_ADDITIONAL_DATA => [
+ 'cc_number' => '1111',
+ 'cc_type' => 'VI',
+ 'cc_owner' => 'John Doe'
+ ],
+ 'checks' => ['check_code1', 'check_code2']
+ ],
+ [
+ PaymentInterface::KEY_METHOD => 'payment_method_code',
+ PaymentInterface::KEY_PO_NUMBER => null,
+ PaymentInterface::KEY_ADDITIONAL_DATA => [
+ 'cc_number' => '1111',
+ 'cc_type' => 'VI',
+ 'cc_owner' => 'John Doe'
+ ],
+ 'checks' => ['check_code1', 'check_code2']
+ ],
+ ['check_code1', 'check_code2']
+ ]
+ ];
+ }
}
--- Magento-CE-2.0.5/vendor/magento/module-quote/Test/Unit/Model/QuoteManagementTest.php 2016-04-01 02:09:54.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/module-quote/Test/Unit/Model/QuoteManagementTest.php 2016-05-16 20:17:52.000000000 -0300
@@ -127,6 +127,11 @@
protected $quoteFactoryMock;
/**
+ * @var \PHPUnit_Framework_MockObject_MockObject
+ */
+ private $quoteIdMock;
+
+ /**
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
*/
protected function setUp()
@@ -238,7 +243,6 @@
);
$this->quoteFactoryMock = $this->getMock('\Magento\Quote\Model\QuoteFactory', ['create'], [], '', false);
-
$this->model = $objectManager->getObject(
'\Magento\Quote\Model\QuoteManagement',
[
@@ -264,6 +268,12 @@
'quoteFactory' => $this->quoteFactoryMock
]
);
+
+ // Set the new dependency
+ $this->quoteIdMock = $this->getMock('Magento\Quote\Model\QuoteIdMask', [], [], '', false);
+ $quoteIdFactoryMock = $this->getMock(\Magento\Quote\Model\QuoteIdMaskFactory::class, ['create'], [], '', false);
+ $this->setPropertyValue($this->model, 'quoteIdMaskFactory', $quoteIdFactoryMock);
+
}
public function testCreateEmptyCartAnonymous()
@@ -508,6 +518,13 @@
$customerId = 455;
$storeId = 5;
+ $this->getPropertyValue($this->model, 'quoteIdMaskFactory')
+ ->expects($this->once())
+ ->method('create')
+ ->willReturn($this->quoteIdMock);
+ $this->quoteIdMock->expects($this->once())->method('load')->with($cartId, 'quote_id')->willReturnSelf();
+ $this->quoteIdMock->expects($this->once())->method('getId')->willReturn(10);
+ $this->quoteIdMock->expects($this->once())->method('delete');
$quoteMock = $this->getMock(
'\Magento\Quote\Model\Quote',
['getCustomerId', 'setCustomer', 'setCustomerIsGuest'],
@@ -979,4 +996,37 @@
->willReturn($cartMock);
$this->assertEquals($cartMock, $this->model->getCartForCustomer($customerId));
}
+
+ /**
+ * Get any object property value.
+ *
+ * @param $object
+ * @param $property
+ * @return mixed
+ */
+ protected function getPropertyValue($object, $property)
+ {
+ $reflection = new \ReflectionClass(get_class($object));
+ $reflectionProperty = $reflection->getProperty($property);
+ $reflectionProperty->setAccessible(true);
+
+ return $reflectionProperty->getValue($object);
+ }
+
+ /**
+ * Set object property value.
+ *
+ * @param $object
+ * @param $property
+ * @param $value
+ */
+ protected function setPropertyValue(&$object, $property, $value)
+ {
+ $reflection = new \ReflectionClass(get_class($object));
+ $reflectionProperty = $reflection->getProperty($property);
+ $reflectionProperty->setAccessible(true);
+ $reflectionProperty->setValue($object, $value);
+
+ return $object;
+ }
}
--- Magento-CE-2.0.5/vendor/magento/module-sales/composer.json 2016-04-28 06:15:20.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/module-sales/composer.json 2016-05-16 20:18:22.000000000 -0300
@@ -32,7 +32,7 @@
"magento/module-sales-sample-data": "Sample Data version:100.0.*"
},
"type": "magento2-module",
- "version": "100.0.6",
+ "version": "100.0.7",
"license": [
"OSL-3.0",
"AFL-3.0"
--- Magento-CE-2.0.5/vendor/magento/module-sales/Model/Order/Payment/Info.php 2016-04-28 06:15:20.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/module-sales/Model/Order/Payment/Info.php 2016-05-16 20:18:22.000000000 -0300
@@ -223,9 +223,6 @@
{
$additionalInfo = $this->getData('additional_information');
if (empty($this->additionalInformation) && $additionalInfo) {
- if (!is_array($additionalInfo)) {
- $additionalInfo = unserialize($additionalInfo);
- }
$this->additionalInformation = $additionalInfo;
}
}
--- Magento-CE-2.0.5/vendor/magento/module-sales/Test/Unit/Model/Order/Payment/InfoTest.php 2016-04-28 06:15:20.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/module-sales/Test/Unit/Model/Order/Payment/InfoTest.php 2016-05-16 20:18:22.000000000 -0300
@@ -90,7 +90,6 @@
];
}
-
public function testGetMethodInstanceWithRealMethod()
{
$method = 'real_method';
@@ -108,7 +107,6 @@
$this->info->getMethodInstance();
}
-
public function testGetMethodInstanceWithUnrealMethod()
{
$method = 'unreal_method';
@@ -131,7 +129,6 @@
$this->info->getMethodInstance();
}
-
/**
* @expectedException \Magento\Framework\Exception\LocalizedException
* @expectedExceptionMessage The payment method you requested is not available.
@@ -253,9 +250,9 @@
public function testInitAdditionalInformationWithUnserialize()
{
- $data = serialize(['key1' => 'data1', 'key2' => 'data2']);
+ $data = ['key1' => 'data1', 'key2' => 'data2'];
$this->info->setData('additional_information', $data);
- $this->assertEquals(unserialize($data), $this->info->getAdditionalInformation());
+ $this->assertEquals($data, $this->info->getAdditionalInformation());
}
}
--- Magento-CE-2.0.5/vendor/magento/module-webapi/composer.json 2016-04-01 02:09:58.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/module-webapi/composer.json 2016-05-16 20:18:08.000000000 -0300
@@ -13,7 +13,7 @@
"magento/module-user": "100.0.*"
},
"type": "magento2-module",
- "version": "100.0.5",
+ "version": "100.0.6",
"license": [
"OSL-3.0",
"AFL-3.0"
--- Magento-CE-2.0.5/vendor/magento/module-webapi/Controller/Soap/Request/Handler.php 2016-04-01 02:09:58.000000000 -0300
+++ Magento-CE-2.0.6/vendor/magento/module-webapi/Controller/Soap/Request/Handler.php 2016-05-16 20:18:08.000000000 -0300
@@ -107,10 +107,10 @@
throw new WebapiException(__("Operation allowed only in HTTPS"));
}
- $isAllowed = false;
- foreach ($serviceMethodInfo[ServiceMetadata::KEY_ACL_RESOURCES] as $resource) {
- if ($this->_authorization->isAllowed($resource)) {
$isAllowed = true;
+ foreach ($serviceMethodInfo[ServiceMetadata::KEY_ACL_RESOURCES] as $resource) {
+ if (!$this->_authorization->isAllowed($resource)) {
+ $isAllowed = false;
break;
}
}
--- Magento-CE-2.0.5/vendor/phpunit/php-timer/composer.json 2015-06-21 05:01:12.000000000 -0300
+++ Magento-CE-2.0.6/vendor/phpunit/php-timer/composer.json 2016-05-12 15:03:57.000000000 -0300
@@ -21,9 +21,13 @@
"require": {
"php": ">=5.3.3"
},
+ "require-dev": {
+ "phpunit/phpunit": "~4|~5"
+ },
"autoload": {
"classmap": [
"src/"
]
}
}
+
--- Magento-CE-2.0.5/vendor/phpunit/php-timer/.gitignore 2015-06-21 05:01:12.000000000 -0300
+++ Magento-CE-2.0.6/vendor/phpunit/php-timer/.gitignore 2016-05-12 15:03:57.000000000 -0300
@@ -1,7 +1,3 @@
-build/api
-build/code-browser
-build/coverage
-build/logs
-build/pdepend
-cache.properties
-phpunit.xml
+/vendor
+/composer.lock
+
--- Magento-CE-2.0.5/vendor/phpunit/php-timer/README.md 2015-06-21 05:01:12.000000000 -0300
+++ Magento-CE-2.0.6/vendor/phpunit/php-timer/README.md 2016-05-12 15:03:57.000000000 -0300
@@ -44,4 +44,4 @@
The code above yields the output below:
- Time: 0 ms, Memory: 0.50Mb
+ Time: 0 ms, Memory: 0.50MB
--- Magento-CE-2.0.5/vendor/phpunit/php-timer/src/Timer.php 2015-06-21 05:01:12.000000000 -0300
+++ Magento-CE-2.0.6/vendor/phpunit/php-timer/src/Timer.php 2016-05-12 15:03:57.000000000 -0300
@@ -91,7 +91,7 @@
public static function resourceUsage()
{
return sprintf(
- 'Time: %s, Memory: %4.2fMb',
+ 'Time: %s, Memory: %4.2fMB',
self::timeSinceStartOfRequest(),
memory_get_peak_usage(true) / 1048576
);
--- Magento-CE-2.0.5/vendor/phpunit/php-timer/tests/TimerTest.php 2015-06-21 05:01:12.000000000 -0300
+++ Magento-CE-2.0.6/vendor/phpunit/php-timer/tests/TimerTest.php 2016-05-12 15:03:57.000000000 -0300
@@ -54,7 +54,7 @@
public function testResourceUsage()
{
$this->assertStringMatchesFormat(
- 'Time: %s, Memory: %s',
+ 'Time: %s, Memory: %fMB',
PHP_Timer::resourceUsage()
);
}
--- Magento-CE-2.0.5/vendor/phpunit/php-timer/.travis.yml 2015-06-21 05:01:12.000000000 -0300
+++ Magento-CE-2.0.6/vendor/phpunit/php-timer/.travis.yml 2016-05-12 15:03:57.000000000 -0300
@@ -6,10 +6,18 @@
- 5.4
- 5.5
- 5.6
+ - 7.0
+ - nightly
- hhvm
+before_install:
+ - composer self-update
+
+install:
+ - travis_retry composer install --no-interaction --prefer-source
+
script:
- - phpunit --bootstrap src/Timer.php tests
+ - ./vendor/bin/phpunit --bootstrap src/Timer.php tests
notifications:
email: false
--- Magento-CE-2.0.5/vendor/sebastian/environment/src/Runtime.php 2016-02-26 15:40:46.000000000 -0300
+++ Magento-CE-2.0.6/vendor/sebastian/environment/src/Runtime.php 2016-05-04 04:59:13.000000000 -0300
@@ -123,7 +123,7 @@
if ($this->isHHVM()) {
return 'http://hhvm.com/';
} else {
- return 'http://php.net/';
+ return 'https://secure.php.net/';
}
}
--- Magento-CE-2.0.5/vendor/symfony/config/Tests/Util/XmlUtilsTest.php 2016-03-04 04:54:35.000000000 -0300
+++ Magento-CE-2.0.6/vendor/symfony/config/Tests/Util/XmlUtilsTest.php 2016-04-20 15:52:26.000000000 -0300
@@ -9,7 +9,7 @@
* file that was distributed with this source code.
*/
-namespace Symfony\Component\Config\Tests\Loader;
+namespace Symfony\Component\Config\Tests\Util;
use Symfony\Component\Config\Util\XmlUtils;
--- Magento-CE-2.0.5/vendor/symfony/dependency-injection/Alias.php 2016-03-21 04:27:21.000000000 -0300
+++ Magento-CE-2.0.6/vendor/symfony/dependency-injection/Alias.php 2016-05-09 15:12:35.000000000 -0300
@@ -17,8 +17,6 @@
private $public;
/**
- * Constructor.
- *
* @param string $id Alias identifier
* @param bool $public If this alias is public
*/
--- Magento-CE-2.0.5/vendor/symfony/dependency-injection/Compiler/AnalyzeServiceReferencesPass.php 2016-03-21 04:27:21.000000000 -0300
+++ Magento-CE-2.0.6/vendor/symfony/dependency-injection/Compiler/AnalyzeServiceReferencesPass.php 2016-05-09 15:12:35.000000000 -0300
@@ -34,8 +34,6 @@
private $onlyConstructorArguments;
/**
- * Constructor.
- *
* @param bool $onlyConstructorArguments Sets this Service Reference pass to ignore method calls
*/
public function __construct($onlyConstructorArguments = false)
--- Magento-CE-2.0.5/vendor/symfony/dependency-injection/Compiler/AutowirePass.php 2016-03-21 04:27:21.000000000 -0300
+++ Magento-CE-2.0.6/vendor/symfony/dependency-injection/Compiler/AutowirePass.php 2016-05-09 15:12:35.000000000 -0300
@@ -34,12 +34,21 @@
*/
public function process(ContainerBuilder $container)
{
+ $throwingAutoloader = function ($class) { throw new \ReflectionException(sprintf('Class %s does not exist', $class)); };
+ spl_autoload_register($throwingAutoloader);
+
+ try {
$this->container = $container;
foreach ($container->getDefinitions() as $id => $definition) {
if ($definition->isAutowired()) {
$this->completeDefinition($id, $definition);
}
}
+ } catch (\Error $e) {
+ } catch (\Exception $e) {
+ }
+
+ spl_autoload_unregister($throwingAutoloader);
// Free memory and remove circular reference to container
$this->container = null;
@@ -47,6 +56,10 @@
$this->definedTypes = array();
$this->types = null;
$this->notGuessableTypes = array();
+
+ if (isset($e)) {
+ throw $e;
+ }
}
/**
@@ -92,7 +105,7 @@
$this->populateAvailableTypes();
}
- if (isset($this->types[$typeHint->name])) {
+ if (isset($this->types[$typeHint->name]) && !isset($this->notGuessableTypes[$typeHint->name])) {
$value = new Reference($this->types[$typeHint->name]);
} else {
try {
@@ -107,11 +120,11 @@
}
}
}
- } catch (\ReflectionException $reflectionException) {
+ } catch (\ReflectionException $e) {
// Typehint against a non-existing class
if (!$parameter->isDefaultValueAvailable()) {
- throw new RuntimeException(sprintf('Cannot autowire argument %s for %s because the type-hinted class does not exist (%s).', $index + 1, $definition->getClass(), $reflectionException->getMessage()), 0, $reflectionException);
+ throw new RuntimeException(sprintf('Cannot autowire argument %s for %s because the type-hinted class does not exist (%s).', $index + 1, $definition->getClass(), $e->getMessage()), 0, $e);
}
$value = $parameter->getDefaultValue();
@@ -177,22 +190,26 @@
*/
private function set($type, $id)
{
- if (isset($this->definedTypes[$type]) || isset($this->notGuessableTypes[$type])) {
+ if (isset($this->definedTypes[$type])) {
+ return;
+ }
+
+ if (!isset($this->types[$type])) {
+ $this->types[$type] = $id;
+
return;
}
- if (isset($this->types[$type])) {
if ($this->types[$type] === $id) {
return;
}
- unset($this->types[$type]);
+ if (!isset($this->notGuessableTypes[$type])) {
$this->notGuessableTypes[$type] = true;
-
- return;
+ $this->types[$type] = (array) $this->types[$type];
}
- $this->types[$type] = $id;
+ $this->types[$type][] = $id;
}
/**
@@ -207,8 +224,14 @@
*/
private function createAutowiredDefinition(\ReflectionClass $typeHint, $id)
{
- if (isset($this->notGuessableTypes[$typeHint->name]) || !$typeHint->isInstantiable()) {
- throw new RuntimeException(sprintf('Unable to autowire argument of type "%s" for the service "%s".', $typeHint->name, $id));
+ if (isset($this->notGuessableTypes[$typeHint->name])) {
+ throw new RuntimeException(sprintf('Unable to autowire argument of type "%s" for the service "%s". Several services implementing this type have been declared: "%s".', $typeHint->name, $id, implode('", "', $this->types[$typeHint->name])));
+ }
+
+ $noAvailableDefinitionMessage = sprintf('Unable to autowire argument of type "%s" for the service "%s". This type cannot be instantiated automatically and no service implementing this type is declared.', $typeHint->name, $id);
+
+ if (!$typeHint->isInstantiable()) {
+ throw new RuntimeException($noAvailableDefinitionMessage);
}
$argumentId = sprintf('autowired.%s', $typeHint->name);
@@ -217,7 +240,12 @@
$argumentDefinition->setPublic(false);
$this->populateAvailableType($argumentId, $argumentDefinition);
+
+ try {
$this->completeDefinition($argumentId, $argumentDefinition);
+ } catch (RuntimeException $e) {
+ throw new RuntimeException($noAvailableDefinitionMessage, 0, $e);
+ }
return new Reference($argumentId);
}
@@ -228,7 +256,7 @@
* @param string $id
* @param Definition $definition
*
- * @return \ReflectionClass|null
+ * @return \ReflectionClass|false
*/
private function getReflectionClass($id, Definition $definition)
{
@@ -238,15 +266,17 @@
// Cannot use reflection if the class isn't set
if (!$class = $definition->getClass()) {
- return;
+ return false;
}
$class = $this->container->getParameterBag()->resolveValue($class);
try {
- return $this->reflectionClasses[$id] = new \ReflectionClass($class);
- } catch (\ReflectionException $reflectionException) {
- // return null
+ $reflector = new \ReflectionClass($class);
+ } catch (\ReflectionException $e) {
+ $reflector = false;
}
+
+ return $this->reflectionClasses[$id] = $reflector;
}
}
--- Magento-CE-2.0.5/vendor/symfony/dependency-injection/Compiler/Compiler.php 2016-03-21 04:27:21.000000000 -0300
+++ Magento-CE-2.0.6/vendor/symfony/dependency-injection/Compiler/Compiler.php 2016-05-09 15:12:35.000000000 -0300
@@ -25,9 +25,6 @@
private $loggingFormatter;
private $serviceReferenceGraph;
- /**
- * Constructor.
- */
public function __construct()
{
$this->passConfig = new PassConfig();
--- Magento-CE-2.0.5/vendor/symfony/dependency-injection/Compiler/PassConfig.php 2016-03-21 04:27:21.000000000 -0300
+++ Magento-CE-2.0.6/vendor/symfony/dependency-injection/Compiler/PassConfig.php 2016-05-09 15:12:35.000000000 -0300
@@ -35,9 +35,6 @@
private $optimizationPasses;
private $removingPasses;
- /**
- * Constructor.
- */
public function __construct()
{
$this->mergePass = new MergeExtensionConfigurationPass();
@@ -58,8 +55,8 @@
$this->removingPasses = array(
new RemovePrivateAliasesPass(),
- new RemoveAbstractDefinitionsPass(),
new ReplaceAliasByActualDefinitionPass(),
+ new RemoveAbstractDefinitionsPass(),
new RepeatedPass(array(
new AnalyzeServiceReferencesPass(),
new InlineServiceDefinitionsPass(),
@@ -102,8 +99,7 @@
throw new InvalidArgumentException(sprintf('Invalid type "%s".', $type));
}
- $passes = &$this->$property;
- $passes[] = $pass;
+ $this->{$property}[] = $pass;
}
/**
--- Magento-CE-2.0.5/vendor/symfony/dependency-injection/Compiler/RepeatedPass.php 2016-03-21 04:27:21.000000000 -0300
+++ Magento-CE-2.0.6/vendor/symfony/dependency-injection/Compiler/RepeatedPass.php 2016-05-09 15:12:35.000000000 -0300
@@ -32,8 +32,6 @@
private $passes;
/**
- * Constructor.
- *
* @param RepeatablePassInterface[] $passes An array of RepeatablePassInterface objects
*
* @throws InvalidArgumentException when the passes don't implement RepeatablePassInterface
--- Magento-CE-2.0.5/vendor/symfony/dependency-injection/Compiler/ReplaceAliasByActualDefinitionPass.php 2016-03-21 04:27:21.000000000 -0300
+++ Magento-CE-2.0.6/vendor/symfony/dependency-injection/Compiler/ReplaceAliasByActualDefinitionPass.php 2016-05-09 15:12:35.000000000 -0300
@@ -25,7 +25,6 @@
{
private $compiler;
private $formatter;
- private $sourceId;
/**
* Process the Container to replace aliases with service definitions.
@@ -36,114 +35,110 @@
*/
public function process(ContainerBuilder $container)
{
+ // Setup
$this->compiler = $container->getCompiler();
$this->formatter = $this->compiler->getLoggingFormatter();
-
- foreach ($container->getAliases() as $id => $alias) {
- $aliasId = (string) $alias;
-
+ // First collect all alias targets that need to be replaced
+ $seenAliasTargets = array();
+ $replacements = array();
+ foreach ($container->getAliases() as $definitionId => $target) {
+ $targetId = (string) $target;
+ // Special case: leave this target alone
+ if ('service_container' === $targetId) {
+ continue;
+ }
+ // Check if target needs to be replaces
+ if (isset($replacements[$targetId])) {
+ $container->setAlias($definitionId, $replacements[$targetId]);
+ }
+ // No neeed to process the same target twice
+ if (isset($seenAliasTargets[$targetId])) {
+ continue;
+ }
+ // Process new target
+ $seenAliasTargets[$targetId] = true;
try {
- $definition = $container->getDefinition($aliasId);
+ $definition = $container->getDefinition($targetId);
} catch (InvalidArgumentException $e) {
- throw new InvalidArgumentException(sprintf('Unable to replace alias "%s" with actual definition "%s".', $id, $alias), null, $e);
+ throw new InvalidArgumentException(sprintf('Unable to replace alias "%s" with actual definition "%s".', $definitionId, $targetId), null, $e);
}
-
if ($definition->isPublic()) {
continue;
}
-
+ // Remove private definition and schedule for replacement
$definition->setPublic(true);
- $container->setDefinition($id, $definition);
- $container->removeDefinition($aliasId);
-
- $this->updateReferences($container, $aliasId, $id);
-
- // we have to restart the process due to concurrent modification of
- // the container
- $this->process($container);
-
- break;
- }
- }
-
- /**
- * Updates references to remove aliases.
- *
- * @param ContainerBuilder $container The container
- * @param string $currentId The alias identifier being replaced
- * @param string $newId The id of the service the alias points to
- */
- private function updateReferences($container, $currentId, $newId)
- {
- foreach ($container->getAliases() as $id => $alias) {
- if ($currentId === (string) $alias) {
- $container->setAlias($id, $newId);
- }
+ $container->setDefinition($definitionId, $definition);
+ $container->removeDefinition($targetId);
+ $replacements[$targetId] = $definitionId;
}
- foreach ($container->getDefinitions() as $id => $definition) {
- $this->sourceId = $id;
-
- $definition->setArguments(
- $this->updateArgumentReferences($definition->getArguments(), $currentId, $newId)
- );
-
- $definition->setMethodCalls(
- $this->updateArgumentReferences($definition->getMethodCalls(), $currentId, $newId)
- );
-
- $definition->setProperties(
- $this->updateArgumentReferences($definition->getProperties(), $currentId, $newId)
- );
-
- $definition->setFactoryService($this->updateFactoryServiceReference($definition->getFactoryService(false), $currentId, $newId), false);
- $definition->setFactory($this->updateFactoryReference($definition->getFactory(), $currentId, $newId));
+ // Now replace target instances in all definitions
+ foreach ($container->getDefinitions() as $definitionId => $definition) {
+ $definition->setArguments($this->updateArgumentReferences($replacements, $definitionId, $definition->getArguments()));
+ $definition->setMethodCalls($this->updateArgumentReferences($replacements, $definitionId, $definition->getMethodCalls()));
+ $definition->setProperties($this->updateArgumentReferences($replacements, $definitionId, $definition->getProperties()));
+ $definition->setFactoryService($this->updateFactoryReferenceId($replacements, $definition->getFactoryService(false)), false);
+ $definition->setFactory($this->updateFactoryReference($replacements, $definition->getFactory()));
}
}
/**
- * Updates argument references.
+ * Recursively updates references in an array.
*
- * @param array $arguments An array of Arguments
- * @param string $currentId The alias identifier
- * @param string $newId The identifier the alias points to
+ * @param array $replacements Table of aliases to replace
+ * @param string $definitionId Identifier of this definition
+ * @param array $arguments Where to replace the aliases
*
* @return array
*/
- private function updateArgumentReferences(array $arguments, $currentId, $newId)
+ private function updateArgumentReferences(array $replacements, $definitionId, array $arguments)
{
foreach ($arguments as $k => $argument) {
+ // Handle recursion step
if (is_array($argument)) {
- $arguments[$k] = $this->updateArgumentReferences($argument, $currentId, $newId);
- } elseif ($argument instanceof Reference) {
- if ($currentId === (string) $argument) {
- $arguments[$k] = new Reference($newId, $argument->getInvalidBehavior());
- $this->compiler->addLogMessage($this->formatter->formatUpdateReference($this, $this->sourceId, $currentId, $newId));
+ $arguments[$k] = $this->updateArgumentReferences($replacements, $definitionId, $argument);
+ continue;
+ }
+ // Skip arguments that don't need replacement
+ if (!$argument instanceof Reference) {
+ continue;
}
+ $referenceId = (string) $argument;
+ if (!isset($replacements[$referenceId])) {
+ continue;
}
+ // Perform the replacement
+ $newId = $replacements[$referenceId];
+ $arguments[$k] = new Reference($newId, $argument->getInvalidBehavior());
+ $this->compiler->addLogMessage($this->formatter->formatUpdateReference($this, $definitionId, $referenceId, $newId));
}
return $arguments;
}
- private function updateFactoryServiceReference($factoryService, $currentId, $newId)
+ /**
+ * Returns the updated reference for the factory service.
+ *
+ * @param array $replacements Table of aliases to replace
+ * @param string|null $referenceId Factory service reference identifier
+ *
+ * @return string|null
+ */
+ private function updateFactoryReferenceId(array $replacements, $referenceId)
{
- if (null === $factoryService) {
+ if (null === $referenceId) {
return;
}
- return $currentId === $factoryService ? $newId : $factoryService;
+ return isset($replacements[$referenceId]) ? $replacements[$referenceId] : $referenceId;
}
- private function updateFactoryReference($factory, $currentId, $newId)
+ private function updateFactoryReference(array $replacements, $factory)
{
- if (null === $factory || !is_array($factory) || !$factory[0] instanceof Reference) {
- return $factory;
+ if (is_array($factory) && $factory[0] instanceof Reference && isset($replacements[$referenceId = (string) $factory[0]])) {
+ $factory[0] = new Reference($replacements[$referenceId], $factory[0]->getInvalidBehavior());
}
- if ($currentId === (string) $factory[0]) {
- $factory[0] = new Reference($newId, $factory[0]->getInvalidBehavior());
- }
return $factory;
}
--- Magento-CE-2.0.5/vendor/symfony/dependency-injection/Compiler/ResolveDefinitionTemplatesPass.php 2016-03-21 04:27:21.000000000 -0300
+++ Magento-CE-2.0.6/vendor/symfony/dependency-injection/Compiler/ResolveDefinitionTemplatesPass.php 2016-05-09 15:12:35.000000000 -0300
@@ -174,7 +174,7 @@
if (null === $decoratedService) {
$def->setDecoratedService($decoratedService);
} else {
- $def->setDecoratedService($decoratedService[0], $decoratedService[1]);
+ $def->setDecoratedService($decoratedService[0], $decoratedService[1], $decoratedService[2]);
}
}
--- Magento-CE-2.0.5/vendor/symfony/dependency-injection/Compiler/ServiceReferenceGraphEdge.php 2016-03-21 04:27:21.000000000 -0300
+++ Magento-CE-2.0.6/vendor/symfony/dependency-injection/Compiler/ServiceReferenceGraphEdge.php 2016-05-09 15:12:35.000000000 -0300
@@ -25,8 +25,6 @@
private $value;
/**
- * Constructor.
- *
* @param ServiceReferenceGraphNode $sourceNode
* @param ServiceReferenceGraphNode $destNode
* @param string $value
--- Magento-CE-2.0.5/vendor/symfony/dependency-injection/Compiler/ServiceReferenceGraphNode.php 2016-03-21 04:27:21.000000000 -0300
+++ Magento-CE-2.0.6/vendor/symfony/dependency-injection/Compiler/ServiceReferenceGraphNode.php 2016-05-09 15:12:35.000000000 -0300
@@ -29,8 +29,6 @@
private $value;
/**
- * Constructor.
- *
* @param string $id The node identifier
* @param mixed $value The node value
*/
--- Magento-CE-2.0.5/vendor/symfony/dependency-injection/composer.json 2016-03-21 04:27:21.000000000 -0300
+++ Magento-CE-2.0.6/vendor/symfony/dependency-injection/composer.json 2016-05-09 15:12:35.000000000 -0300
@@ -29,6 +29,7 @@
"suggest": {
"symfony/yaml": "",
"symfony/config": "",
+ "symfony/expression-language": "For using expressions in service container configuration",
"symfony/proxy-manager-bridge": "Generate service proxies to lazy load them"
},
"autoload": {
--- Magento-CE-2.0.5/vendor/symfony/dependency-injection/ContainerAware.php 2016-03-21 04:27:21.000000000 -0300
+++ Magento-CE-2.0.6/vendor/symfony/dependency-injection/ContainerAware.php 2016-05-09 15:12:35.000000000 -0300
@@ -26,9 +26,7 @@
protected $container;
/**
- * Sets the container.
- *
- * @param ContainerInterface|null $container A ContainerInterface instance or null
+ * {@inheritdoc}
*/
public function setContainer(ContainerInterface $container = null)
{
--- Magento-CE-2.0.5/vendor/symfony/dependency-injection/Container.php 2016-03-21 04:27:21.000000000 -0300
+++ Magento-CE-2.0.6/vendor/symfony/dependency-injection/Container.php 2016-05-09 15:12:35.000000000 -0300
@@ -78,8 +78,6 @@
private $underscoreMap = array('_' => '', '.' => '_', '\\' => '_');
/**
- * Constructor.
- *
* @param ParameterBagInterface $parameterBag A ParameterBagInterface instance
*/
public function __construct(ParameterBagInterface $parameterBag = null)
--- Magento-CE-2.0.5/vendor/symfony/dependency-injection/DefinitionDecorator.php 2016-03-21 04:27:21.000000000 -0300
+++ Magento-CE-2.0.6/vendor/symfony/dependency-injection/DefinitionDecorator.php 2016-05-09 15:12:35.000000000 -0300
@@ -25,8 +25,6 @@
private $changes = array();
/**
- * Constructor.
- *
* @param string $parent The id of Definition instance to decorate.
*/
public function __construct($parent)
--- Magento-CE-2.0.5/vendor/symfony/dependency-injection/Definition.php 2016-03-21 04:27:21.000000000 -0300
+++ Magento-CE-2.0.6/vendor/symfony/dependency-injection/Definition.php 2016-05-09 15:12:35.000000000 -0300
@@ -47,8 +47,6 @@
protected $arguments;
/**
- * Constructor.
- *
* @param string|null $class The service class
* @param array $arguments An array of arguments to pass to the service constructor
*/
--- Magento-CE-2.0.5/vendor/symfony/dependency-injection/Dumper/Dumper.php 2016-03-21 04:27:21.000000000 -0300
+++ Magento-CE-2.0.6/vendor/symfony/dependency-injection/Dumper/Dumper.php 2016-05-09 15:12:35.000000000 -0300
@@ -23,8 +23,6 @@
protected $container;
/**
- * Constructor.
- *
* @param ContainerBuilder $container The service container to dump
*/
public function __construct(ContainerBuilder $container)
--- Magento-CE-2.0.5/vendor/symfony/dependency-injection/Exception/ParameterNotFoundException.php 2016-03-21 04:27:21.000000000 -0300
+++ Magento-CE-2.0.6/vendor/symfony/dependency-injection/Exception/ParameterNotFoundException.php 2016-05-09 15:12:35.000000000 -0300
@@ -24,8 +24,6 @@
private $alternatives;
/**
- * Constructor.
- *
* @param string $key The requested parameter key
* @param string $sourceId The service id that references the non-existent parameter
* @param string $sourceKey The parameter key that references the non-existent parameter
--- Magento-CE-2.0.5/vendor/symfony/dependency-injection/Extension/Extension.php 2016-03-21 04:27:21.000000000 -0300
+++ Magento-CE-2.0.6/vendor/symfony/dependency-injection/Extension/Extension.php 2016-05-09 15:12:35.000000000 -0300
@@ -27,9 +27,7 @@
abstract class Extension implements ExtensionInterface, ConfigurationExtensionInterface
{
/**
- * Returns the base path for the XSD files.
- *
- * @return string The XSD base path
+ * {@inheritdoc}
*/
public function getXsdValidationBasePath()
{
@@ -37,9 +35,7 @@
}
/**
- * Returns the namespace to be used for this extension (XML namespace).
- *
- * @return string The XML namespace
+ * {@inheritdoc}
*/
public function getNamespace()
{
--- Magento-CE-2.0.5/vendor/symfony/dependency-injection/Loader/ClosureLoader.php 2016-03-21 04:27:21.000000000 -0300
+++ Magento-CE-2.0.6/vendor/symfony/dependency-injection/Loader/ClosureLoader.php 2016-05-09 15:12:35.000000000 -0300
@@ -26,8 +26,6 @@
private $container;
/**
- * Constructor.
- *
* @param ContainerBuilder $container A ContainerBuilder instance
*/
public function __construct(ContainerBuilder $container)
--- Magento-CE-2.0.5/vendor/symfony/dependency-injection/Loader/FileLoader.php 2016-03-21 04:27:21.000000000 -0300
+++ Magento-CE-2.0.6/vendor/symfony/dependency-injection/Loader/FileLoader.php 2016-05-09 15:12:35.000000000 -0300
@@ -25,8 +25,6 @@
protected $container;
/**
- * Constructor.
- *
* @param ContainerBuilder $container A ContainerBuilder instance
* @param FileLocatorInterface $locator A FileLocator instance
*/
--- Magento-CE-2.0.5/vendor/symfony/dependency-injection/Loader/schema/dic/services/services-1.0.xsd 2016-03-21 04:27:21.000000000 -0300
+++ Magento-CE-2.0.6/vendor/symfony/dependency-injection/Loader/schema/dic/services/services-1.0.xsd 2016-05-09 15:12:35.000000000 -0300
@@ -24,14 +24,28 @@
]]></xsd:documentation>
</xsd:annotation>
<xsd:sequence>
- <xsd:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded" />
- <xsd:element name="imports" type="imports" minOccurs="0" maxOccurs="1" />
- <xsd:element name="parameters" type="parameters" minOccurs="0" maxOccurs="1" />
- <xsd:element name="services" type="services" minOccurs="0" maxOccurs="1" />
- <xsd:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded" />
+ <xsd:group ref="foreign" />
+ <xsd:sequence minOccurs="0">
+ <xsd:element name="imports" type="imports" />
+ <xsd:group ref="foreign" />
+ </xsd:sequence>
+ <xsd:sequence minOccurs="0">
+ <xsd:element name="parameters" type="parameters" />
+ <xsd:group ref="foreign" />
+ </xsd:sequence>
+ <xsd:sequence minOccurs="0">
+ <xsd:element name="services" type="services" />
+ <xsd:group ref="foreign" />
+ </xsd:sequence>
</xsd:sequence>
</xsd:complexType>
+ <xsd:group name="foreign">
+ <xsd:sequence>
+ <xsd:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded" />
+ </xsd:sequence>
+ </xsd:group>
+
<xsd:complexType name="services">
<xsd:annotation>
<xsd:documentation><![CDATA[
--- Magento-CE-2.0.5/vendor/symfony/dependency-injection/Loader/XmlFileLoader.php 2016-03-21 04:27:21.000000000 -0300
+++ Magento-CE-2.0.6/vendor/symfony/dependency-injection/Loader/XmlFileLoader.php 2016-05-09 15:12:35.000000000 -0300
@@ -315,6 +315,10 @@
if ($services = $this->getChildren($node, 'service')) {
$definitions[$id] = array($services[0], $file, false);
$services[0]->setAttribute('id', $id);
+
+ // anonymous services are always private
+ // we could not use the constant false here, because of XML parsing
+ $services[0]->setAttribute('public', 'false');
}
}
}
@@ -325,11 +329,7 @@
// give it a unique name
$id = sprintf('%s_%d', hash('sha256', $file), ++$count);
$node->setAttribute('id', $id);
-
- if ($services = $this->getChildren($node, 'service')) {
$definitions[$id] = array($node, $file, true);
- $services[0]->setAttribute('id', $id);
- }
}
}
@@ -338,9 +338,6 @@
foreach ($definitions as $id => $def) {
list($domElement, $file, $wild) = $def;
- // anonymous services are always private
- // we could not use the constant false here, because of XML parsing
- $domElement->setAttribute('public', 'false');
if (null !== $definition = $this->parseDefinition($domElement, $file)) {
$this->container->setDefinition($id, $definition);
--- Magento-CE-2.0.5/vendor/symfony/dependency-injection/ParameterBag/FrozenParameterBag.php 2016-03-21 04:27:21.000000000 -0300
+++ Magento-CE-2.0.6/vendor/symfony/dependency-injection/ParameterBag/FrozenParameterBag.php 2016-05-09 15:12:35.000000000 -0300
@@ -21,8 +21,6 @@
class FrozenParameterBag extends ParameterBag
{
/**
- * Constructor.
- *
* For performance reasons, the constructor assumes that
* all keys are already lowercased.
*
--- Magento-CE-2.0.5/vendor/symfony/dependency-injection/ParameterBag/ParameterBag.php 2016-03-21 04:27:21.000000000 -0300
+++ Magento-CE-2.0.6/vendor/symfony/dependency-injection/ParameterBag/ParameterBag.php 2016-05-09 15:12:35.000000000 -0300
@@ -26,8 +26,6 @@
protected $resolved = false;
/**
- * Constructor.
- *
* @param array $parameters An array of parameters
*/
public function __construct(array $parameters = array())
@@ -56,9 +54,7 @@
}
/**
- * Gets the service container parameters.
- *
- * @return array An array of parameters
+ * {@inheritdoc}
*/
public function all()
{
@@ -66,13 +62,7 @@
}
/**
- * Gets a service container parameter.
- *
- * @param string $name The parameter name
- *
- * @return mixed The parameter value
- *
- * @throws ParameterNotFoundException if the parameter is not defined
+ * {@inheritdoc}
*/
public function get($name)
{
@@ -109,11 +99,7 @@
}
/**
- * Returns true if a parameter name is defined.
- *
- * @param string $name The parameter name
- *
- * @return bool true if the parameter name is defined, false otherwise
+ * {@inheritdoc}
*/
public function has($name)
{
@@ -131,7 +117,7 @@
}
/**
- * Replaces parameter placeholders (%name%) by their values for all parameters.
+ * {@inheritdoc}
*/
public function resolve()
{
@@ -266,6 +252,9 @@
return $value;
}
+ /**
+ * {@inheritdoc}
+ */
public function unescapeValue($value)
{
if (is_string($value)) {
--- Magento-CE-2.0.5/vendor/symfony/dependency-injection/Parameter.php 2016-03-21 04:27:21.000000000 -0300
+++ Magento-CE-2.0.6/vendor/symfony/dependency-injection/Parameter.php 2016-05-09 15:12:35.000000000 -0300
@@ -21,8 +21,6 @@
private $id;
/**
- * Constructor.
- *
* @param string $id The parameter key
*/
public function __construct($id)
@@ -31,8 +29,6 @@
}
/**
- * __toString.
- *
* @return string The parameter key
*/
public function __toString()
--- Magento-CE-2.0.5/vendor/symfony/dependency-injection/Reference.php 2016-03-21 04:27:21.000000000 -0300
+++ Magento-CE-2.0.6/vendor/symfony/dependency-injection/Reference.php 2016-05-09 15:12:35.000000000 -0300
@@ -23,8 +23,6 @@
private $strict;
/**
- * Constructor.
- *
* Note: The $strict parameter is deprecated since version 2.8 and will be removed in 3.0.
*
* @param string $id The service identifier
@@ -41,8 +39,6 @@
}
/**
- * __toString.
- *
* @return string The service identifier
*/
public function __toString()
--- Magento-CE-2.0.5/vendor/symfony/dependency-injection/Tests/Compiler/AutowirePassTest.php 2016-03-21 04:27:21.000000000 -0300
+++ Magento-CE-2.0.6/vendor/symfony/dependency-injection/Tests/Compiler/AutowirePassTest.php 2016-05-09 15:12:35.000000000 -0300
@@ -103,7 +103,7 @@
/**
* @expectedException \Symfony\Component\DependencyInjection\Exception\RuntimeException
- * @expectedExceptionMessage Unable to autowire argument of type "Symfony\Component\DependencyInjection\Tests\Compiler\CollisionInterface" for the service "a".
+ * @expectedExceptionMessage Unable to autowire argument of type "Symfony\Component\DependencyInjection\Tests\Compiler\CollisionInterface" for the service "a". Several services implementing this type have been declared: "c1", "c2".
*/
public function testTypeCollision()
{
@@ -120,7 +120,7 @@
/**
* @expectedException \Symfony\Component\DependencyInjection\Exception\RuntimeException
- * @expectedExceptionMessage Unable to autowire argument of type "Symfony\Component\DependencyInjection\Tests\Compiler\Foo" for the service "a".
+ * @expectedExceptionMessage Unable to autowire argument of type "Symfony\Component\DependencyInjection\Tests\Compiler\Foo" for the service "a". Several services implementing this type have been declared: "a1", "a2".
*/
public function testTypeNotGuessable()
{
@@ -137,7 +137,7 @@
/**
* @expectedException \Symfony\Component\DependencyInjection\Exception\RuntimeException
- * @expectedExceptionMessage Unable to autowire argument of type "Symfony\Component\DependencyInjection\Tests\Compiler\A" for the service "a".
+ * @expectedExceptionMessage Unable to autowire argument of type "Symfony\Component\DependencyInjection\Tests\Compiler\A" for the service "a". Several services implementing this type have been declared: "a1", "a2".
*/
public function testTypeNotGuessableWithSubclass()
{
@@ -207,6 +207,21 @@
$this->assertEquals(__NAMESPACE__.'\Lille', $lilleDefinition->getClass());
}
+ /**
+ * @expectedException \Symfony\Component\DependencyInjection\Exception\RuntimeException
+ * @expectedExceptionMessage Unable to autowire argument of type "Symfony\Component\DependencyInjection\Tests\Compiler\CollisionInterface" for the service "a". This type cannot be instantiated automatically and no service implementing this type is declared.
+ */
+ public function testCreateNonInstanciable()
+ {
+ $container = new ContainerBuilder();
+
+ $aDefinition = $container->register('a', __NAMESPACE__.'\CannotBeAutowired');
+ $aDefinition->setAutowired(true);
+
+ $pass = new AutowirePass();
+ $pass->process($container);
+ }
+
public function testResolveParameter()
{
$container = new ContainerBuilder();
@@ -268,6 +283,21 @@
$pass->process($container);
}
+ /**
+ * @expectedException \Symfony\Component\DependencyInjection\Exception\RuntimeException
+ * @expectedExceptionMessage Cannot autowire argument 2 for Symfony\Component\DependencyInjection\Tests\Compiler\BadParentTypeHintedArgument because the type-hinted class does not exist (Class Symfony\Component\DependencyInjection\Tests\Compiler\OptionalServiceClass does not exist).
+ */
+ public function testParentClassNotFoundThrowsException()
+ {
+ $container = new ContainerBuilder();
+
+ $aDefinition = $container->register('a', __NAMESPACE__.'\BadParentTypeHintedArgument');
+ $aDefinition->setAutowired(true);
+
+ $pass = new AutowirePass();
+ $pass->process($container);
+ }
+
public function testDontUseAbstractServices()
{
$container = new ContainerBuilder();
@@ -397,6 +427,21 @@
$definition->getArguments()
);
}
+
+ public function testIgnoreServiceWithClassNotExisting()
+ {
+ $container = new ContainerBuilder();
+
+ $container->register('class_not_exist', __NAMESPACE__.'\OptionalServiceClass');
+
+ $barDefinition = $container->register('bar', __NAMESPACE__.'\Bar');
+ $barDefinition->setAutowired(true);
+
+ $pass = new AutowirePass();
+ $pass->process($container);
+
+ $this->assertTrue($container->hasDefinition('bar'));
+ }
}
class Foo
@@ -509,6 +554,12 @@
{
}
}
+class BadParentTypeHintedArgument
+{
+ public function __construct(Dunglas $k, OptionalServiceClass $r)
+ {
+ }
+}
class NotGuessableArgument
{
public function __construct(Foo $k)
--- Magento-CE-2.0.5/vendor/symfony/dependency-injection/Tests/Compiler/OptionalServiceClass.php 1969-12-31 21:00:00.000000000 -0300
+++ Magento-CE-2.0.6/vendor/symfony/dependency-injection/Tests/Compiler/OptionalServiceClass.php 2016-05-09 15:12:35.000000000 -0300
@@ -0,0 +1,18 @@
+<?php
+
+/*
+ * This file is part of the Symfony package.
+ *
+ * (c) Fabien Potencier <fabien@symfony.com>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\DependencyInjection\Tests\Compiler;
+
+use Symfony\Bug\NotExistClass;
+
+class OptionalServiceClass extends NotExistClass
+{
+}
--- Magento-CE-2.0.5/vendor/symfony/dependency-injection/Tests/Compiler/ReplaceAliasByActualDefinitionPassTest.php 2016-03-21 04:27:21.000000000 -0300
+++ Magento-CE-2.0.6/vendor/symfony/dependency-injection/Tests/Compiler/ReplaceAliasByActualDefinitionPassTest.php 2016-05-09 15:12:35.000000000 -0300
@@ -36,6 +36,8 @@
$container->setAlias('a_alias', 'a');
$container->setAlias('b_alias', 'b');
+ $container->setAlias('container', 'service_container');
+
$this->process($container);
$this->assertTrue($container->has('a'), '->process() does nothing to public definitions.');
@@ -47,6 +49,7 @@
);
$this->assertSame('b_alias', $aDefinition->getFactoryService(false));
+ $this->assertTrue($container->has('container'));
$resolvedFactory = $aDefinition->getFactory(false);
$this->assertSame('b_alias', (string) $resolvedFactory[0]);
--- Magento-CE-2.0.5/vendor/symfony/dependency-injection/Tests/Compiler/ResolveDefinitionTemplatesPassTest.php 2016-03-21 04:27:21.000000000 -0300
+++ Magento-CE-2.0.6/vendor/symfony/dependency-injection/Tests/Compiler/ResolveDefinitionTemplatesPassTest.php 2016-05-09 15:12:35.000000000 -0300
@@ -276,10 +276,12 @@
$container->register('parent', 'stdClass');
$container->setDefinition('child1', new DefinitionDecorator('parent'))
- ->setDecoratedService('foo', 'foo_inner')
+ ->setDecoratedService('foo', 'foo_inner', 5)
;
- $this->assertEquals(array('foo', 'foo_inner', 0), $container->getDefinition('child1')->getDecoratedService());
+ $this->process($container);
+
+ $this->assertEquals(array('foo', 'foo_inner', 5), $container->getDefinition('child1')->getDecoratedService());
}
public function testDecoratedServiceCopiesDeprecatedStatusFromParent()
--- Magento-CE-2.0.5/vendor/symfony/dependency-injection/Tests/ContainerBuilderTest.php 2016-03-21 04:27:21.000000000 -0300
+++ Magento-CE-2.0.6/vendor/symfony/dependency-injection/Tests/ContainerBuilderTest.php 2016-05-09 15:12:35.000000000 -0300
@@ -61,24 +61,27 @@
public function testCreateDeprecatedService()
{
- $definition = new Definition('stdClass');
- $definition->setDeprecated(true);
+ $deprecations = array();
+ set_error_handler(function ($type, $msg) use (&$deprecations) {
+ if (E_USER_DEPRECATED !== $type) {
+ restore_error_handler();
- $that = $this;
- $wasTriggered = false;
+ return call_user_func_array('PHPUnit_Util_ErrorHandler::handleError', func_get_args());
+ }
- set_error_handler(function ($errno, $errstr) use ($that, &$wasTriggered) {
- $that->assertSame(E_USER_DEPRECATED, $errno);
- $that->assertSame('The "deprecated_foo" service is deprecated. You should stop using it, as it will soon be removed.', $errstr);
- $wasTriggered = true;
+ $deprecations[] = $msg;
});
+ $definition = new Definition('stdClass');
+ $definition->setDeprecated(true);
+
$builder = new ContainerBuilder();
$builder->createService($definition, 'deprecated_foo');
restore_error_handler();
- $this->assertTrue($wasTriggered);
+ $this->assertCount(1, $deprecations);
+ $this->assertContains('The "deprecated_foo" service is deprecated. You should stop using it, as it will soon be removed.', $deprecations[0]);
}
public function testRegister()
@@ -786,6 +789,21 @@
$this->assertEquals(array($second, $first), $configs);
}
+ public function testAbstractAlias()
+ {
+ $container = new ContainerBuilder();
+
+ $abstract = new Definition('AbstractClass');
+ $abstract->setAbstract(true);
+
+ $container->setDefinition('abstract_service', $abstract);
+ $container->setAlias('abstract_alias', 'abstract_service');
+
+ $container->compile();
+
+ $this->assertSame('abstract_service', (string) $container->getAlias('abstract_alias'));
+ }
+
public function testLazyLoadedService()
{
$loader = new ClosureLoader($container = new ContainerBuilder());
--- Magento-CE-2.0.5/vendor/symfony/dependency-injection/Tests/CrossCheckTest.php 2016-03-21 04:27:21.000000000 -0300
+++ Magento-CE-2.0.6/vendor/symfony/dependency-injection/Tests/CrossCheckTest.php 2016-05-09 15:12:35.000000000 -0300
@@ -73,24 +73,17 @@
public function crossCheckLoadersDumpers()
{
- $tests = array(
+ return array(
array('services1.xml', 'xml'),
array('services2.xml', 'xml'),
array('services6.xml', 'xml'),
array('services8.xml', 'xml'),
array('services9.xml', 'xml'),
- );
-
- if (class_exists('Symfony\Component\Yaml\Yaml')) {
- $tests = array_merge($tests, array(
array('services1.yml', 'yaml'),
array('services2.yml', 'yaml'),
array('services6.yml', 'yaml'),
array('services8.yml', 'yaml'),
array('services9.yml', 'yaml'),
- ));
- }
-
- return $tests;
+ );
}
}
--- Magento-CE-2.0.5/vendor/symfony/dependency-injection/Tests/Dumper/PhpDumperTest.php 2016-03-21 04:27:21.000000000 -0300
+++ Magento-CE-2.0.6/vendor/symfony/dependency-injection/Tests/Dumper/PhpDumperTest.php 2016-05-09 15:12:35.000000000 -0300
@@ -16,6 +16,8 @@
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag;
use Symfony\Component\DependencyInjection\Reference;
use Symfony\Component\DependencyInjection\Definition;
+use Symfony\Component\DependencyInjection\Variable;
+use Symfony\Component\ExpressionLanguage\Expression;
class PhpDumperTest extends \PHPUnit_Framework_TestCase
{
@@ -85,14 +87,25 @@
}
/**
+ * @dataProvider provideInvalidParameters
* @expectedException \InvalidArgumentException
*/
- public function testExportParameters()
+ public function testExportParameters($parameters)
{
- $dumper = new PhpDumper(new ContainerBuilder(new ParameterBag(array('foo' => new Reference('foo')))));
+ $dumper = new PhpDumper(new ContainerBuilder(new ParameterBag($parameters)));
$dumper->dump();
}
+ public function provideInvalidParameters()
+ {
+ return array(
+ array(array('foo' => new Definition('stdClass'))),
+ array(array('foo' => new Expression('service("foo").foo() ~ (container.hasparameter("foo") ? parameter("foo") : "default")'))),
+ array(array('foo' => new Reference('foo'))),
+ array(array('foo' => new Variable('foo'))),
+ );
+ }
+
public function testAddParameters()
{
$container = include self::$fixturesPath.'/containers/container8.php';
--- Magento-CE-2.0.5/vendor/symfony/dependency-injection/Tests/Fixtures/xml/services5.xml 2016-03-21 04:27:21.000000000 -0300
+++ Magento-CE-2.0.6/vendor/symfony/dependency-injection/Tests/Fixtures/xml/services5.xml 2016-05-09 15:12:35.000000000 -0300
@@ -14,8 +14,12 @@
</service>
</argument>
<property name="p" type="service">
- <service class="BazClass" />
+ <service class="BuzClass" />
</property>
</service>
+ <service id="bar" parent="foo" />
+ <service class="BizClass">
+ <tag name="biz_tag" />
+ </service>
</services>
</container>
--- Magento-CE-2.0.5/vendor/symfony/dependency-injection/Tests/Loader/XmlFileLoaderTest.php 2016-03-21 04:27:21.000000000 -0300
+++ Magento-CE-2.0.6/vendor/symfony/dependency-injection/Tests/Loader/XmlFileLoaderTest.php 2016-05-09 15:12:35.000000000 -0300
@@ -163,7 +163,7 @@
$loader = new XmlFileLoader($container, new FileLocator(self::$fixturesPath.'/xml'));
$loader->load('services5.xml');
$services = $container->getDefinitions();
- $this->assertCount(4, $services, '->load() attributes unique ids to anonymous services');
+ $this->assertCount(6, $services, '->load() attributes unique ids to anonymous services');
// anonymous service as an argument
$args = $services['foo']->getArguments();
@@ -172,6 +172,7 @@
$this->assertTrue(isset($services[(string) $args[0]]), '->load() makes a reference to the created ones');
$inner = $services[(string) $args[0]];
$this->assertEquals('BarClass', $inner->getClass(), '->load() uses the same configuration as for the anonymous ones');
+ $this->assertFalse($inner->isPublic());
// inner anonymous services
$args = $inner->getArguments();
@@ -188,7 +189,25 @@
$this->assertInstanceOf('Symfony\\Component\\DependencyInjection\\Reference', $property, '->load() converts anonymous services to references to "normal" services');
$this->assertTrue(isset($services[(string) $property]), '->load() makes a reference to the created ones');
$inner = $services[(string) $property];
- $this->assertEquals('BazClass', $inner->getClass(), '->load() uses the same configuration as for the anonymous ones');
+ $this->assertEquals('BuzClass', $inner->getClass(), '->load() uses the same configuration as for the anonymous ones');
+ $this->assertFalse($inner->isPublic());
+
+ // "wild" service
+ $service = $container->findTaggedServiceIds('biz_tag');
+ $this->assertCount(1, $service);
+
+ foreach ($service as $id => $tag) {
+ $service = $container->getDefinition($id);
+ }
+ $this->assertEquals('BizClass', $service->getClass(), '->load() uses the same configuration as for the anonymous ones');
+ $this->assertTrue($service->isPublic());
+
+ // anonymous services are shared when using decoration definitions
+ $container->compile();
+ $services = $container->getDefinitions();
+ $fooArgs = $services['foo']->getArguments();
+ $barArgs = $services['bar']->getArguments();
+ $this->assertSame($fooArgs[0], $barArgs[0]);
}
/**
--- Magento-CE-2.0.5/vendor/symfony/dependency-injection/Variable.php 2016-03-21 04:27:21.000000000 -0300
+++ Magento-CE-2.0.6/vendor/symfony/dependency-injection/Variable.php 2016-05-09 15:12:35.000000000 -0300
@@ -29,8 +29,6 @@
private $name;
/**
- * Constructor.
- *
* @param string $name
*/
public function __construct($name)
--- Magento-CE-2.0.5/vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php 2016-03-07 11:04:32.000000000 -0300
+++ Magento-CE-2.0.6/vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php 2016-05-03 15:59:18.000000000 -0300
@@ -104,6 +104,10 @@
*/
public function getListenerPriority($eventName, $listener)
{
+ if (!method_exists($this->dispatcher, 'getListenerPriority')) {
+ return 0;
+ }
+
return $this->dispatcher->getListenerPriority($eventName, $listener);
}
@@ -124,6 +128,10 @@
$event = new Event();
}
+ if (null !== $this->logger && $event->isPropagationStopped()) {
+ $this->logger->debug(sprintf('The "%s" event is already stopped. No listeners have been called.', $eventName));
+ }
+
$this->preProcess($eventName);
$this->preDispatch($eventName, $event);
--- Magento-CE-2.0.5/vendor/symfony/event-dispatcher/EventDispatcher.php 2016-03-07 11:04:32.000000000 -0300
+++ Magento-CE-2.0.6/vendor/symfony/event-dispatcher/EventDispatcher.php 2016-05-03 15:59:18.000000000 -0300
@@ -178,10 +178,10 @@
protected function doDispatch($listeners, $eventName, Event $event)
{
foreach ($listeners as $listener) {
- call_user_func($listener, $event, $eventName, $this);
if ($event->isPropagationStopped()) {
break;
}
+ call_user_func($listener, $event, $eventName, $this);
}
}
--- Magento-CE-2.0.5/vendor/symfony/event-dispatcher/Tests/Debug/TraceableEventDispatcherTest.php 2016-03-07 11:04:32.000000000 -0300
+++ Magento-CE-2.0.6/vendor/symfony/event-dispatcher/Tests/Debug/TraceableEventDispatcherTest.php 2016-05-03 15:59:18.000000000 -0300
@@ -73,6 +73,16 @@
$this->assertSame(123, $tdispatcher->getListenerPriority('foo', $listeners[0]));
}
+ public function testGetListenerPriorityReturnsZeroWhenWrappedMethodDoesNotExist()
+ {
+ $dispatcher = $this->getMock('Symfony\Component\EventDispatcher\EventDispatcherInterface');
+ $traceableEventDispatcher = new TraceableEventDispatcher($dispatcher, new Stopwatch());
+ $traceableEventDispatcher->addListener('foo', function () {}, 123);
+ $listeners = $traceableEventDispatcher->getListeners('foo');
+
+ $this->assertSame(0, $traceableEventDispatcher->getListenerPriority('foo', $listeners[0]));
+ }
+
public function testAddRemoveSubscriber()
{
$dispatcher = new EventDispatcher();
--- Magento-CE-2.0.5/vendor/symfony/filesystem/Filesystem.php 2016-03-27 07:20:16.000000000 -0300
+++ Magento-CE-2.0.6/vendor/symfony/filesystem/Filesystem.php 2016-04-12 15:01:21.000000000 -0300
@@ -155,24 +155,27 @@
*/
public function remove($files)
{
- $files = iterator_to_array($this->toIterator($files));
+ if ($files instanceof \Traversable) {
+ $files = iterator_to_array($files, false);
+ } elseif (!is_array($files)) {
+ $files = array($files);
+ }
$files = array_reverse($files);
foreach ($files as $file) {
- if (@(unlink($file) || rmdir($file))) {
- continue;
- }
if (is_link($file)) {
// See https://bugs.php.net/52176
+ if (!@(unlink($file) || '\\' !== DIRECTORY_SEPARATOR || rmdir($file)) && file_exists($file)) {
$error = error_get_last();
throw new IOException(sprintf('Failed to remove symlink "%s": %s.', $file, $error['message']));
+ }
} elseif (is_dir($file)) {
- $this->remove(new \FilesystemIterator($file));
+ $this->remove(new \FilesystemIterator($file, \FilesystemIterator::CURRENT_AS_PATHNAME | \FilesystemIterator::SKIP_DOTS));
- if (!@rmdir($file)) {
+ if (!@rmdir($file) && file_exists($file)) {
$error = error_get_last();
throw new IOException(sprintf('Failed to remove directory "%s": %s.', $file, $error['message']));
}
- } elseif (file_exists($file)) {
+ } elseif (!@unlink($file) && file_exists($file)) {
$error = error_get_last();
throw new IOException(sprintf('Failed to remove file "%s": %s.', $file, $error['message']));
}
--- Magento-CE-2.0.5/vendor/symfony/process/Pipes/AbstractPipes.php 2016-03-23 10:11:46.000000000 -0300
+++ Magento-CE-2.0.6/vendor/symfony/process/Pipes/AbstractPipes.php 2016-04-14 12:22:22.000000000 -0300
@@ -22,10 +22,9 @@
public $pipes = array();
/** @var string */
- protected $inputBuffer = '';
+ private $inputBuffer = '';
/** @var resource|null */
- protected $input;
-
+ private $input;
/** @var bool */
private $blocked = true;
@@ -91,9 +90,8 @@
if (!isset($this->pipes[0])) {
return;
}
-
- $e = array();
- $r = null !== $this->input ? array($this->input) : $e;
+ $input = $this->input;
+ $r = $e = array();
$w = array($this->pipes[0]);
// let's have a look if something changed in streams
@@ -110,7 +108,7 @@
}
}
- foreach ($r as $input) {
+ if ($input) {
for (;;) {
$data = fread($input, self::CHUNK_SIZE);
if (!isset($data[0])) {
@@ -124,7 +122,7 @@
return array($this->pipes[0]);
}
}
- if (!isset($data[0]) && feof($input)) {
+ if (feof($input)) {
// no more data to read on input resource
// use an empty buffer in the next reads
$this->input = null;
--- Magento-CE-2.0.5/vendor/symfony/process/ProcessBuilder.php 2016-03-23 10:11:46.000000000 -0300
+++ Magento-CE-2.0.6/vendor/symfony/process/ProcessBuilder.php 2016-04-14 12:22:22.000000000 -0300
@@ -177,7 +177,7 @@
*/
public function setInput($input)
{
- $this->input = ProcessUtils::validateInput(sprintf('%s::%s', __CLASS__, __FUNCTION__), $input);
+ $this->input = ProcessUtils::validateInput(__METHOD__, $input);
return $this;
}
--- Magento-CE-2.0.5/vendor/symfony/process/Process.php 2016-03-23 10:11:46.000000000 -0300
+++ Magento-CE-2.0.6/vendor/symfony/process/Process.php 2016-04-14 12:22:22.000000000 -0300
@@ -158,7 +158,7 @@
$this->setEnv($env);
}
- $this->input = $input;
+ $this->setInput($input);
$this->setTimeout($timeout);
$this->useFileHandles = '\\' === DIRECTORY_SEPARATOR;
$this->pty = false;
@@ -1087,7 +1087,7 @@
throw new LogicException('Input can not be set while the process is running.');
}
- $this->input = ProcessUtils::validateInput(sprintf('%s::%s', __CLASS__, __FUNCTION__), $input);
+ $this->input = ProcessUtils::validateInput(__METHOD__, $input);
return $this;
}
--- Magento-CE-2.0.5/vendor/symfony/process/ProcessUtils.php 2016-03-23 10:11:46.000000000 -0300
+++ Magento-CE-2.0.6/vendor/symfony/process/ProcessUtils.php 2016-04-14 12:22:22.000000000 -0300
@@ -80,7 +80,7 @@
* @param string $caller The name of method call that validates the input
* @param mixed $input The input to validate
*
- * @return string The validated input
+ * @return mixed The validated input
*
* @throws InvalidArgumentException In case the input is not valid
*
@@ -92,6 +92,9 @@
if (is_resource($input)) {
return $input;
}
+ if (is_string($input)) {
+ return $input;
+ }
if (is_scalar($input)) {
return (string) $input;
}
--- Magento-CE-2.0.5/vendor/symfony/process/Tests/ProcessTest.php 2016-03-23 10:11:46.000000000 -0300
+++ Magento-CE-2.0.6/vendor/symfony/process/Tests/ProcessTest.php 2016-04-14 12:22:22.000000000 -0300
@@ -209,6 +209,24 @@
$this->assertEquals($expectedLength, strlen($p->getErrorOutput()));
}
+ public function testLiveStreamAsInput()
+ {
+ $stream = fopen('php://memory', 'r+');
+ fwrite($stream, 'hello');
+ rewind($stream);
+
+ $p = $this->getProcess(sprintf('%s -r %s', self::$phpBin, escapeshellarg('stream_copy_to_stream(STDIN, STDOUT);')));
+ $p->setInput($stream);
+ $p->start(function ($type, $data) use ($stream) {
+ if ('hello' === $data) {
+ fclose($stream);
+ }
+ });
+ $p->wait();
+
+ $this->assertSame('hello', $p->getOutput());
+ }
+
/**
* @expectedException \Symfony\Component\Process\Exception\LogicException
* @expectedExceptionMessage Input can not be set while the process is running.
@@ -1163,7 +1181,7 @@
* @dataProvider provideVariousIncrementals
*/
public function testIncrementalOutputDoesNotRequireAnotherCall($stream, $method) {
- $process = new Process(self::$phpBin.' -r '.escapeshellarg('$n = 0; while ($n < 3) { file_put_contents(\''.$stream.'\', $n, 1); $n++; usleep(1000); }'), null, null, null, null);
+ $process = $this->getProcess(self::$phpBin.' -r '.escapeshellarg('$n = 0; while ($n < 3) { file_put_contents(\''.$stream.'\', $n, 1); $n++; usleep(1000); }'), null, null, null, null);
$process->start();
$result = '';
$limit = microtime(true) + 3;
@@ -1185,24 +1203,6 @@
}
/**
- * provides default method names for simple getter/setter.
- */
- public function methodProvider()
- {
- $defaults = array(
- array('CommandLine'),
- array('Timeout'),
- array('WorkingDirectory'),
- array('Env'),
- array('Stdin'),
- array('Input'),
- array('Options'),
- );
-
- return $defaults;
- }
-
- /**
* @param string $commandline
* @param null|string $cwd
* @param null|array $env
--- Magento-CE-2.0.5/vendor/symfony/yaml/Tests/ParserTest.php 2016-03-04 04:54:35.000000000 -0300
+++ Magento-CE-2.0.6/vendor/symfony/yaml/Tests/ParserTest.php 2016-03-29 16:00:15.000000000 -0300
@@ -889,9 +889,13 @@
$deprecations = array();
set_error_handler(function ($type, $msg) use (&$deprecations) {
- if (E_USER_DEPRECATED === $type) {
- $deprecations[] = $msg;
+ if (E_USER_DEPRECATED !== $type) {
+ restore_error_handler();
+
+ return call_user_func_array('PHPUnit_Util_ErrorHandler::handleError', func_get_args());
}
+
+ $deprecations[] = $msg;
});
$this->parser->parse($yaml);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment