From 2a0b7c9fba953b3180dcc4ad51b2cdf9e73cb486 Mon Sep 17 00:00:00 2001 From: J Ryan Wagner Date: Thu, 23 Jun 2022 17:12:18 -0400 Subject: [PATCH] Jabxjab archive dump command updates (#5165) * field-delete: Fix field being deleted from all bundles instead of only the requested bundle (#5158) * Updates input default options and provides destination validation. * Removes automatic composer install and adds user feedback. * Resolves phpcs feedback. * Adds composer install to test to allow Drupal installation. * Resolves code sniff. * Adds needed class. * Runs composer update to resolve security warnings. * Updates guzzle version. Co-authored-by: Dieter Holvoet Co-authored-by: Ryan Wagner --- composer.json | 2 +- composer.lock | 301 +++++++++--------- src/Commands/core/ArchiveDumpCommands.php | 44 ++- src/Commands/core/ArchiveRestoreCommands.php | 12 +- .../Commands/field/FieldDeleteCommands.php | 4 +- tests/functional/ArchiveTest.php | 15 + 6 files changed, 205 insertions(+), 173 deletions(-) diff --git a/composer.json b/composer.json index 36a258e450..a60c675c8d 100644 --- a/composer.json +++ b/composer.json @@ -41,7 +41,7 @@ "consolidation/site-alias": "^3.1.3", "consolidation/site-process": "^4.1.3 || ^5", "enlightn/security-checker": "^1", - "guzzlehttp/guzzle": "^6.3 || ^7.0", + "guzzlehttp/guzzle": "^6.5 || ^7.0", "league/container": "^3.4 || ^4", "psy/psysh": "~0.11", "symfony/event-dispatcher": "^4.0 || ^5.0 || ^6.0", diff --git a/composer.lock b/composer.lock index 7a56a63af1..c11783440d 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "eb7c538821997a9476b29e01705ce17f", + "content-hash": "f76084172fce10bbe10655f5ada923d2", "packages": [ { "name": "chi-teck/drupal-code-generator", @@ -151,16 +151,16 @@ }, { "name": "consolidation/annotated-command", - "version": "4.5.5", + "version": "4.5.6", "source": { "type": "git", "url": "https://github.com/consolidation/annotated-command.git", - "reference": "67cea8e8e7656b74da651ea6f49321853996c0fd" + "reference": "3968070538761628546270935f0733a0cc408e1f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/consolidation/annotated-command/zipball/67cea8e8e7656b74da651ea6f49321853996c0fd", - "reference": "67cea8e8e7656b74da651ea6f49321853996c0fd", + "url": "https://api.github.com/repos/consolidation/annotated-command/zipball/3968070538761628546270935f0733a0cc408e1f", + "reference": "3968070538761628546270935f0733a0cc408e1f", "shasum": "" }, "require": { @@ -201,22 +201,22 @@ "description": "Initialize Symfony Console commands from annotated command class methods.", "support": { "issues": "https://github.com/consolidation/annotated-command/issues", - "source": "https://github.com/consolidation/annotated-command/tree/4.5.5" + "source": "https://github.com/consolidation/annotated-command/tree/4.5.6" }, - "time": "2022-04-26T16:18:25+00:00" + "time": "2022-06-22T20:17:12+00:00" }, { "name": "consolidation/config", - "version": "2.1.0", + "version": "2.1.1", "source": { "type": "git", "url": "https://github.com/consolidation/config.git", - "reference": "0c15841b2bf60d9af1ce29884673e7d9d50c3b75" + "reference": "dae810c162f0e799ea3f35cc2f40b0797b6e4d26" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/consolidation/config/zipball/0c15841b2bf60d9af1ce29884673e7d9d50c3b75", - "reference": "0c15841b2bf60d9af1ce29884673e7d9d50c3b75", + "url": "https://api.github.com/repos/consolidation/config/zipball/dae810c162f0e799ea3f35cc2f40b0797b6e4d26", + "reference": "dae810c162f0e799ea3f35cc2f40b0797b6e4d26", "shasum": "" }, "require": { @@ -261,9 +261,9 @@ "description": "Provide configuration services for a commandline tool.", "support": { "issues": "https://github.com/consolidation/config/issues", - "source": "https://github.com/consolidation/config/tree/2.1.0" + "source": "https://github.com/consolidation/config/tree/2.1.1" }, - "time": "2022-02-24T00:32:42+00:00" + "time": "2022-06-22T19:59:34+00:00" }, { "name": "consolidation/filter-via-dot-access-data", @@ -890,24 +890,24 @@ }, { "name": "guzzlehttp/guzzle", - "version": "6.5.7", + "version": "6.5.8", "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", - "reference": "724562fa861e21a4071c652c8a159934e4f05592" + "reference": "a52f0440530b54fa079ce76e8c5d196a42cad981" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/724562fa861e21a4071c652c8a159934e4f05592", - "reference": "724562fa861e21a4071c652c8a159934e4f05592", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/a52f0440530b54fa079ce76e8c5d196a42cad981", + "reference": "a52f0440530b54fa079ce76e8c5d196a42cad981", "shasum": "" }, "require": { "ext-json": "*", "guzzlehttp/promises": "^1.0", - "guzzlehttp/psr7": "^1.6.1", + "guzzlehttp/psr7": "^1.9", "php": ">=5.5", - "symfony/polyfill-intl-idn": "^1.17.0" + "symfony/polyfill-intl-idn": "^1.17" }, "require-dev": { "ext-curl": "*", @@ -985,7 +985,7 @@ ], "support": { "issues": "https://github.com/guzzle/guzzle/issues", - "source": "https://github.com/guzzle/guzzle/tree/6.5.7" + "source": "https://github.com/guzzle/guzzle/tree/6.5.8" }, "funding": [ { @@ -1001,7 +1001,7 @@ "type": "tidelift" } ], - "time": "2022-06-09T21:36:50+00:00" + "time": "2022-06-20T22:16:07+00:00" }, { "name": "guzzlehttp/promises", @@ -1089,16 +1089,16 @@ }, { "name": "guzzlehttp/psr7", - "version": "1.8.5", + "version": "1.9.0", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "337e3ad8e5716c15f9657bd214d16cc5e69df268" + "reference": "e98e3e6d4f86621a9b75f623996e6bbdeb4b9318" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/337e3ad8e5716c15f9657bd214d16cc5e69df268", - "reference": "337e3ad8e5716c15f9657bd214d16cc5e69df268", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/e98e3e6d4f86621a9b75f623996e6bbdeb4b9318", + "reference": "e98e3e6d4f86621a9b75f623996e6bbdeb4b9318", "shasum": "" }, "require": { @@ -1119,7 +1119,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.7-dev" + "dev-master": "1.9-dev" } }, "autoload": { @@ -1179,7 +1179,7 @@ ], "support": { "issues": "https://github.com/guzzle/psr7/issues", - "source": "https://github.com/guzzle/psr7/tree/1.8.5" + "source": "https://github.com/guzzle/psr7/tree/1.9.0" }, "funding": [ { @@ -1195,7 +1195,7 @@ "type": "tidelift" } ], - "time": "2022-03-20T21:51:18+00:00" + "time": "2022-06-20T21:43:03+00:00" }, { "name": "league/container", @@ -1337,20 +1337,20 @@ }, { "name": "psr/container", - "version": "1.1.1", + "version": "1.1.2", "source": { "type": "git", "url": "https://github.com/php-fig/container.git", - "reference": "8622567409010282b7aeebe4bb841fe98b58dcaf" + "reference": "513e0666f7216c7459170d56df27dfcefe1689ea" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/container/zipball/8622567409010282b7aeebe4bb841fe98b58dcaf", - "reference": "8622567409010282b7aeebe4bb841fe98b58dcaf", + "url": "https://api.github.com/repos/php-fig/container/zipball/513e0666f7216c7459170d56df27dfcefe1689ea", + "reference": "513e0666f7216c7459170d56df27dfcefe1689ea", "shasum": "" }, "require": { - "php": ">=7.2.0" + "php": ">=7.4.0" }, "type": "library", "autoload": { @@ -1379,9 +1379,9 @@ ], "support": { "issues": "https://github.com/php-fig/container/issues", - "source": "https://github.com/php-fig/container/tree/1.1.1" + "source": "https://github.com/php-fig/container/tree/1.1.2" }, - "time": "2021-03-05T17:36:06+00:00" + "time": "2021-11-05T16:50:12+00:00" }, { "name": "psr/http-message", @@ -3877,16 +3877,16 @@ }, { "name": "doctrine/reflection", - "version": "1.2.2", + "version": "1.2.3", "source": { "type": "git", "url": "https://github.com/doctrine/reflection.git", - "reference": "fa587178be682efe90d005e3a322590d6ebb59a5" + "reference": "1034e5e71f89978b80f9c1570e7226f6c3b9b6fb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/reflection/zipball/fa587178be682efe90d005e3a322590d6ebb59a5", - "reference": "fa587178be682efe90d005e3a322590d6ebb59a5", + "url": "https://api.github.com/repos/doctrine/reflection/zipball/1034e5e71f89978b80f9c1570e7226f6c3b9b6fb", + "reference": "1034e5e71f89978b80f9c1570e7226f6c3b9b6fb", "shasum": "" }, "require": { @@ -3898,18 +3898,13 @@ "doctrine/common": "<2.9" }, "require-dev": { - "doctrine/coding-standard": "^6.0 || ^8.2.0", - "doctrine/common": "^2.10", - "phpstan/phpstan": "^0.11.0 || ^0.12.20", - "phpstan/phpstan-phpunit": "^0.11.0 || ^0.12.16", - "phpunit/phpunit": "^7.5 || ^9.1.5" + "doctrine/coding-standard": "^9", + "doctrine/common": "^3.3", + "phpstan/phpstan": "^1.4.10", + "phpstan/phpstan-phpunit": "^1", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.2.x-dev" - } - }, "autoload": { "psr-4": { "Doctrine\\Common\\": "lib/Doctrine/Common" @@ -3953,23 +3948,23 @@ ], "support": { "issues": "https://github.com/doctrine/reflection/issues", - "source": "https://github.com/doctrine/reflection/tree/1.2.2" + "source": "https://github.com/doctrine/reflection/tree/1.2.3" }, "abandoned": "roave/better-reflection", - "time": "2020-10-27T21:46:55+00:00" + "time": "2022-05-31T18:46:25+00:00" }, { "name": "drupal/core", - "version": "9.4.0-rc2", + "version": "9.4.1", "source": { "type": "git", "url": "https://github.com/drupal/core.git", - "reference": "02340dc1f6596052080eabc7697d01fa4e95d4f7" + "reference": "81489e8f0d5fdcd5d502b561f0f8cdf5ccdda614" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/drupal/core/zipball/02340dc1f6596052080eabc7697d01fa4e95d4f7", - "reference": "02340dc1f6596052080eabc7697d01fa4e95d4f7", + "url": "https://api.github.com/repos/drupal/core/zipball/81489e8f0d5fdcd5d502b561f0f8cdf5ccdda614", + "reference": "81489e8f0d5fdcd5d502b561f0f8cdf5ccdda614", "shasum": "" }, "require": { @@ -3991,7 +3986,7 @@ "ext-spl": "*", "ext-tokenizer": "*", "ext-xml": "*", - "guzzlehttp/guzzle": "^6.5.7 || ^7.4.4", + "guzzlehttp/guzzle": "^6.5.8 || ^7.4.5", "laminas/laminas-diactoros": "^2.11", "laminas/laminas-feed": "^2.17", "masterminds/html5": "^2.7", @@ -4019,7 +4014,8 @@ "typo3/phar-stream-wrapper": "^3.1.3" }, "conflict": { - "drush/drush": "<8.1.10" + "drush/drush": "<8.1.10", + "symfony/http-foundation": "4.4.42" }, "replace": { "drupal/action": "self.version", @@ -4211,81 +4207,81 @@ ], "description": "Drupal is an open source content management platform powering millions of websites and applications.", "support": { - "source": "https://github.com/drupal/core/tree/9.4.0-rc2" + "source": "https://github.com/drupal/core/tree/9.4.1" }, - "time": "2022-06-10T19:15:41+00:00" + "time": "2022-06-21T20:53:48+00:00" }, { "name": "drupal/core-recommended", - "version": "9.4.0-rc2", + "version": "9.4.1", "source": { "type": "git", "url": "https://github.com/drupal/core-recommended.git", - "reference": "11d88111b7c3e32b108461ff076b0e823e9fb16e" + "reference": "a3ae54715ba7792fe596c2f6a73dfcef217b0577" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/drupal/core-recommended/zipball/11d88111b7c3e32b108461ff076b0e823e9fb16e", - "reference": "11d88111b7c3e32b108461ff076b0e823e9fb16e", + "url": "https://api.github.com/repos/drupal/core-recommended/zipball/a3ae54715ba7792fe596c2f6a73dfcef217b0577", + "reference": "a3ae54715ba7792fe596c2f6a73dfcef217b0577", "shasum": "" }, "require": { - "asm89/stack-cors": "1.3.0", - "composer/semver": "3.3.2", - "doctrine/annotations": "1.13.2", - "doctrine/lexer": "1.2.3", - "doctrine/reflection": "1.2.2", - "drupal/core": "9.4.0-rc2", - "egulias/email-validator": "3.2", - "guzzlehttp/guzzle": "6.5.7", - "guzzlehttp/promises": "1.5.1", - "guzzlehttp/psr7": "1.8.5", - "laminas/laminas-diactoros": "2.11.0", - "laminas/laminas-escaper": "2.9.0", - "laminas/laminas-feed": "2.17.0", - "laminas/laminas-stdlib": "3.7.1", - "masterminds/html5": "2.7.5", - "pear/archive_tar": "1.4.14", - "pear/console_getopt": "v1.4.3", - "pear/pear-core-minimal": "v1.10.11", - "pear/pear_exception": "v1.0.2", - "psr/cache": "1.0.1", - "psr/container": "1.1.1", - "psr/http-factory": "1.0.1", - "psr/http-message": "1.0.1", - "psr/log": "1.1.4", - "ralouphie/getallheaders": "3.0.3", - "stack/builder": "v1.0.6", - "symfony-cmf/routing": "2.3.4", - "symfony/console": "v4.4.42", - "symfony/debug": "v4.4.41", - "symfony/dependency-injection": "v4.4.42", - "symfony/deprecation-contracts": "v2.5.1", - "symfony/error-handler": "v4.4.41", - "symfony/event-dispatcher": "v4.4.42", - "symfony/event-dispatcher-contracts": "v1.1.12", - "symfony/http-client-contracts": "v2.5.1", - "symfony/http-foundation": "v4.4.42", - "symfony/http-kernel": "v4.4.42", - "symfony/mime": "v5.4.9", - "symfony/polyfill-ctype": "v1.25.0", - "symfony/polyfill-iconv": "v1.25.0", - "symfony/polyfill-intl-idn": "v1.25.0", - "symfony/polyfill-intl-normalizer": "v1.25.0", - "symfony/polyfill-mbstring": "v1.25.0", - "symfony/polyfill-php80": "v1.25.0", - "symfony/process": "v4.4.41", - "symfony/psr-http-message-bridge": "v2.1.2", - "symfony/routing": "v4.4.41", - "symfony/serializer": "v4.4.42", - "symfony/service-contracts": "v2.5.1", - "symfony/translation": "v4.4.41", - "symfony/translation-contracts": "v2.5.1", - "symfony/validator": "v4.4.41", - "symfony/var-dumper": "v5.4.9", - "symfony/yaml": "v4.4.37", - "twig/twig": "v2.15.1", - "typo3/phar-stream-wrapper": "v3.1.7" + "asm89/stack-cors": "~1.3.0", + "composer/semver": "~3.3.2", + "doctrine/annotations": "~1.13.2", + "doctrine/lexer": "~1.2.3", + "doctrine/reflection": "~1.2.3", + "drupal/core": "9.4.1", + "egulias/email-validator": "~3.2", + "guzzlehttp/guzzle": "~6.5.8", + "guzzlehttp/promises": "~1.5.1", + "guzzlehttp/psr7": "~1.9.0", + "laminas/laminas-diactoros": "~2.11.0", + "laminas/laminas-escaper": "~2.9.0", + "laminas/laminas-feed": "~2.17.0", + "laminas/laminas-stdlib": "~3.7.1", + "masterminds/html5": "~2.7.5", + "pear/archive_tar": "~1.4.14", + "pear/console_getopt": "~v1.4.3", + "pear/pear-core-minimal": "~v1.10.11", + "pear/pear_exception": "~v1.0.2", + "psr/cache": "~1.0.1", + "psr/container": "~1.1.1", + "psr/http-factory": "~1.0.1", + "psr/http-message": "~1.0.1", + "psr/log": "~1.1.4", + "ralouphie/getallheaders": "~3.0.3", + "stack/builder": "~v1.0.6", + "symfony-cmf/routing": "~2.3.4", + "symfony/console": "~v4.4.42", + "symfony/debug": "~v4.4.41", + "symfony/dependency-injection": "~v4.4.42", + "symfony/deprecation-contracts": "~v2.5.1", + "symfony/error-handler": "~v4.4.41", + "symfony/event-dispatcher": "~v4.4.42", + "symfony/event-dispatcher-contracts": "~v1.1.12", + "symfony/http-client-contracts": "~v2.5.1", + "symfony/http-foundation": "~v4.4.41", + "symfony/http-kernel": "~v4.4.42", + "symfony/mime": "~v5.4.9", + "symfony/polyfill-ctype": "~v1.25.0", + "symfony/polyfill-iconv": "~v1.25.0", + "symfony/polyfill-intl-idn": "~v1.25.0", + "symfony/polyfill-intl-normalizer": "~v1.25.0", + "symfony/polyfill-mbstring": "~v1.25.0", + "symfony/polyfill-php80": "~v1.25.0", + "symfony/process": "~v4.4.41", + "symfony/psr-http-message-bridge": "~v2.1.2", + "symfony/routing": "~v4.4.41", + "symfony/serializer": "~v4.4.42", + "symfony/service-contracts": "~v2.5.1", + "symfony/translation": "~v4.4.41", + "symfony/translation-contracts": "~v2.5.1", + "symfony/validator": "~v4.4.41", + "symfony/var-dumper": "~v5.4.9", + "symfony/yaml": "~v4.4.37", + "twig/twig": "~v2.15.1", + "typo3/phar-stream-wrapper": "~v3.1.7" }, "conflict": { "webflo/drupal-core-strict": "*" @@ -4295,11 +4291,11 @@ "license": [ "GPL-2.0-or-later" ], - "description": "Locked core dependencies; require this project INSTEAD OF drupal/core.", + "description": "Core and its dependencies with known-compatible minor versions. Require this project INSTEAD OF drupal/core.", "support": { - "source": "https://github.com/drupal/core-recommended/tree/9.4.0-rc2" + "source": "https://github.com/drupal/core-recommended/tree/9.4.1" }, - "time": "2022-06-10T19:15:41+00:00" + "time": "2022-06-21T20:53:48+00:00" }, { "name": "drupal/semver_example", @@ -4359,16 +4355,16 @@ }, { "name": "egulias/email-validator", - "version": "3.2", + "version": "3.2.1", "source": { "type": "git", "url": "https://github.com/egulias/EmailValidator.git", - "reference": "a5ed8d58ed0c340a7c2109f587951b1c84cf6286" + "reference": "f88dcf4b14af14a98ad96b14b2b317969eab6715" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/egulias/EmailValidator/zipball/a5ed8d58ed0c340a7c2109f587951b1c84cf6286", - "reference": "a5ed8d58ed0c340a7c2109f587951b1c84cf6286", + "url": "https://api.github.com/repos/egulias/EmailValidator/zipball/f88dcf4b14af14a98ad96b14b2b317969eab6715", + "reference": "f88dcf4b14af14a98ad96b14b2b317969eab6715", "shasum": "" }, "require": { @@ -4415,7 +4411,7 @@ ], "support": { "issues": "https://github.com/egulias/EmailValidator/issues", - "source": "https://github.com/egulias/EmailValidator/tree/3.2" + "source": "https://github.com/egulias/EmailValidator/tree/3.2.1" }, "funding": [ { @@ -4423,7 +4419,7 @@ "type": "github" } ], - "time": "2022-05-28T22:19:18+00:00" + "time": "2022-06-18T20:57:19+00:00" }, { "name": "jakeasmith/http_build_url", @@ -5522,16 +5518,16 @@ }, { "name": "phpstan/phpstan", - "version": "1.7.12", + "version": "1.7.15", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "32f10779d9cd88a9cbd972ec611a4148a3cbbc7e" + "reference": "cd0202ea1b1fc6d1bbe156c6e2e18a03e0ff160a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/32f10779d9cd88a9cbd972ec611a4148a3cbbc7e", - "reference": "32f10779d9cd88a9cbd972ec611a4148a3cbbc7e", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/cd0202ea1b1fc6d1bbe156c6e2e18a03e0ff160a", + "reference": "cd0202ea1b1fc6d1bbe156c6e2e18a03e0ff160a", "shasum": "" }, "require": { @@ -5557,7 +5553,7 @@ "description": "PHPStan - PHP Static Analysis Tool", "support": { "issues": "https://github.com/phpstan/phpstan/issues", - "source": "https://github.com/phpstan/phpstan/tree/1.7.12" + "source": "https://github.com/phpstan/phpstan/tree/1.7.15" }, "funding": [ { @@ -5577,7 +5573,7 @@ "type": "tidelift" } ], - "time": "2022-06-09T12:39:36+00:00" + "time": "2022-06-20T08:29:01+00:00" }, { "name": "phpunit/php-code-coverage", @@ -5899,16 +5895,16 @@ }, { "name": "phpunit/phpunit", - "version": "9.5.20", + "version": "9.5.21", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "12bc8879fb65aef2138b26fc633cb1e3620cffba" + "reference": "0e32b76be457de00e83213528f6bb37e2a38fcb1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/12bc8879fb65aef2138b26fc633cb1e3620cffba", - "reference": "12bc8879fb65aef2138b26fc633cb1e3620cffba", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/0e32b76be457de00e83213528f6bb37e2a38fcb1", + "reference": "0e32b76be457de00e83213528f6bb37e2a38fcb1", "shasum": "" }, "require": { @@ -5942,7 +5938,6 @@ "sebastian/version": "^3.0.2" }, "require-dev": { - "ext-pdo": "*", "phpspec/prophecy-phpunit": "^2.0.1" }, "suggest": { @@ -5986,7 +5981,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.20" + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.21" }, "funding": [ { @@ -5998,7 +5993,7 @@ "type": "github" } ], - "time": "2022-04-01T12:37:26+00:00" + "time": "2022-06-19T12:14:25+00:00" }, { "name": "psr/cache", @@ -7130,16 +7125,16 @@ }, { "name": "squizlabs/php_codesniffer", - "version": "3.7.0", + "version": "3.7.1", "source": { "type": "git", "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "a2cd51b45bcaef9c1f2a4bda48f2dd2fa2b95563" + "reference": "1359e176e9307e906dc3d890bcc9603ff6d90619" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/a2cd51b45bcaef9c1f2a4bda48f2dd2fa2b95563", - "reference": "a2cd51b45bcaef9c1f2a4bda48f2dd2fa2b95563", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/1359e176e9307e906dc3d890bcc9603ff6d90619", + "reference": "1359e176e9307e906dc3d890bcc9603ff6d90619", "shasum": "" }, "require": { @@ -7182,7 +7177,7 @@ "source": "https://github.com/squizlabs/PHP_CodeSniffer", "wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki" }, - "time": "2022-06-13T06:31:38+00:00" + "time": "2022-06-18T07:21:10+00:00" }, { "name": "stack/builder", @@ -7604,16 +7599,16 @@ }, { "name": "symfony/http-foundation", - "version": "v4.4.42", + "version": "v4.4.41", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "8e87b3ec23ebbcf7440d91dec8f7ca70dd591eb3" + "reference": "27441220aebeb096b4eb8267acaaa7feb5e4266c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/8e87b3ec23ebbcf7440d91dec8f7ca70dd591eb3", - "reference": "8e87b3ec23ebbcf7440d91dec8f7ca70dd591eb3", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/27441220aebeb096b4eb8267acaaa7feb5e4266c", + "reference": "27441220aebeb096b4eb8267acaaa7feb5e4266c", "shasum": "" }, "require": { @@ -7652,7 +7647,7 @@ "description": "Defines an object-oriented layer for the HTTP specification", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-foundation/tree/v4.4.42" + "source": "https://github.com/symfony/http-foundation/tree/v4.4.41" }, "funding": [ { @@ -7668,7 +7663,7 @@ "type": "tidelift" } ], - "time": "2022-05-17T11:15:18+00:00" + "time": "2022-04-21T07:22:34+00:00" }, { "name": "symfony/http-kernel", @@ -8742,5 +8737,5 @@ "platform-overrides": { "php": "7.4" }, - "plugin-api-version": "2.1.0" + "plugin-api-version": "2.2.0" } diff --git a/src/Commands/core/ArchiveDumpCommands.php b/src/Commands/core/ArchiveDumpCommands.php index 2d2acea0cb..90049d3fe6 100644 --- a/src/Commands/core/ArchiveDumpCommands.php +++ b/src/Commands/core/ArchiveDumpCommands.php @@ -15,6 +15,7 @@ use RecursiveCallbackFilterIterator; use RecursiveDirectoryIterator; use RecursiveIteratorIterator; +use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Filesystem\Filesystem; use Symfony\Component\Process\Process; use Symfony\Component\Yaml\Yaml; @@ -99,13 +100,13 @@ public function dump(array $options = [ 'code' => false, 'files' => false, 'db' => false, - 'destination' => null, + 'destination' => InputOption::VALUE_REQUIRED, 'overwrite' => false, - 'description' => null, - 'tags' => null, - 'generator' => null, - 'generatorversion' => null, - 'exclude-code-paths' => null, + 'description' => InputOption::VALUE_REQUIRED, + 'tags' => InputOption::VALUE_REQUIRED, + 'generator' => InputOption::VALUE_REQUIRED, + 'generatorversion' => InputOption::VALUE_REQUIRED, + 'exclude-code-paths' => InputOption::VALUE_REQUIRED, ]): string { $this->prepareArchiveDir(); @@ -191,6 +192,8 @@ private function createArchiveFile(array $archiveComponents, array $options): st return $archivePath; } + $options['destination'] = $this->destinationCleanup($options['destination']); + if ($this->filesystem->exists($options['destination'])) { if (!$options['overwrite']) { throw new Exception( @@ -244,7 +247,7 @@ private function createManifestFile(array $options): void } /** - * Returns TRUE is the site is a "web" docroot site. + * Returns TRUE if the site is a "web" docroot site. * * @return bool * @@ -571,4 +574,31 @@ private function validateSensitiveData(string $file, string $localFileName): voi ); } } + + /** + * Provides basic verification/correction on destination option. + * + * @param string $destination + * + * @return void + */ + private function destinationCleanup($destination) + { + // User input may be in the wrong format, this performs some basic + // corrections. The correct format should include a .tar.gz. + if (substr($destination, -7) !== ".tar.gz") { + // If the user provided .tar but not .gz. + if (substr($destination, -4) === ".tar") { + return $destination . ".gz"; + } + + // If neither, the user provided a directory. + if (substr($destination, -1) === "/") { + return $destination . "archive.tar.gz"; + } else { + return $destination . "/archive.tar.gz"; + } + } + return $destination; + } } diff --git a/src/Commands/core/ArchiveRestoreCommands.php b/src/Commands/core/ArchiveRestoreCommands.php index 48b8cd47f1..736d6743aa 100644 --- a/src/Commands/core/ArchiveRestoreCommands.php +++ b/src/Commands/core/ArchiveRestoreCommands.php @@ -299,18 +299,10 @@ protected function importCode(string $source, array $options): void $composerJsonPath = Path::join($this->getDestinationPath(), 'composer.json'); if (is_file($composerJsonPath)) { - $this->logger()->info( - dt('composer.json is found (!path), installing Composer dependencies...'), + $this->logger()->success( + dt('composer.json is found (!path), install Composer dependencies with composer install.'), ['!path' => $composerJsonPath] ); - $process = new Process( - ['composer', 'install'], - $this->getDestinationPath(), - null, - null, - $options['code-composer-install-timeout'] - ); - $process->mustRun(); } } diff --git a/src/Drupal/Commands/field/FieldDeleteCommands.php b/src/Drupal/Commands/field/FieldDeleteCommands.php index 3e9845b3bd..fa34f498d1 100644 --- a/src/Drupal/Commands/field/FieldDeleteCommands.php +++ b/src/Drupal/Commands/field/FieldDeleteCommands.php @@ -147,9 +147,9 @@ protected function deleteFieldConfig(FieldConfigInterface $fieldConfig): void if ($fieldStorage && !$fieldStorage->isLocked()) { $fieldConfig->delete(); - // If there is only one bundle left for this field storage, it will be + // If there are no bundles left for this field storage, it will be // deleted too, notify the user about dependencies. - if (count($fieldStorage->getBundles()) <= 1) { + if ($fieldStorage->getBundles() === []) { $fieldStorage->delete(); } diff --git a/tests/functional/ArchiveTest.php b/tests/functional/ArchiveTest.php index 5610012b67..7c7153ab0b 100644 --- a/tests/functional/ArchiveTest.php +++ b/tests/functional/ArchiveTest.php @@ -3,6 +3,7 @@ namespace Unish; use PharData; +use Symfony\Component\Process\Process; use Unish\Utils\FSUtils; use Webmozart\PathUtil\Path; @@ -197,6 +198,7 @@ public function testArchiveRestoreCommand(): void [$this->archivePath], $this->archiveRestoreOptions ); + $this->installComposerDependencies(); $this->assertRestoredSiteStatus(); // Restore the Drupal files from a source path. @@ -374,4 +376,17 @@ private function assertRestoredSiteStatus(): void $this->assertEquals(Path::join($this->restorePath, 'sut'), $restoredSiteStatus['root']); $this->assertEquals($this->fixtureDatabaseSettings['db-name'], $restoredSiteStatus['db-name']); } + + /** + * Executes `composer install` in the restored site's composer root. + */ + private function installComposerDependencies(): void + { + $process = new Process(['composer', 'install'], $this->restorePath, null, null, 180); + $process->run(); + $this->assertTrue( + $process->isSuccessful(), + sprintf('"composer install" has failed: %s', $process->getErrorOutput()) + ); + } }