diff --git a/app/code/Magento/AdminNotification/Setup/InstallSchema.php b/app/code/Magento/AdminNotification/Setup/InstallSchema.php index 31b8842ee72e5..f8118f245e8ff 100644 --- a/app/code/Magento/AdminNotification/Setup/InstallSchema.php +++ b/app/code/Magento/AdminNotification/Setup/InstallSchema.php @@ -45,7 +45,7 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con 'date_added', \Magento\Framework\DB\Ddl\Table::TYPE_TIMESTAMP, null, - ['nullable' => false], + ['nullable' => false, 'default' => \Magento\Framework\DB\Ddl\Table::TIMESTAMP_INIT], 'Create date' )->addColumn( 'title', @@ -112,7 +112,7 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con 'created_at', \Magento\Framework\DB\Ddl\Table::TYPE_TIMESTAMP, null, - ['nullable' => false], + ['nullable' => false, 'default' => \Magento\Framework\DB\Ddl\Table::TIMESTAMP_INIT], 'Create date' )->setComment( 'Admin System Messages' diff --git a/app/code/Magento/Cron/Setup/InstallSchema.php b/app/code/Magento/Cron/Setup/InstallSchema.php index cc7b419fa4e66..e3368c677742f 100644 --- a/app/code/Magento/Cron/Setup/InstallSchema.php +++ b/app/code/Magento/Cron/Setup/InstallSchema.php @@ -57,7 +57,7 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con 'created_at', \Magento\Framework\DB\Ddl\Table::TYPE_TIMESTAMP, null, - ['nullable' => false], + ['nullable' => false, 'default' => \Magento\Framework\DB\Ddl\Table::TIMESTAMP_INIT], 'Created At' )->addColumn( 'scheduled_at', diff --git a/app/code/Magento/Customer/Setup/InstallSchema.php b/app/code/Magento/Customer/Setup/InstallSchema.php index 6f6750f379704..e74309026a57b 100644 --- a/app/code/Magento/Customer/Setup/InstallSchema.php +++ b/app/code/Magento/Customer/Setup/InstallSchema.php @@ -81,13 +81,13 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con 'created_at', \Magento\Framework\DB\Ddl\Table::TYPE_TIMESTAMP, null, - ['nullable' => false], + ['nullable' => false, 'default' => \Magento\Framework\DB\Ddl\Table::TIMESTAMP_INIT], 'Created At' )->addColumn( 'updated_at', \Magento\Framework\DB\Ddl\Table::TYPE_TIMESTAMP, null, - ['nullable' => false], + ['nullable' => false, 'default' => \Magento\Framework\DB\Ddl\Table::TIMESTAMP_INIT_UPDATE], 'Updated At' )->addColumn( 'is_active', @@ -134,7 +134,7 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con 'Customer Entity' ); $installer->getConnection()->createTable($table); - + /** * Create table 'customer_address_entity' */ @@ -174,13 +174,13 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con 'created_at', \Magento\Framework\DB\Ddl\Table::TYPE_TIMESTAMP, null, - ['nullable' => false], + ['nullable' => false, 'default' => \Magento\Framework\DB\Ddl\Table::TIMESTAMP_INIT], 'Created At' )->addColumn( 'updated_at', \Magento\Framework\DB\Ddl\Table::TYPE_TIMESTAMP, null, - ['nullable' => false], + ['nullable' => false, 'default' => \Magento\Framework\DB\Ddl\Table::TIMESTAMP_INIT_UPDATE], 'Updated At' )->addColumn( 'is_active', @@ -202,7 +202,7 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con 'Customer Address Entity' ); $installer->getConnection()->createTable($table); - + /** * Create table 'customer_address_entity_datetime' */ @@ -287,7 +287,7 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con 'Customer Address Entity Datetime' ); $installer->getConnection()->createTable($table); - + /** * Create table 'customer_address_entity_decimal' */ @@ -372,7 +372,7 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con 'Customer Address Entity Decimal' ); $installer->getConnection()->createTable($table); - + /** * Create table 'customer_address_entity_int' */ @@ -447,7 +447,7 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con 'Customer Address Entity Int' ); $installer->getConnection()->createTable($table); - + /** * Create table 'customer_address_entity_text' */ @@ -524,7 +524,7 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con 'Customer Address Entity Text' ); $installer->getConnection()->createTable($table); - + /** * Create table 'customer_address_entity_varchar' */ @@ -609,7 +609,7 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con 'Customer Address Entity Varchar' ); $installer->getConnection()->createTable($table); - + /** * Create table 'customer_entity_datetime' */ @@ -684,7 +684,7 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con 'Customer Entity Datetime' ); $installer->getConnection()->createTable($table); - + /** * Create table 'customer_entity_decimal' */ @@ -759,7 +759,7 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con 'Customer Entity Decimal' ); $installer->getConnection()->createTable($table); - + /** * Create table 'customer_entity_int' */ @@ -834,7 +834,7 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con 'Customer Entity Int' ); $installer->getConnection()->createTable($table); - + /** * Create table 'customer_entity_text' */ @@ -906,7 +906,7 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con 'Customer Entity Text' ); $installer->getConnection()->createTable($table); - + /** * Create table 'customer_entity_varchar' */ @@ -981,7 +981,7 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con 'Customer Entity Varchar' ); $installer->getConnection()->createTable($table); - + /** * Create table 'customer_group' */ @@ -1009,7 +1009,7 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con 'Customer Group' ); $installer->getConnection()->createTable($table); - + /** * Create table 'customer_eav_attribute' */ @@ -1073,7 +1073,7 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con 'Customer Eav Attribute' ); $installer->getConnection()->createTable($table); - + /** * Create table 'customer_form_attribute' */ @@ -1104,7 +1104,7 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con 'Customer Form Attribute' ); $installer->getConnection()->createTable($table); - + /** * Create table 'customer_eav_attribute_website' */ @@ -1165,7 +1165,7 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con 'Customer Eav Attribute Website' ); $installer->getConnection()->createTable($table); - + /** * Create table 'customer_visitor' */ @@ -1193,8 +1193,8 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con 'Visitor Table' ); $installer->getConnection()->createTable($table); - + $installer->endSetup(); - + } } diff --git a/app/code/Magento/Downloadable/Setup/InstallSchema.php b/app/code/Magento/Downloadable/Setup/InstallSchema.php index e7043312e7a49..f377662176a55 100644 --- a/app/code/Magento/Downloadable/Setup/InstallSchema.php +++ b/app/code/Magento/Downloadable/Setup/InstallSchema.php @@ -216,14 +216,14 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con 'created_at', \Magento\Framework\DB\Ddl\Table::TYPE_TIMESTAMP, null, - ['nullable' => false], + ['nullable' => false, 'default' => \Magento\Framework\DB\Ddl\Table::TIMESTAMP_INIT], 'Date of creation' ) ->addColumn( 'updated_at', \Magento\Framework\DB\Ddl\Table::TYPE_TIMESTAMP, null, - ['nullable' => false], + ['nullable' => false, 'default' => \Magento\Framework\DB\Ddl\Table::TIMESTAMP_INIT_UPDATE], 'Date of modification' ) ->addColumn( @@ -390,14 +390,14 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con 'created_at', \Magento\Framework\DB\Ddl\Table::TYPE_TIMESTAMP, null, - ['nullable' => false], + ['nullable' => false, 'default' => \Magento\Framework\DB\Ddl\Table::TIMESTAMP_INIT], 'Creation Time' ) ->addColumn( 'updated_at', \Magento\Framework\DB\Ddl\Table::TYPE_TIMESTAMP, null, - ['nullable' => false], + ['nullable' => false, 'default' => \Magento\Framework\DB\Ddl\Table::TIMESTAMP_INIT_UPDATE], 'Update Time' ) ->addIndex( diff --git a/app/code/Magento/Eav/Setup/InstallSchema.php b/app/code/Magento/Eav/Setup/InstallSchema.php index 244cfe2d85e9e..24c041c7e2c05 100644 --- a/app/code/Magento/Eav/Setup/InstallSchema.php +++ b/app/code/Magento/Eav/Setup/InstallSchema.php @@ -179,13 +179,13 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con 'created_at', \Magento\Framework\DB\Ddl\Table::TYPE_TIMESTAMP, null, - ['nullable' => false], + ['nullable' => false, 'default' => \Magento\Framework\DB\Ddl\Table::TIMESTAMP_INIT], 'Created At' )->addColumn( 'updated_at', \Magento\Framework\DB\Ddl\Table::TYPE_TIMESTAMP, null, - ['nullable' => false], + ['nullable' => false, 'default' => \Magento\Framework\DB\Ddl\Table::TIMESTAMP_INIT_UPDATE], 'Updated At' )->addColumn( 'is_active', diff --git a/app/code/Magento/Integration/Setup/InstallSchema.php b/app/code/Magento/Integration/Setup/InstallSchema.php index 7c6bfda56692b..9588da6905210 100644 --- a/app/code/Magento/Integration/Setup/InstallSchema.php +++ b/app/code/Magento/Integration/Setup/InstallSchema.php @@ -316,13 +316,13 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con 'created_at', \Magento\Framework\DB\Ddl\Table::TYPE_TIMESTAMP, null, - ['nullable' => false], + ['nullable' => false, 'default' => \Magento\Framework\DB\Ddl\Table::TIMESTAMP_INIT], 'Creation Time' )->addColumn( 'updated_at', \Magento\Framework\DB\Ddl\Table::TYPE_TIMESTAMP, null, - ['nullable' => false], + ['nullable' => false, 'default' => \Magento\Framework\DB\Ddl\Table::TIMESTAMP_UPDATE], 'Update Time' )->addColumn( 'setup_type', diff --git a/app/code/Magento/Log/Setup/InstallSchema.php b/app/code/Magento/Log/Setup/InstallSchema.php index 1cf4f0832bf50..372d41188ca9e 100644 --- a/app/code/Magento/Log/Setup/InstallSchema.php +++ b/app/code/Magento/Log/Setup/InstallSchema.php @@ -95,7 +95,7 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con 'created_at', \Magento\Framework\DB\Ddl\Table::TYPE_TIMESTAMP, null, - ['nullable' => false], + ['nullable' => false, 'default' => \Magento\Framework\DB\Ddl\Table::TIMESTAMP_INIT], 'Creation Time' )->addColumn( 'deleted_at', @@ -147,7 +147,7 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con 'add_date', \Magento\Framework\DB\Ddl\Table::TYPE_TIMESTAMP, null, - ['nullable' => false], + ['nullable' => false, 'default' => \Magento\Framework\DB\Ddl\Table::TIMESTAMP_INIT], 'Date' )->setComment( 'Log Summary Table' diff --git a/app/code/Magento/ProductAlert/Setup/InstallSchema.php b/app/code/Magento/ProductAlert/Setup/InstallSchema.php index 8ccda0176f768..9926f11ef1196 100644 --- a/app/code/Magento/ProductAlert/Setup/InstallSchema.php +++ b/app/code/Magento/ProductAlert/Setup/InstallSchema.php @@ -63,7 +63,7 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con 'add_date', \Magento\Framework\DB\Ddl\Table::TYPE_TIMESTAMP, null, - ['nullable' => false], + ['nullable' => false, 'default' => \Magento\Framework\DB\Ddl\Table::TIMESTAMP_INIT], 'Product alert add date' )->addColumn( 'last_send_date', @@ -148,7 +148,7 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con 'add_date', \Magento\Framework\DB\Ddl\Table::TYPE_TIMESTAMP, null, - ['nullable' => false], + ['nullable' => false, 'default' => \Magento\Framework\DB\Ddl\Table::TIMESTAMP_INIT], 'Product alert add date' )->addColumn( 'send_date', diff --git a/app/code/Magento/Reports/Setup/InstallSchema.php b/app/code/Magento/Reports/Setup/InstallSchema.php index 707597f5a747a..7e619a704833f 100644 --- a/app/code/Magento/Reports/Setup/InstallSchema.php +++ b/app/code/Magento/Reports/Setup/InstallSchema.php @@ -73,7 +73,7 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con 'added_at', \Magento\Framework\DB\Ddl\Table::TYPE_TIMESTAMP, null, - ['nullable' => false], + ['nullable' => false, 'default' => \Magento\Framework\DB\Ddl\Table::TIMESTAMP_INIT], 'Added At' ) ->addIndex( @@ -181,7 +181,7 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con 'added_at', \Magento\Framework\DB\Ddl\Table::TYPE_TIMESTAMP, null, - ['nullable' => false], + ['nullable' => false, 'default' => \Magento\Framework\DB\Ddl\Table::TIMESTAMP_INIT], 'Added At' ) ->addIndex( @@ -288,7 +288,7 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con 'logged_at', \Magento\Framework\DB\Ddl\Table::TYPE_TIMESTAMP, null, - ['nullable' => false], + ['nullable' => false, 'default' => \Magento\Framework\DB\Ddl\Table::TIMESTAMP_INIT], 'Logged At' ) ->addColumn( @@ -411,7 +411,7 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con 'added_at', \Magento\Framework\DB\Ddl\Table::TYPE_TIMESTAMP, null, - ['nullable' => false], + ['nullable' => false, 'default' => \Magento\Framework\DB\Ddl\Table::TIMESTAMP_INIT], 'Added At' ) ->addIndex( @@ -517,7 +517,7 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con 'added_at', \Magento\Framework\DB\Ddl\Table::TYPE_TIMESTAMP, null, - ['nullable' => false], + ['nullable' => false, 'default' => \Magento\Framework\DB\Ddl\Table::TIMESTAMP_INIT], 'Added At' ) ->addIndex( diff --git a/app/code/Magento/Review/Setup/InstallSchema.php b/app/code/Magento/Review/Setup/InstallSchema.php index 276b7389bff8f..147688bdf15e3 100644 --- a/app/code/Magento/Review/Setup/InstallSchema.php +++ b/app/code/Magento/Review/Setup/InstallSchema.php @@ -84,7 +84,7 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con 'created_at', \Magento\Framework\DB\Ddl\Table::TYPE_TIMESTAMP, null, - ['nullable' => false], + ['nullable' => false, 'default' => \Magento\Framework\DB\Ddl\Table::TIMESTAMP_INIT], 'Review create date' ) ->addColumn( diff --git a/app/code/Magento/Sales/Setup/InstallSchema.php b/app/code/Magento/Sales/Setup/InstallSchema.php index fd517941e38a0..93192e49bb663 100644 --- a/app/code/Magento/Sales/Setup/InstallSchema.php +++ b/app/code/Magento/Sales/Setup/InstallSchema.php @@ -1308,13 +1308,13 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con 'created_at', \Magento\Framework\DB\Ddl\Table::TYPE_TIMESTAMP, null, - ['nullable' => false], + ['nullable' => false, 'default' => \Magento\Framework\DB\Ddl\Table::TIMESTAMP_INIT], 'Created At' )->addColumn( 'updated_at', \Magento\Framework\DB\Ddl\Table::TYPE_TIMESTAMP, null, - ['nullable' => false], + ['nullable' => false, 'default' => \Magento\Framework\DB\Ddl\Table::TIMESTAMP_INIT_UPDATE], 'Updated At' )->addColumn( 'product_id', diff --git a/app/code/Magento/Search/Setup/InstallSchema.php b/app/code/Magento/Search/Setup/InstallSchema.php index 3c20f81310ed0..d58c0da9a8946 100644 --- a/app/code/Magento/Search/Setup/InstallSchema.php +++ b/app/code/Magento/Search/Setup/InstallSchema.php @@ -104,7 +104,7 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con 'updated_at', \Magento\Framework\DB\Ddl\Table::TYPE_TIMESTAMP, null, - ['nullable' => false], + ['nullable' => false, 'default' => \Magento\Framework\DB\Ddl\Table::TIMESTAMP_INIT_UPDATE], 'Updated at' ) ->addIndex( diff --git a/composer.json b/composer.json index c4157852db4b0..93c1f2b024685 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { - "name": "magento/project-community-edition", - "description": "Magento project (Community Edition)", + "name": "magento/magento2ce", + "description": "Magento 2 (Community Edition)", "type": "project", "version": "0.74.0-beta5", "license": [ @@ -30,7 +30,7 @@ "zendframework/zend-log": "2.3.1", "zendframework/zend-http": "2.3.1", "magento/zendframework1": "1.12.10", - "composer/composer": "1.0.0-alpha8", + "composer/composer": "1.0.0-alpha9", "monolog/monolog": "1.11.0", "oyejorge/less.php": "1.7.0.3", "tubalmartin/cssmin": "2.4.8-p4", @@ -209,5 +209,7 @@ "Magento\\TestFramework\\Utility\\": "dev/tests/static/framework/Magento/TestFramework/Utility/", "Magento\\ToolkitFramework\\": "dev/tools/performance-toolkit/framework/Magento/ToolkitFramework/" } - } + }, + "minimum-stability": "alpha", + "prefer-stable": true } diff --git a/composer.lock b/composer.lock index 6494a34079ab5..036da6915e824 100644 --- a/composer.lock +++ b/composer.lock @@ -4,32 +4,32 @@ "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "8b3be7eb30da4335453ce07d0330ec4f", + "hash": "986eef2b3ae742a365a8a886f0babdd6", "packages": [ { "name": "composer/composer", - "version": "1.0.0-alpha8", + "version": "1.0.0-alpha9", "source": { "type": "git", "url": "https://github.com/composer/composer.git", - "reference": "1eb1df44a97fb2daca1bb8b007f3bee012f0aa46" + "reference": "eb1ce550ca51134ee619ad3e37f5a0b7e980dd24" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/composer/zipball/1eb1df44a97fb2daca1bb8b007f3bee012f0aa46", - "reference": "1eb1df44a97fb2daca1bb8b007f3bee012f0aa46", + "url": "https://api.github.com/repos/composer/composer/zipball/eb1ce550ca51134ee619ad3e37f5a0b7e980dd24", + "reference": "eb1ce550ca51134ee619ad3e37f5a0b7e980dd24", "shasum": "" }, "require": { - "justinrainbow/json-schema": "1.1.*", + "justinrainbow/json-schema": "~1.1", "php": ">=5.3.2", - "seld/jsonlint": "1.*", + "seld/jsonlint": "~1.0", "symfony/console": "~2.3", "symfony/finder": "~2.2", "symfony/process": "~2.1" }, "require-dev": { - "phpunit/phpunit": "~3.7.10" + "phpunit/phpunit": "~4.0" }, "suggest": { "ext-openssl": "Enabling the openssl extension allows you to access https URLs for repositories and packages", @@ -54,46 +54,57 @@ "MIT" ], "authors": [ - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be", - "role": "Developer" - }, { "name": "Nils Adermann", "email": "naderman@naderman.de", - "homepage": "http://www.naderman.de", - "role": "Developer" + "homepage": "http://www.naderman.de" + }, + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" } ], - "description": "Dependency Manager", + "description": "Composer helps you declare, manage and install dependencies of PHP projects, ensuring you have the right stack everywhere.", "homepage": "http://getcomposer.org/", "keywords": [ "autoload", "dependency", "package" ], - "time": "2014-01-06 18:39:59" + "time": "2014-12-07 17:15:20" }, { "name": "justinrainbow/json-schema", - "version": "1.1.0", + "version": "1.4.1", "source": { "type": "git", "url": "https://github.com/justinrainbow/json-schema.git", - "reference": "05ff6d8d79fe3ad190b0663d80d3f9deee79416c" + "reference": "2465fe486c864e30badaa4d005ebdf89dbc503f3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/justinrainbow/json-schema/zipball/05ff6d8d79fe3ad190b0663d80d3f9deee79416c", - "reference": "05ff6d8d79fe3ad190b0663d80d3f9deee79416c", + "url": "https://api.github.com/repos/justinrainbow/json-schema/zipball/2465fe486c864e30badaa4d005ebdf89dbc503f3", + "reference": "2465fe486c864e30badaa4d005ebdf89dbc503f3", "shasum": "" }, "require": { "php": ">=5.3.0" }, + "require-dev": { + "json-schema/json-schema-test-suite": "1.1.0", + "phpdocumentor/phpdocumentor": "~2", + "phpunit/phpunit": "~3.7" + }, + "bin": [ + "bin/validate-json" + ], "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4.x-dev" + } + }, "autoload": { "psr-0": { "JsonSchema": "src/" @@ -101,14 +112,9 @@ }, "notification-url": "https://packagist.org/downloads/", "license": [ - "NewBSD" + "BSD-3-Clause" ], "authors": [ - { - "name": "Igor Wiedler", - "email": "igor@wiedler.ch", - "homepage": "http://wiedler.ch/igor/" - }, { "name": "Bruno Prieto Reis", "email": "bruno.p.reis@gmail.com" @@ -117,10 +123,13 @@ "name": "Justin Rainbow", "email": "justin.rainbow@gmail.com" }, + { + "name": "Igor Wiedler", + "email": "igor@wiedler.ch" + }, { "name": "Robert Schönthal", - "email": "robert.schoenthal@gmail.com", - "homepage": "http://digitalkaoz.net" + "email": "seroscho@googlemail.com" } ], "description": "A library to validate a json schema.", @@ -129,7 +138,7 @@ "json", "schema" ], - "time": "2012-01-03 00:33:17" + "time": "2015-03-27 16:41:39" }, { "name": "magento/magento-composer-installer", @@ -2007,20 +2016,19 @@ }, { "name": "fabpot/php-cs-fixer", - "version": "v1.7", + "version": "v1.6.2", "source": { "type": "git", "url": "https://github.com/FriendsOfPHP/PHP-CS-Fixer.git", - "reference": "6425aeb97ab921371182712a18c280d546e7769b" + "reference": "a574ba148953fea1f78428d4b7c6843e759711f3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/6425aeb97ab921371182712a18c280d546e7769b", - "reference": "6425aeb97ab921371182712a18c280d546e7769b", + "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/a574ba148953fea1f78428d4b7c6843e759711f3", + "reference": "a574ba148953fea1f78428d4b7c6843e759711f3", "shasum": "" }, "require": { - "ext-tokenizer": "*", "php": ">=5.3.6", "sebastian/diff": "~1.1", "symfony/console": "~2.3", @@ -2057,7 +2065,7 @@ } ], "description": "A script to automatically fix Symfony Coding Standard", - "time": "2015-04-16 07:21:30" + "time": "2015-04-13 21:33:33" }, { "name": "league/climate", @@ -3415,12 +3423,12 @@ } ], "aliases": [], - "minimum-stability": "stable", + "minimum-stability": "alpha", "stability-flags": { "composer/composer": 15, "phpmd/phpmd": 0 }, - "prefer-stable": false, + "prefer-stable": true, "prefer-lowest": false, "platform": { "php": "~5.5.0|~5.6.0" diff --git a/dev/tests/functional/tests/app/Magento/Install/Test/Constraint/AssertAgreementTextPresent.php b/dev/tests/functional/tests/app/Magento/Install/Test/Constraint/AssertAgreementTextPresent.php index 7c59cf1d4c263..1bc49b0acc777 100644 --- a/dev/tests/functional/tests/app/Magento/Install/Test/Constraint/AssertAgreementTextPresent.php +++ b/dev/tests/functional/tests/app/Magento/Install/Test/Constraint/AssertAgreementTextPresent.php @@ -8,6 +8,7 @@ use Magento\Install\Test\Page\Install; use Magento\Mtf\Constraint\AbstractConstraint; +use Magento\TestFramework\Inspection\Exception; /** * Check that agreement text present on Terms & Agreement page during install. @@ -15,9 +16,14 @@ class AssertAgreementTextPresent extends AbstractConstraint { /** - * Part of license agreement text. + * Part of Default license agreement text. */ - const LICENSE_AGREEMENT_TEXT = 'Open Software License ("OSL") v. 3.0'; + const DEFAULT_LICENSE_AGREEMENT_TEXT = 'Open Software License ("OSL") v. 3.0'; + + /** + * Part of Default license agreement text. + */ + const LICENSE_AGREEMENT_TEXT = 'END USER LICENSE AGREEMENT'; /** * Assert that part of license agreement text is present on Terms & Agreement page. @@ -27,11 +33,19 @@ class AssertAgreementTextPresent extends AbstractConstraint */ public function processAssert(Install $installPage) { - \PHPUnit_Framework_Assert::assertContains( - self::LICENSE_AGREEMENT_TEXT, - $installPage->getLicenseBlock()->getLicense(), - 'License agreement text is absent.' - ); + try { + \PHPUnit_Framework_Assert::assertContains( + self::LICENSE_AGREEMENT_TEXT, + $installPage->getLicenseBlock()->getLicense(), + 'License agreement text is absent.' + ); + } catch (\Exception $e) { + \PHPUnit_Framework_Assert::assertContains( + self::DEFAULT_LICENSE_AGREEMENT_TEXT, + $installPage->getLicenseBlock()->getLicense(), + 'License agreement text is absent.' + ); + } } /** diff --git a/lib/internal/Magento/Framework/DB/Ddl/Table.php b/lib/internal/Magento/Framework/DB/Ddl/Table.php index eee5ed9bc320a..a623ba4c0fb33 100644 --- a/lib/internal/Magento/Framework/DB/Ddl/Table.php +++ b/lib/internal/Magento/Framework/DB/Ddl/Table.php @@ -59,7 +59,7 @@ class Table const MAX_VARBINARY_SIZE = 2147483648; /** - * Default values for timestampses - fill with current timestamp on inserting record, on changing and both cases + * Default values for timestamps - fill with current timestamp on inserting record, on changing and both cases */ const TIMESTAMP_INIT_UPDATE = 'TIMESTAMP_INIT_UPDATE'; diff --git a/lib/internal/Magento/Framework/Model/AbstractModel.php b/lib/internal/Magento/Framework/Model/AbstractModel.php index 43223069055fd..fcd03252a4160 100644 --- a/lib/internal/Magento/Framework/Model/AbstractModel.php +++ b/lib/internal/Magento/Framework/Model/AbstractModel.php @@ -127,6 +127,13 @@ abstract class AbstractModel extends \Magento\Framework\Object */ protected $_actionValidator; + /** + * Array to store object's original data + * + * @var array + */ + protected $storedData = []; + /** * @param \Magento\Framework\Model\Context $context * @param \Magento\Framework\Registry $registry @@ -301,6 +308,7 @@ public function load($modelId, $field = null) $this->_afterLoad(); $this->setOrigData(); $this->_hasDataChanges = false; + $this->updateStoredData(); return $this; } @@ -354,6 +362,7 @@ public function afterLoad() { $this->getResource()->afterLoad($this); $this->_afterLoad(); + $this->updateStoredData(); return $this; } @@ -566,6 +575,7 @@ public function afterSave() $this->_eventManager->dispatch('model_save_after', ['object' => $this]); $this->_eventManager->dispatch('clean_cache_by_tags', ['object' => $this]); $this->_eventManager->dispatch($this->_eventPrefix . '_save_after', $this->_getEventData()); + $this->updateStoredData(); return $this; } @@ -611,6 +621,7 @@ public function afterDelete() $this->_eventManager->dispatch('model_delete_after', ['object' => $this]); $this->_eventManager->dispatch('clean_cache_by_tags', ['object' => $this]); $this->_eventManager->dispatch($this->_eventPrefix . '_delete_after', $this->_getEventData()); + $this->storedData = []; return $this; } @@ -689,4 +700,29 @@ protected function _clearData() { return $this; } + + /** + * Synchronize object's stored data with the actual data + * + * @return $this + */ + private function updateStoredData() + { + if (isset($this->_data)) { + $this->storedData = $this->_data; + } else { + $this->storedData = []; + } + return $this; + } + + /** + * Model StoredData getter + * + * @return array + */ + public function getStoredData() + { + return $this->storedData; + } } diff --git a/lib/internal/Magento/Framework/Model/Resource/Db/AbstractDb.php b/lib/internal/Magento/Framework/Model/Resource/Db/AbstractDb.php index 393c90be8e000..351365b08d9eb 100644 --- a/lib/internal/Magento/Framework/Model/Resource/Db/AbstractDb.php +++ b/lib/internal/Magento/Framework/Model/Resource/Db/AbstractDb.php @@ -417,9 +417,10 @@ public function save(\Magento\Framework\Model\AbstractModel $object) * Not auto increment primary key support */ if ($this->_isPkAutoIncrement) { - $data = $this->_prepareDataForSave($object); - unset($data[$this->getIdFieldName()]); - $this->_getWriteAdapter()->update($this->getMainTable(), $data, $condition); + $data = $this->prepareDataForUpdate($object); + if (!empty($data)) { + $this->_getWriteAdapter()->update($this->getMainTable(), $data, $condition); + } } else { $select = $this->_getWriteAdapter()->select()->from( $this->getMainTable(), @@ -428,8 +429,7 @@ public function save(\Magento\Framework\Model\AbstractModel $object) $condition ); if ($this->_getWriteAdapter()->fetchOne($select) !== false) { - $data = $this->_prepareDataForSave($object); - unset($data[$this->getIdFieldName()]); + $data = $this->prepareDataForUpdate($object); if (!empty($data)) { $this->_getWriteAdapter()->update($this->getMainTable(), $data, $condition); } @@ -770,4 +770,27 @@ public function getChecksum($table) } return $checksum; } + + /** + * Get the array of data fields that was changed or added + * + * @param \Magento\Framework\Model\AbstractModel $object + * @return array + */ + protected function prepareDataForUpdate($object) + { + $data = $object->getData(); + foreach ($object->getStoredData() as $key => $value) { + if (array_key_exists($key, $data) && $data[$key] === $value) { + unset($data[$key]); + } + } + $dataObject = clone $object; + $dataObject->setData($data); + $data = $this->_prepareDataForTable($dataObject, $this->getMainTable()); + unset($data[$this->getIdFieldName()]); + unset($dataObject); + + return $data; + } } diff --git a/lib/internal/Magento/Framework/Model/Test/Unit/AbstractModelTest.php b/lib/internal/Magento/Framework/Model/Test/Unit/AbstractModelTest.php index 49b76a75b8ac3..71df4ee8ed947 100644 --- a/lib/internal/Magento/Framework/Model/Test/Unit/AbstractModelTest.php +++ b/lib/internal/Magento/Framework/Model/Test/Unit/AbstractModelTest.php @@ -108,4 +108,22 @@ public function testDelete() $this->resourceMock->expects($this->once())->method('delete')->with($this->model); $this->model->delete(); } + + public function testUpdateStoredData() + { + $this->model->setData( + [ + 'id' => 1000, + 'name' => 'Test Name' + ] + ); + $this->assertEmpty($this->model->getStoredData()); + $this->model->afterLoad(); + $this->assertEquals($this->model->getData(), $this->model->getStoredData()); + $this->model->setData('value', 'Test Value'); + $this->model->afterSave(); + $this->assertEquals($this->model->getData(), $this->model->getStoredData()); + $this->model->afterDelete(); + $this->assertEmpty($this->model->getStoredData()); + } } diff --git a/lib/internal/Magento/Framework/Model/Test/Unit/Resource/Db/AbstractDbTest.php b/lib/internal/Magento/Framework/Model/Test/Unit/Resource/Db/AbstractDbTest.php index 66e49e079e7f0..6745f6d62c741 100644 --- a/lib/internal/Magento/Framework/Model/Test/Unit/Resource/Db/AbstractDbTest.php +++ b/lib/internal/Magento/Framework/Model/Test/Unit/Resource/Db/AbstractDbTest.php @@ -61,7 +61,12 @@ protected function setUp() $this->_model = $this->getMockForAbstractClass( 'Magento\Framework\Model\Resource\Db\AbstractDb', - [$contextMock] + [$contextMock], + '', + true, + true, + true, + ['_prepareDataForTable'] ); } @@ -422,4 +427,85 @@ public function hasDataChangedDataProvider() [null, false] ]; } + + public function testPrepareDataForUpdate() + { + $adapterInterfaceMock = $this->getMock('\Magento\Framework\DB\Adapter\AdapterInterface', [], [], '', false); + $context = (new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this))->getObject( + 'Magento\Framework\Model\Context' + ); + $registryMock = $this->getMock('\Magento\Framework\Registry', [], [], '', false); + $resourceMock = $this->getMock( + 'Magento\Framework\Model\Resource\Db\AbstractDb', + [ + '_construct', + '_getReadAdapter', + '_getWriteAdapter', + '__wakeup', + 'getIdFieldName' + ], + [], + '', + false + ); + $adapterMock = $this->getMock('Magento\Framework\DB\Adapter\AdapterInterface', [], [], '', false); + $resourceMock->expects($this->any()) + ->method('_getWriteAdapter') + ->will($this->returnValue($adapterMock)); + $resourceCollectionMock = $this->getMock('Magento\Framework\Data\Collection\Db', [], [], '', false); + $abstractModelMock = $this->getMockForAbstractClass( + 'Magento\Framework\Model\AbstractModel', + [$context, $registryMock, $resourceMock, $resourceCollectionMock] + ); + $data = 'tableName'; + $this->_resourcesMock->expects($this->any()) + ->method('getConnection') + ->will($this->returnValue($adapterInterfaceMock) + ); + $this->_resourcesMock->expects($this->any())->method('getTableName')->with($data)->will( + $this->returnValue('tableName') + ); + $this->_resourcesMock->expects($this->any()) + ->method('_getWriteAdapter') + ->will($this->returnValue($adapterInterfaceMock)); + $mainTableReflection = new \ReflectionProperty( + 'Magento\Framework\Model\Resource\Db\AbstractDb', + '_mainTable' + ); + $mainTableReflection->setAccessible(true); + $mainTableReflection->setValue($this->_model, 'tableName'); + $idFieldNameReflection = new \ReflectionProperty( + 'Magento\Framework\Model\Resource\Db\AbstractDb', + '_idFieldName' + ); + $idFieldNameReflection->setAccessible(true); + $idFieldNameReflection->setValue($this->_model, 'idFieldName'); + $adapterInterfaceMock->expects($this->any())->method('save')->with('tableName', 'idFieldName'); + $adapterInterfaceMock->expects($this->any())->method('quoteInto')->will($this->returnValue('idFieldName')); + + $abstractModelMock->setIdFieldName('id'); + $abstractModelMock->setData( + [ + 'id' => 12345, + 'name' => 'Test Name', + 'value' => 'Test Value' + ] + ); + $abstractModelMock->afterLoad(); + $this->assertEquals($abstractModelMock->getData(), $abstractModelMock->getStoredData()); + $newData = ['value' => 'Test Value New']; + $this->_model->expects($this->once())->method('_prepareDataForTable')->will($this->returnValue($newData)); + $abstractModelMock->addData($newData); + $this->assertNotEquals($abstractModelMock->getData(), $abstractModelMock->getStoredData()); + $abstractModelMock->isObjectNew(false); + $adapterInterfaceMock->expects($this->once()) + ->method('update') + ->with( + 'tableName', + $newData, + 'idFieldName' + ); + + $this->_model->save($abstractModelMock); + } } diff --git a/setup/src/Magento/Setup/Model/License.php b/setup/src/Magento/Setup/Model/License.php index beb3d857aedea..1c7458bd3404c 100644 --- a/setup/src/Magento/Setup/Model/License.php +++ b/setup/src/Magento/Setup/Model/License.php @@ -16,12 +16,19 @@ */ class License { + /** + * Default License File location + * + * @var string + */ + const DEFAULT_LICENSE_FILENAME = 'LICENSE.txt'; + /** * License File location * * @var string */ - const LICENSE_FILENAME = 'LICENSE.txt'; + const LICENSE_FILENAME = 'LICENSE_EE.txt'; /** * Directory that contains license file @@ -43,13 +50,16 @@ public function __construct(Filesystem $filesystem) /** * Returns contents of License file. * - * @return string + * @return string|boolean */ public function getContents() { - if (!$this->dir->isFile(self::LICENSE_FILENAME)) { + if ($this->dir->isFile(self::LICENSE_FILENAME)) { + return $this->dir->readFile(self::LICENSE_FILENAME); + } elseif ($this->dir->isFile(self::DEFAULT_LICENSE_FILENAME)) { + return $this->dir->readFile(self::DEFAULT_LICENSE_FILENAME); + } else { return false; } - return $this->dir->readFile(self::LICENSE_FILENAME); } } diff --git a/setup/src/Magento/Setup/Test/Unit/Model/LicenseTest.php b/setup/src/Magento/Setup/Test/Unit/Model/LicenseTest.php index 1d8f9f3accce0..3bb5a5324c33e 100644 --- a/setup/src/Magento/Setup/Test/Unit/Model/LicenseTest.php +++ b/setup/src/Magento/Setup/Test/Unit/Model/LicenseTest.php @@ -33,14 +33,12 @@ public function setUp() public function testGetContents() { $this->directoryReadMock - ->expects($this->once()) + ->expects($this->atLeastOnce()) ->method('readFile') - ->with(License::LICENSE_FILENAME) ->will($this->returnValue('License text')); $this->directoryReadMock - ->expects($this->once()) + ->expects($this->atLeastOnce()) ->method('isFile') - ->with(License::LICENSE_FILENAME) ->will($this->returnValue(true)); $license = new License($this->filesystemMock); @@ -50,9 +48,8 @@ public function testGetContents() public function testGetContentsNoFile() { $this->directoryReadMock - ->expects($this->once()) + ->expects($this->atLeastOnce()) ->method('isFile') - ->with(License::LICENSE_FILENAME) ->will($this->returnValue(false)); $license = new License($this->filesystemMock);