From b769fdecab3ef072e410c448a96b081e389e8e67 Mon Sep 17 00:00:00 2001 From: Greg Anderson Date: Fri, 18 Feb 2022 11:00:22 -0800 Subject: [PATCH 01/18] Move enlightn/security-checker to "suggest" --- .circleci/config.yml | 4 +- composer.json | 4 +- composer.lock | 439 +++++++++------------ src/Commands/pm/SecurityUpdateCommands.php | 4 + 4 files changed, 202 insertions(+), 249 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 3673f29275..41d264f2bc 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -18,7 +18,8 @@ test_74_steps: &test74steps steps: - checkout - run: cp .docker/zz-php.ini /usr/local/etc/php/conf.d/ - - run: composer -n install + - run: composer -n require enlightn/security-checker --no-update + - run: composer -n update - run: mkdir -p /tmp/results - run: composer -n lint - run: composer -n unit -- --log-junit /tmp/results/unit.junit.xml @@ -103,6 +104,7 @@ jobs: - run: cp .docker/zz-php.ini /usr/local/etc/php/conf.d/ - run: composer -n require --dev drupal/core-recommended:9.2.8 --no-update - run: composer -n require symfony/polyfill-php80:"1.23 as 1.20" --no-update + - run: composer -n require enlightn/security-checker --no-update - run: php --version - run: composer -n update - run: composer -n phpunit -- --testsuite integration --filter=testInsecureDrupalPackage --stop-on-skipped diff --git a/composer.json b/composer.json index b5084b8028..b911583137 100644 --- a/composer.json +++ b/composer.json @@ -40,7 +40,6 @@ "consolidation/robo": "^3", "consolidation/site-alias": "^3.1.3", "consolidation/site-process": "^4.1.3", - "enlightn/security-checker": "^1", "guzzlehttp/guzzle": "^6.3 || ^7.0", "league/container": "^3.4", "psr/log": "~1.0", @@ -65,6 +64,9 @@ "vlucas/phpdotenv": "^2.4", "yoast/phpunit-polyfills": "^0.2.0" }, + "suggest": { + "enlightn/security-checker": "Required to use pm:security command" + }, "conflict": { "drupal/core": "< 9.2", "drupal/migrate_run": "*", diff --git a/composer.lock b/composer.lock index 705137efff..dbdbb0ecb7 100644 --- a/composer.lock +++ b/composer.lock @@ -4,20 +4,20 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "9df7660de2365d69b89b6efc50ad8ffe", + "content-hash": "a2d45a2e4cd072340b9aec6fe97386ee", "packages": [ { "name": "chi-teck/drupal-code-generator", - "version": "2.4.0", + "version": "2.4.1", "source": { "type": "git", "url": "https://github.com/Chi-teck/drupal-code-generator.git", - "reference": "872086aeeee1c933adc403d98c35dc029e26ae7c" + "reference": "e7261a46a839a3433e4bbe24eeeb21ed8805a7d3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Chi-teck/drupal-code-generator/zipball/872086aeeee1c933adc403d98c35dc029e26ae7c", - "reference": "872086aeeee1c933adc403d98c35dc029e26ae7c", + "url": "https://api.github.com/repos/Chi-teck/drupal-code-generator/zipball/e7261a46a839a3433e4bbe24eeeb21ed8805a7d3", + "reference": "e7261a46a839a3433e4bbe24eeeb21ed8805a7d3", "shasum": "" }, "require": { @@ -27,7 +27,7 @@ "symfony/console": "^4.4.15 || ^5.1", "symfony/filesystem": "^4.4 || ^5.1", "symfony/polyfill-php80": "^1.23", - "symfony/string": "^5.1", + "symfony/string": "^5.1 || ^6", "twig/twig": "^2.12 || ^3.1" }, "conflict": { @@ -64,9 +64,9 @@ "description": "Drupal code generator", "support": { "issues": "https://github.com/Chi-teck/drupal-code-generator/issues", - "source": "https://github.com/Chi-teck/drupal-code-generator/tree/2.4.0" + "source": "https://github.com/Chi-teck/drupal-code-generator/tree/2.4.1" }, - "time": "2022-01-18T04:19:55+00:00" + "time": "2022-01-18T18:48:57+00:00" }, { "name": "composer/semver", @@ -429,16 +429,16 @@ }, { "name": "consolidation/robo", - "version": "3.0.7", + "version": "3.0.8", "source": { "type": "git", "url": "https://github.com/consolidation/robo.git", - "reference": "57012db2a93c904ed0a7b9d8676c0325c0366bc8" + "reference": "a6b567570c0f86d5f82e1e638d3c384817c66551" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/consolidation/robo/zipball/57012db2a93c904ed0a7b9d8676c0325c0366bc8", - "reference": "57012db2a93c904ed0a7b9d8676c0325c0366bc8", + "url": "https://api.github.com/repos/consolidation/robo/zipball/a6b567570c0f86d5f82e1e638d3c384817c66551", + "reference": "a6b567570c0f86d5f82e1e638d3c384817c66551", "shasum": "" }, "require": { @@ -447,7 +447,7 @@ "consolidation/log": "^1.1.1 || ^2.0.2", "consolidation/output-formatters": "^4.1.2", "consolidation/self-update": "^2.0", - "league/container": "^3.3.1", + "league/container": "^3.3.1 || ^4.0", "php": ">=7.1.3", "symfony/console": "^4.4.19 || ^5 || ^6", "symfony/event-dispatcher": "^4.4.19 || ^5 || ^6", @@ -522,9 +522,9 @@ "description": "Modern task runner", "support": { "issues": "https://github.com/consolidation/robo/issues", - "source": "https://github.com/consolidation/robo/tree/3.0.7" + "source": "https://github.com/consolidation/robo/tree/3.0.8" }, - "time": "2021-12-31T01:01:31+00:00" + "time": "2022-02-15T17:58:50+00:00" }, { "name": "consolidation/self-update", @@ -699,30 +699,37 @@ }, { "name": "dflydev/dot-access-data", - "version": "v1.1.0", + "version": "v3.0.1", "source": { "type": "git", "url": "https://github.com/dflydev/dflydev-dot-access-data.git", - "reference": "3fbd874921ab2c041e899d044585a2ab9795df8a" + "reference": "0992cc19268b259a39e86f296da5f0677841f42c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/dflydev/dflydev-dot-access-data/zipball/3fbd874921ab2c041e899d044585a2ab9795df8a", - "reference": "3fbd874921ab2c041e899d044585a2ab9795df8a", + "url": "https://api.github.com/repos/dflydev/dflydev-dot-access-data/zipball/0992cc19268b259a39e86f296da5f0677841f42c", + "reference": "0992cc19268b259a39e86f296da5f0677841f42c", "shasum": "" }, "require": { - "php": ">=5.3.2" + "php": "^7.1 || ^8.0" + }, + "require-dev": { + "phpstan/phpstan": "^0.12.42", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.3", + "scrutinizer/ocular": "1.6.0", + "squizlabs/php_codesniffer": "^3.5", + "vimeo/psalm": "^3.14" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-main": "3.x-dev" } }, "autoload": { - "psr-0": { - "Dflydev\\DotAccessData": "src" + "psr-4": { + "Dflydev\\DotAccessData\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -744,6 +751,11 @@ "name": "Carlos Frutos", "email": "carlos@kiwing.it", "homepage": "https://github.com/cfrutos" + }, + { + "name": "Colin O'Dell", + "email": "colinodell@gmail.com", + "homepage": "https://www.colinodell.com" } ], "description": "Given a deep data structure, access data by dot notation.", @@ -756,99 +768,34 @@ ], "support": { "issues": "https://github.com/dflydev/dflydev-dot-access-data/issues", - "source": "https://github.com/dflydev/dflydev-dot-access-data/tree/master" - }, - "time": "2017-01-20T21:14:22+00:00" - }, - { - "name": "enlightn/security-checker", - "version": "v1.9.0", - "source": { - "type": "git", - "url": "https://github.com/enlightn/security-checker.git", - "reference": "dc5bce653fa4d9c792e9dcffa728c0642847c1e1" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/enlightn/security-checker/zipball/dc5bce653fa4d9c792e9dcffa728c0642847c1e1", - "reference": "dc5bce653fa4d9c792e9dcffa728c0642847c1e1", - "shasum": "" - }, - "require": { - "ext-json": "*", - "guzzlehttp/guzzle": "^6.3|^7.0", - "php": ">=5.6", - "symfony/console": "^3.4|^4|^5", - "symfony/finder": "^3|^4|^5", - "symfony/process": "^3.4|^4|^5", - "symfony/yaml": "^3.4|^4|^5" - }, - "require-dev": { - "ext-zip": "*", - "friendsofphp/php-cs-fixer": "^2.18", - "phpunit/phpunit": "^5.5|^6|^7|^8|^9" - }, - "bin": [ - "security-checker" - ], - "type": "library", - "autoload": { - "psr-4": { - "Enlightn\\SecurityChecker\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Paras Malhotra", - "email": "paras@laravel-enlightn.com" - }, - { - "name": "Miguel Piedrafita", - "email": "soy@miguelpiedrafita.com" - } - ], - "description": "A PHP dependency vulnerabilities scanner based on the Security Advisories Database.", - "keywords": [ - "package", - "php", - "scanner", - "security", - "security advisories", - "vulnerability scanner" - ], - "support": { - "issues": "https://github.com/enlightn/security-checker/issues", - "source": "https://github.com/enlightn/security-checker/tree/v1.9.0" + "source": "https://github.com/dflydev/dflydev-dot-access-data/tree/v3.0.1" }, - "time": "2021-05-06T09:03:35+00:00" + "time": "2021-08-13T13:06:58+00:00" }, { "name": "grasmash/expander", - "version": "1.0.0", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/grasmash/expander.git", - "reference": "95d6037344a4be1dd5f8e0b0b2571a28c397578f" + "reference": "84c256112763e00d09b437d269897339ca1ceaf4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/grasmash/expander/zipball/95d6037344a4be1dd5f8e0b0b2571a28c397578f", - "reference": "95d6037344a4be1dd5f8e0b0b2571a28c397578f", + "url": "https://api.github.com/repos/grasmash/expander/zipball/84c256112763e00d09b437d269897339ca1ceaf4", + "reference": "84c256112763e00d09b437d269897339ca1ceaf4", "shasum": "" }, "require": { - "dflydev/dot-access-data": "^1.1.0", - "php": ">=5.4" + "dflydev/dot-access-data": "^3.0.0", + "php": ">=5.6", + "psr/log": "^1.0" }, "require-dev": { "greg-1-anderson/composer-test-scenarios": "^1", - "phpunit/phpunit": "^4|^5.5.4", - "satooshi/php-coveralls": "^1.0.2|dev-master", - "squizlabs/php_codesniffer": "^2.7" + "php-coveralls/php-coveralls": "^2.0", + "phpunit/phpunit": "^6.0 || ^8.0 || ^9", + "squizlabs/php_codesniffer": "^2.7 || ^3.3" }, "type": "library", "extra": { @@ -873,9 +820,9 @@ "description": "Expands internal property references in PHP arrays file.", "support": { "issues": "https://github.com/grasmash/expander/issues", - "source": "https://github.com/grasmash/expander/tree/master" + "source": "https://github.com/grasmash/expander/tree/2.0.0" }, - "time": "2017-12-21T22:14:55+00:00" + "time": "2021-12-08T01:46:56+00:00" }, { "name": "guzzlehttp/guzzle", @@ -913,12 +860,12 @@ } }, "autoload": { - "psr-4": { - "GuzzleHttp\\": "src/" - }, "files": [ "src/functions_include.php" - ] + ], + "psr-4": { + "GuzzleHttp\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -1068,12 +1015,12 @@ } }, "autoload": { - "psr-4": { - "GuzzleHttp\\Psr7\\": "src/" - }, "files": [ "src/functions_include.php" - ] + ], + "psr-4": { + "GuzzleHttp\\Psr7\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -1430,16 +1377,16 @@ }, { "name": "psy/psysh", - "version": "v0.11.0", + "version": "v0.11.1", "source": { "type": "git", "url": "https://github.com/bobthecow/psysh.git", - "reference": "c9a85cd388afde68721d304bbb3257a068f5ab05" + "reference": "570292577277f06f590635381a7f761a6cf4f026" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/bobthecow/psysh/zipball/c9a85cd388afde68721d304bbb3257a068f5ab05", - "reference": "c9a85cd388afde68721d304bbb3257a068f5ab05", + "url": "https://api.github.com/repos/bobthecow/psysh/zipball/570292577277f06f590635381a7f761a6cf4f026", + "reference": "570292577277f06f590635381a7f761a6cf4f026", "shasum": "" }, "require": { @@ -1499,9 +1446,9 @@ ], "support": { "issues": "https://github.com/bobthecow/psysh/issues", - "source": "https://github.com/bobthecow/psysh/tree/v0.11.0" + "source": "https://github.com/bobthecow/psysh/tree/v0.11.1" }, - "time": "2021-12-05T06:09:05+00:00" + "time": "2022-01-03T13:58:38+00:00" }, { "name": "ralouphie/getallheaders", @@ -1869,16 +1816,16 @@ }, { "name": "symfony/filesystem", - "version": "v5.4.0", + "version": "v5.4.3", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "731f917dc31edcffec2c6a777f3698c33bea8f01" + "reference": "0f0c4bf1840420f4aef3f32044a9dbb24682731b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/731f917dc31edcffec2c6a777f3698c33bea8f01", - "reference": "731f917dc31edcffec2c6a777f3698c33bea8f01", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/0f0c4bf1840420f4aef3f32044a9dbb24682731b", + "reference": "0f0c4bf1840420f4aef3f32044a9dbb24682731b", "shasum": "" }, "require": { @@ -1913,7 +1860,7 @@ "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v5.4.0" + "source": "https://github.com/symfony/filesystem/tree/v5.4.3" }, "funding": [ { @@ -1929,20 +1876,20 @@ "type": "tidelift" } ], - "time": "2021-10-28T13:39:27+00:00" + "time": "2022-01-02T09:53:40+00:00" }, { "name": "symfony/finder", - "version": "v5.4.2", + "version": "v5.4.3", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "e77046c252be48c48a40816187ed527703c8f76c" + "reference": "231313534dded84c7ecaa79d14bc5da4ccb69b7d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/e77046c252be48c48a40816187ed527703c8f76c", - "reference": "e77046c252be48c48a40816187ed527703c8f76c", + "url": "https://api.github.com/repos/symfony/finder/zipball/231313534dded84c7ecaa79d14bc5da4ccb69b7d", + "reference": "231313534dded84c7ecaa79d14bc5da4ccb69b7d", "shasum": "" }, "require": { @@ -1976,7 +1923,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v5.4.2" + "source": "https://github.com/symfony/finder/tree/v5.4.3" }, "funding": [ { @@ -1992,7 +1939,7 @@ "type": "tidelift" } ], - "time": "2021-12-15T11:06:13+00:00" + "time": "2022-01-26T16:34:36+00:00" }, { "name": "symfony/polyfill-ctype", @@ -2104,12 +2051,12 @@ } }, "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Intl\\Grapheme\\": "" - }, "files": [ "bootstrap.php" - ] + ], + "psr-4": { + "Symfony\\Polyfill\\Intl\\Grapheme\\": "" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -2187,12 +2134,12 @@ } }, "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Intl\\Idn\\": "" - }, "files": [ "bootstrap.php" - ] + ], + "psr-4": { + "Symfony\\Polyfill\\Intl\\Idn\\": "" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -2272,12 +2219,12 @@ } }, "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Intl\\Normalizer\\": "" - }, "files": [ "bootstrap.php" ], + "psr-4": { + "Symfony\\Polyfill\\Intl\\Normalizer\\": "" + }, "classmap": [ "Resources/stubs" ] @@ -2356,12 +2303,12 @@ } }, "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Mbstring\\": "" - }, "files": [ "bootstrap.php" - ] + ], + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -2433,12 +2380,12 @@ } }, "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Php72\\": "" - }, "files": [ "bootstrap.php" - ] + ], + "psr-4": { + "Symfony\\Polyfill\\Php72\\": "" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -2509,12 +2456,12 @@ } }, "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Php73\\": "" - }, "files": [ "bootstrap.php" ], + "psr-4": { + "Symfony\\Polyfill\\Php73\\": "" + }, "classmap": [ "Resources/stubs" ] @@ -2588,12 +2535,12 @@ } }, "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Php80\\": "" - }, "files": [ "bootstrap.php" ], + "psr-4": { + "Symfony\\Polyfill\\Php80\\": "" + }, "classmap": [ "Resources/stubs" ] @@ -2790,16 +2737,16 @@ }, { "name": "symfony/string", - "version": "v5.4.2", + "version": "v5.4.3", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "e6a5d5ecf6589c5247d18e0e74e30b11dfd51a3d" + "reference": "92043b7d8383e48104e411bc9434b260dbeb5a10" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/e6a5d5ecf6589c5247d18e0e74e30b11dfd51a3d", - "reference": "e6a5d5ecf6589c5247d18e0e74e30b11dfd51a3d", + "url": "https://api.github.com/repos/symfony/string/zipball/92043b7d8383e48104e411bc9434b260dbeb5a10", + "reference": "92043b7d8383e48104e411bc9434b260dbeb5a10", "shasum": "" }, "require": { @@ -2856,7 +2803,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v5.4.2" + "source": "https://github.com/symfony/string/tree/v5.4.3" }, "funding": [ { @@ -2872,7 +2819,7 @@ "type": "tidelift" } ], - "time": "2021-12-16T21:52:00+00:00" + "time": "2022-01-02T09:53:40+00:00" }, { "name": "symfony/var-dumper", @@ -3036,22 +2983,23 @@ }, { "name": "twig/twig", - "version": "v2.14.7", + "version": "v2.14.11", "source": { "type": "git", "url": "https://github.com/twigphp/Twig.git", - "reference": "8e202327ee1ed863629de9b18a5ec70ac614d88f" + "reference": "66baa66f29ee30e487e05f1679903e36eb01d727" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/8e202327ee1ed863629de9b18a5ec70ac614d88f", - "reference": "8e202327ee1ed863629de9b18a5ec70ac614d88f", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/66baa66f29ee30e487e05f1679903e36eb01d727", + "reference": "66baa66f29ee30e487e05f1679903e36eb01d727", "shasum": "" }, "require": { - "php": ">=7.2.5", + "php": ">=7.1.3", "symfony/polyfill-ctype": "^1.8", - "symfony/polyfill-mbstring": "^1.3" + "symfony/polyfill-mbstring": "^1.3", + "symfony/polyfill-php72": "^1.8" }, "require-dev": { "psr/container": "^1.0", @@ -3099,7 +3047,7 @@ ], "support": { "issues": "https://github.com/twigphp/Twig/issues", - "source": "https://github.com/twigphp/Twig/tree/v2.14.7" + "source": "https://github.com/twigphp/Twig/tree/v2.14.11" }, "funding": [ { @@ -3111,7 +3059,7 @@ "type": "tidelift" } ], - "time": "2021-09-17T08:39:54+00:00" + "time": "2022-02-04T06:57:25+00:00" }, { "name": "webflo/drupal-finder", @@ -3477,16 +3425,16 @@ }, { "name": "cweagans/composer-patches", - "version": "1.7.1", + "version": "1.7.2", "source": { "type": "git", "url": "https://github.com/cweagans/composer-patches.git", - "reference": "9888dcc74993c030b75f3dd548bb5e20cdbd740c" + "reference": "e9969cfc0796e6dea9b4e52f77f18e1065212871" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/cweagans/composer-patches/zipball/9888dcc74993c030b75f3dd548bb5e20cdbd740c", - "reference": "9888dcc74993c030b75f3dd548bb5e20cdbd740c", + "url": "https://api.github.com/repos/cweagans/composer-patches/zipball/e9969cfc0796e6dea9b4e52f77f18e1065212871", + "reference": "e9969cfc0796e6dea9b4e52f77f18e1065212871", "shasum": "" }, "require": { @@ -3519,9 +3467,9 @@ "description": "Provides a way to patch Composer packages.", "support": { "issues": "https://github.com/cweagans/composer-patches/issues", - "source": "https://github.com/cweagans/composer-patches/tree/1.7.1" + "source": "https://github.com/cweagans/composer-patches/tree/1.7.2" }, - "time": "2021-06-08T15:12:46+00:00" + "time": "2022-01-25T19:21:20+00:00" }, { "name": "david-garcia/phpwhois", @@ -3897,16 +3845,16 @@ }, { "name": "drupal/core", - "version": "9.3.0", + "version": "9.3.6", "source": { "type": "git", "url": "https://github.com/drupal/core.git", - "reference": "1e1bf0e841e11029b21775dd125332d7ffd6fb47" + "reference": "2c0c89a0f49fab56f8322721888cdfa28fe98c3a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/drupal/core/zipball/1e1bf0e841e11029b21775dd125332d7ffd6fb47", - "reference": "1e1bf0e841e11029b21775dd125332d7ffd6fb47", + "url": "https://api.github.com/repos/drupal/core/zipball/2c0c89a0f49fab56f8322721888cdfa28fe98c3a", + "reference": "2c0c89a0f49fab56f8322721888cdfa28fe98c3a", "shasum": "" }, "require": { @@ -4104,10 +4052,14 @@ } }, "autoload": { + "files": [ + "includes/bootstrap.inc", + "includes/guzzle_php81_shim.php" + ], "psr-4": { "Drupal\\Core\\": "lib/Drupal/Core", - "Drupal\\Component\\": "lib/Drupal/Component", - "Drupal\\Driver\\": "../drivers/lib/Drupal/Driver" + "Drupal\\Driver\\": "../drivers/lib/Drupal/Driver", + "Drupal\\Component\\": "lib/Drupal/Component" }, "classmap": [ "lib/Drupal.php", @@ -4136,10 +4088,6 @@ "lib/Drupal/Core/Http/InputBag.php", "lib/Drupal/Core/Installer/InstallerRedirectTrait.php", "lib/Drupal/Core/Site/Settings.php" - ], - "files": [ - "includes/bootstrap.inc", - "includes/guzzle_php81_shim.php" ] }, "notification-url": "https://packagist.org/downloads/", @@ -4148,22 +4096,22 @@ ], "description": "Drupal is an open source content management platform powering millions of websites and applications.", "support": { - "source": "https://github.com/drupal/core/tree/9.3.0" + "source": "https://github.com/drupal/core/tree/9.3.6" }, - "time": "2021-12-08T22:09:38+00:00" + "time": "2022-02-15T20:26:28+00:00" }, { "name": "drupal/core-recommended", - "version": "9.3.0", + "version": "9.3.6", "source": { "type": "git", "url": "https://github.com/drupal/core-recommended.git", - "reference": "d65aaa36a8cab54332787a20676f81928f675bb3" + "reference": "1b24d3f87b55510f85d8495a63e141e601e32a88" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/drupal/core-recommended/zipball/d65aaa36a8cab54332787a20676f81928f675bb3", - "reference": "d65aaa36a8cab54332787a20676f81928f675bb3", + "url": "https://api.github.com/repos/drupal/core-recommended/zipball/1b24d3f87b55510f85d8495a63e141e601e32a88", + "reference": "1b24d3f87b55510f85d8495a63e141e601e32a88", "shasum": "" }, "require": { @@ -4172,7 +4120,7 @@ "doctrine/annotations": "1.13.2", "doctrine/lexer": "1.2.1", "doctrine/reflection": "1.2.2", - "drupal/core": "9.3.0", + "drupal/core": "9.3.6", "egulias/email-validator": "3.1.2", "guzzlehttp/guzzle": "6.5.5", "guzzlehttp/promises": "1.5.1", @@ -4221,7 +4169,7 @@ "symfony/validator": "v4.4.35", "symfony/var-dumper": "v5.4.0", "symfony/yaml": "v4.4.34", - "twig/twig": "v2.14.7", + "twig/twig": "v2.14.11", "typo3/phar-stream-wrapper": "v3.1.7" }, "conflict": { @@ -4234,9 +4182,9 @@ ], "description": "Locked core dependencies; require this project INSTEAD OF drupal/core.", "support": { - "source": "https://github.com/drupal/core-recommended/tree/9.3.0" + "source": "https://github.com/drupal/core-recommended/tree/9.3.6" }, - "time": "2021-12-08T22:09:38+00:00" + "time": "2022-02-15T20:26:28+00:00" }, { "name": "drupal/semver_example", @@ -4839,9 +4787,6 @@ "require": { "php": "^7.1 || ^8.0" }, - "replace": { - "myclabs/deep-copy": "self.version" - }, "require-dev": { "doctrine/collections": "^1.0", "doctrine/common": "^2.6", @@ -4849,12 +4794,12 @@ }, "type": "library", "autoload": { - "psr-4": { - "DeepCopy\\": "src/DeepCopy/" - }, "files": [ "src/DeepCopy/deep_copy.php" - ] + ], + "psr-4": { + "DeepCopy\\": "src/DeepCopy/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -5180,16 +5125,16 @@ }, { "name": "phar-io/version", - "version": "3.1.0", + "version": "3.1.1", "source": { "type": "git", "url": "https://github.com/phar-io/version.git", - "reference": "bae7c545bef187884426f042434e561ab1ddb182" + "reference": "15a90844ad40f127afd244c0cad228de2a80052a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phar-io/version/zipball/bae7c545bef187884426f042434e561ab1ddb182", - "reference": "bae7c545bef187884426f042434e561ab1ddb182", + "url": "https://api.github.com/repos/phar-io/version/zipball/15a90844ad40f127afd244c0cad228de2a80052a", + "reference": "15a90844ad40f127afd244c0cad228de2a80052a", "shasum": "" }, "require": { @@ -5225,9 +5170,9 @@ "description": "Library for handling version information and constraints", "support": { "issues": "https://github.com/phar-io/version/issues", - "source": "https://github.com/phar-io/version/tree/3.1.0" + "source": "https://github.com/phar-io/version/tree/3.1.1" }, - "time": "2021-02-23T14:00:09+00:00" + "time": "2022-02-07T21:56:48+00:00" }, { "name": "phpdocumentor/reflection-common", @@ -5458,16 +5403,16 @@ }, { "name": "phpstan/phpstan", - "version": "1.3.3", + "version": "1.4.6", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "151a51f6149855785fbd883e79768c0abc96b75f" + "reference": "8a7761f1c520e0dad6e04d862fdc697445457cfe" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/151a51f6149855785fbd883e79768c0abc96b75f", - "reference": "151a51f6149855785fbd883e79768c0abc96b75f", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/8a7761f1c520e0dad6e04d862fdc697445457cfe", + "reference": "8a7761f1c520e0dad6e04d862fdc697445457cfe", "shasum": "" }, "require": { @@ -5483,7 +5428,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.3-dev" + "dev-master": "1.4-dev" } }, "autoload": { @@ -5498,7 +5443,7 @@ "description": "PHPStan - PHP Static Analysis Tool", "support": { "issues": "https://github.com/phpstan/phpstan/issues", - "source": "https://github.com/phpstan/phpstan/tree/1.3.3" + "source": "https://github.com/phpstan/phpstan/tree/1.4.6" }, "funding": [ { @@ -5518,20 +5463,20 @@ "type": "tidelift" } ], - "time": "2022-01-07T09:49:03+00:00" + "time": "2022-02-06T12:56:13+00:00" }, { "name": "phpunit/php-code-coverage", - "version": "9.2.10", + "version": "9.2.11", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "d5850aaf931743067f4bfc1ae4cbd06468400687" + "reference": "665a1ac0a763c51afc30d6d130dac0813092b17f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/d5850aaf931743067f4bfc1ae4cbd06468400687", - "reference": "d5850aaf931743067f4bfc1ae4cbd06468400687", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/665a1ac0a763c51afc30d6d130dac0813092b17f", + "reference": "665a1ac0a763c51afc30d6d130dac0813092b17f", "shasum": "" }, "require": { @@ -5587,7 +5532,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.10" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.11" }, "funding": [ { @@ -5595,7 +5540,7 @@ "type": "github" } ], - "time": "2021-12-05T09:12:13+00:00" + "time": "2022-02-18T12:46:09+00:00" }, { "name": "phpunit/php-file-iterator", @@ -5840,16 +5785,16 @@ }, { "name": "phpunit/phpunit", - "version": "9.5.11", + "version": "9.5.14", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "2406855036db1102126125537adb1406f7242fdd" + "reference": "1883687169c017d6ae37c58883ca3994cfc34189" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/2406855036db1102126125537adb1406f7242fdd", - "reference": "2406855036db1102126125537adb1406f7242fdd", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/1883687169c017d6ae37c58883ca3994cfc34189", + "reference": "1883687169c017d6ae37c58883ca3994cfc34189", "shasum": "" }, "require": { @@ -5900,11 +5845,11 @@ } }, "autoload": { - "classmap": [ - "src/" - ], "files": [ "src/Framework/Assert/Functions.php" + ], + "classmap": [ + "src/" ] }, "notification-url": "https://packagist.org/downloads/", @@ -5927,7 +5872,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.11" + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.14" }, "funding": [ { @@ -5939,7 +5884,7 @@ "type": "github" } ], - "time": "2021-12-25T07:07:57+00:00" + "time": "2022-02-18T12:54:07+00:00" }, { "name": "psr/cache", @@ -6047,21 +5992,21 @@ }, { "name": "rector/rector", - "version": "0.12.12", + "version": "0.12.16", "source": { "type": "git", "url": "https://github.com/rectorphp/rector.git", - "reference": "efcc6f135a76bfd031c31fc182ce7a6fd02b3ce5" + "reference": "13412efd0dfda2e2c310dd24397281804441cf7a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/rectorphp/rector/zipball/efcc6f135a76bfd031c31fc182ce7a6fd02b3ce5", - "reference": "efcc6f135a76bfd031c31fc182ce7a6fd02b3ce5", + "url": "https://api.github.com/repos/rectorphp/rector/zipball/13412efd0dfda2e2c310dd24397281804441cf7a", + "reference": "13412efd0dfda2e2c310dd24397281804441cf7a", "shasum": "" }, "require": { "php": "^7.1|^8.0", - "phpstan/phpstan": "^1.3" + "phpstan/phpstan": "^1.4.2" }, "conflict": { "phpstan/phpdoc-parser": "<1.2", @@ -6092,10 +6037,10 @@ "license": [ "MIT" ], - "description": "Prefixed and PHP 7.1 downgraded version of rector/rector", + "description": "Instant Upgrade and Automated Refactoring of any PHP code", "support": { "issues": "https://github.com/rectorphp/rector/issues", - "source": "https://github.com/rectorphp/rector/tree/0.12.12" + "source": "https://github.com/rectorphp/rector/tree/0.12.16" }, "funding": [ { @@ -6103,7 +6048,7 @@ "type": "github" } ], - "time": "2022-01-07T16:49:17+00:00" + "time": "2022-02-09T14:50:55+00:00" }, { "name": "sebastian/cli-parser", @@ -6611,16 +6556,16 @@ }, { "name": "sebastian/global-state", - "version": "5.0.3", + "version": "5.0.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "23bd5951f7ff26f12d4e3242864df3e08dec4e49" + "reference": "0ca8db5a5fc9c8646244e629625ac486fa286bf2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/23bd5951f7ff26f12d4e3242864df3e08dec4e49", - "reference": "23bd5951f7ff26f12d4e3242864df3e08dec4e49", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/0ca8db5a5fc9c8646244e629625ac486fa286bf2", + "reference": "0ca8db5a5fc9c8646244e629625ac486fa286bf2", "shasum": "" }, "require": { @@ -6663,7 +6608,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/global-state/issues", - "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.3" + "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.5" }, "funding": [ { @@ -6671,7 +6616,7 @@ "type": "github" } ], - "time": "2021-06-11T13:31:12+00:00" + "time": "2022-02-14T08:28:10+00:00" }, { "name": "sebastian/lines-of-code", @@ -7828,12 +7773,12 @@ } }, "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Iconv\\": "" - }, "files": [ "bootstrap.php" - ] + ], + "psr-4": { + "Symfony\\Polyfill\\Iconv\\": "" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -8679,5 +8624,5 @@ "platform-overrides": { "php": "7.4" }, - "plugin-api-version": "2.1.0" + "plugin-api-version": "2.2.0" } diff --git a/src/Commands/pm/SecurityUpdateCommands.php b/src/Commands/pm/SecurityUpdateCommands.php index 208ffdf0c4..a8e778ba9f 100644 --- a/src/Commands/pm/SecurityUpdateCommands.php +++ b/src/Commands/pm/SecurityUpdateCommands.php @@ -63,6 +63,10 @@ public static function composerLockPath(): string */ public function security(array $options = ['no-dev' => false]) { + if (!class_exists(SecurityChecker::class)) { + throw new \Exception("Enlightn\SecurityChecker not available. To use, run: composer require enlightn/security-checker"); + } + $security_advisories_composer_json = $this->fetchAdvisoryComposerJson(); $composer_lock_data = $this->loadSiteComposerLock(); $updates = $this->calculateSecurityUpdates($composer_lock_data, $security_advisories_composer_json, $options['no-dev']); From 629e71434e9503ca069573eb5025db0f7f5266a5 Mon Sep 17 00:00:00 2001 From: Greg Anderson Date: Fri, 18 Feb 2022 16:53:46 -0800 Subject: [PATCH 02/18] Update to grasmash/expander 2.0.1 --- composer.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/composer.lock b/composer.lock index dbdbb0ecb7..0a84ed84aa 100644 --- a/composer.lock +++ b/composer.lock @@ -774,16 +774,16 @@ }, { "name": "grasmash/expander", - "version": "2.0.0", + "version": "2.0.1", "source": { "type": "git", "url": "https://github.com/grasmash/expander.git", - "reference": "84c256112763e00d09b437d269897339ca1ceaf4" + "reference": "2c81d9d806097180da40747787b14bf021c6d3c9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/grasmash/expander/zipball/84c256112763e00d09b437d269897339ca1ceaf4", - "reference": "84c256112763e00d09b437d269897339ca1ceaf4", + "url": "https://api.github.com/repos/grasmash/expander/zipball/2c81d9d806097180da40747787b14bf021c6d3c9", + "reference": "2c81d9d806097180da40747787b14bf021c6d3c9", "shasum": "" }, "require": { @@ -820,9 +820,9 @@ "description": "Expands internal property references in PHP arrays file.", "support": { "issues": "https://github.com/grasmash/expander/issues", - "source": "https://github.com/grasmash/expander/tree/2.0.0" + "source": "https://github.com/grasmash/expander/tree/2.0.1" }, - "time": "2021-12-08T01:46:56+00:00" + "time": "2022-02-19T00:49:38+00:00" }, { "name": "guzzlehttp/guzzle", From 620cdb383a54826ee8bedd7c8d9703d19a419a43 Mon Sep 17 00:00:00 2001 From: Greg Anderson Date: Fri, 18 Feb 2022 21:34:36 -0800 Subject: [PATCH 03/18] Prepare for league/container ^4 --- src/Runtime/DependencyInjection.php | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/Runtime/DependencyInjection.php b/src/Runtime/DependencyInjection.php index 7d77239f1e..93b8561b28 100644 --- a/src/Runtime/DependencyInjection.php +++ b/src/Runtime/DependencyInjection.php @@ -97,50 +97,50 @@ public function installHandlers($container): void protected function addDrushServices($container, ClassLoader $loader, DrupalFinder $drupalFinder, SiteAliasManager $aliasManager, DrushConfig $config, OutputInterface $output): void { // Override Robo's logger with a LoggerManager that delegates to the Drush logger. - $container->share('logger', '\Drush\Log\DrushLoggerManager') + Robo::addShared($container, 'logger', '\Drush\Log\DrushLoggerManager') ->addMethodCall('setLogOutputStyler', ['logStyler']) ->addMethodCall('add', ['drush', new Logger($output)]); - $container->share('loader', $loader); - $container->share('site.alias.manager', $aliasManager); + Robo::addShared($container, 'loader', $loader); + Robo::addShared($container, 'site.alias.manager', $aliasManager); // Fetch the runtime config, where -D et. al. are stored, and // add a reference to it to the container. - $container->share('config.runtime', $config->getContext(ConfigOverlay::PROCESS_CONTEXT)); + Robo::addShared($container, 'config.runtime', $config->getContext(ConfigOverlay::PROCESS_CONTEXT)); // Override Robo's formatter manager with our own // @todo not sure that we'll use this. Maybe remove it. - $container->share('formatterManager', DrushFormatterManager::class) + Robo::addShared($container, 'formatterManager', DrushFormatterManager::class) ->addMethodCall('addDefaultFormatters', []) ->addMethodCall('addDefaultSimplifiers', []); // Add some of our own objects to the container - $container->share('bootstrap.drupal8', 'Drush\Boot\DrupalBoot8'); - $container->share('bootstrap.manager', 'Drush\Boot\BootstrapManager') + Robo::addShared($container, 'bootstrap.drupal8', 'Drush\Boot\DrupalBoot8'); + Robo::addShared($container, 'bootstrap.manager', 'Drush\Boot\BootstrapManager') ->addMethodCall('setDrupalFinder', [$drupalFinder]); // TODO: Can we somehow add these via discovery (e.g. backdrop extension?) $container->extend('bootstrap.manager') ->addMethodCall('add', ['bootstrap.drupal8']); - $container->share('bootstrap.hook', 'Drush\Boot\BootstrapHook') + Robo::addShared($container, 'bootstrap.hook', 'Drush\Boot\BootstrapHook') ->addArgument('bootstrap.manager'); - $container->share('tildeExpansion.hook', 'Drush\Runtime\TildeExpansionHook'); - $container->share('process.manager', ProcessManager::class) + Robo::addShared($container, 'tildeExpansion.hook', 'Drush\Runtime\TildeExpansionHook'); + Robo::addShared($container, 'process.manager', ProcessManager::class) ->addMethodCall('setConfig', ['config']) ->addMethodCall('setConfigRuntime', ['config.runtime']); - $container->share('redispatch.hook', 'Drush\Runtime\RedispatchHook') + Robo::addShared($container, 'redispatch.hook', 'Drush\Runtime\RedispatchHook') ->addArgument('process.manager'); // Robo does not manage the command discovery object in the container, // but we will register and configure one for our use. // TODO: Some old adapter code uses this, but the Symfony dispatcher does not. // See Application::commandDiscovery(). - $container->share('commandDiscovery', 'Consolidation\AnnotatedCommand\CommandFileDiscovery') + Robo::addShared($container, 'commandDiscovery', 'Consolidation\AnnotatedCommand\CommandFileDiscovery') ->addMethodCall('addSearchLocation', ['CommandFiles']) ->addMethodCall('setSearchPattern', ['#.*(Commands|CommandFile).php$#']); // Error and Shutdown handlers - $container->share('errorHandler', 'Drush\Runtime\ErrorHandler'); - $container->share('shutdownHandler', 'Drush\Runtime\ShutdownHandler'); + Robo::addShared($container, 'errorHandler', 'Drush\Runtime\ErrorHandler'); + Robo::addShared($container, 'shutdownHandler', 'Drush\Runtime\ShutdownHandler'); // Add inflectors. @see \Drush\Boot\BaseBoot::inflect $container->inflector(AutoloaderAwareInterface::class) From d1a6094743804cbb46c64102c92173f85eec0d27 Mon Sep 17 00:00:00 2001 From: Greg Anderson Date: Fri, 18 Feb 2022 22:08:54 -0800 Subject: [PATCH 04/18] Can't have more than one test class named CoreTest --- tests/functional/CoreTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/functional/CoreTest.php b/tests/functional/CoreTest.php index 80d5f034e8..0da66ebda2 100644 --- a/tests/functional/CoreTest.php +++ b/tests/functional/CoreTest.php @@ -10,7 +10,7 @@ * * @group commands */ -class CoreTest extends CommandUnishTestCase +class FunctionalCoreTest extends CommandUnishTestCase { public function setup(): void { From 0931c51ee76c206e7e86617c32c4b0eee5452356 Mon Sep 17 00:00:00 2001 From: Greg Anderson Date: Fri, 18 Feb 2022 22:16:13 -0800 Subject: [PATCH 05/18] Update dependencies --- composer.json | 6 +++--- composer.lock | 55 +++++++++++++++++++++++++++------------------------ 2 files changed, 32 insertions(+), 29 deletions(-) diff --git a/composer.json b/composer.json index b911583137..a198bb2f56 100644 --- a/composer.json +++ b/composer.json @@ -37,11 +37,11 @@ "consolidation/annotated-command": "^4.5", "consolidation/config": "^2", "consolidation/filter-via-dot-access-data": "^2", - "consolidation/robo": "^3", + "consolidation/robo": "^3.0.9", "consolidation/site-alias": "^3.1.3", - "consolidation/site-process": "^4.1.3", + "consolidation/site-process": "^4.1.3 || ^5", "guzzlehttp/guzzle": "^6.3 || ^7.0", - "league/container": "^3.4", + "league/container": "^3.4 || ^4", "psr/log": "~1.0", "psy/psysh": "~0.11", "symfony/event-dispatcher": "^4.0 || ^5.0 || ^6.0", diff --git a/composer.lock b/composer.lock index 0a84ed84aa..bd498132f5 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": "a2d45a2e4cd072340b9aec6fe97386ee", + "content-hash": "b06e81c98217e3d47c958136a69c1a16", "packages": [ { "name": "chi-teck/drupal-code-generator", @@ -429,16 +429,16 @@ }, { "name": "consolidation/robo", - "version": "3.0.8", + "version": "3.0.9", "source": { "type": "git", "url": "https://github.com/consolidation/robo.git", - "reference": "a6b567570c0f86d5f82e1e638d3c384817c66551" + "reference": "33b2649c3ba4b3bf5e3fb77098c3241eda117338" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/consolidation/robo/zipball/a6b567570c0f86d5f82e1e638d3c384817c66551", - "reference": "a6b567570c0f86d5f82e1e638d3c384817c66551", + "url": "https://api.github.com/repos/consolidation/robo/zipball/33b2649c3ba4b3bf5e3fb77098c3241eda117338", + "reference": "33b2649c3ba4b3bf5e3fb77098c3241eda117338", "shasum": "" }, "require": { @@ -522,9 +522,9 @@ "description": "Modern task runner", "support": { "issues": "https://github.com/consolidation/robo/issues", - "source": "https://github.com/consolidation/robo/tree/3.0.8" + "source": "https://github.com/consolidation/robo/tree/3.0.9" }, - "time": "2022-02-15T17:58:50+00:00" + "time": "2022-02-15T17:59:14+00:00" }, { "name": "consolidation/self-update", @@ -641,16 +641,16 @@ }, { "name": "consolidation/site-process", - "version": "4.1.3", + "version": "4.2.0", "source": { "type": "git", "url": "https://github.com/consolidation/site-process.git", - "reference": "ca41dc82b280bccdf1b231d5599c7d506fba5c04" + "reference": "9ef08d471573d6a56405b06ef6830dd70c883072" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/consolidation/site-process/zipball/ca41dc82b280bccdf1b231d5599c7d506fba5c04", - "reference": "ca41dc82b280bccdf1b231d5599c7d506fba5c04", + "url": "https://api.github.com/repos/consolidation/site-process/zipball/9ef08d471573d6a56405b06ef6830dd70c883072", + "reference": "9ef08d471573d6a56405b06ef6830dd70c883072", "shasum": "" }, "require": { @@ -693,9 +693,9 @@ "description": "A thin wrapper around the Symfony Process Component that allows applications to use the Site Alias library to specify the target for a remote call.", "support": { "issues": "https://github.com/consolidation/site-process/issues", - "source": "https://github.com/consolidation/site-process/tree/4.1.3" + "source": "https://github.com/consolidation/site-process/tree/4.2.0" }, - "time": "2022-01-18T23:04:54+00:00" + "time": "2022-02-19T04:09:55+00:00" }, { "name": "dflydev/dot-access-data", @@ -1091,21 +1091,21 @@ }, { "name": "league/container", - "version": "3.4.1", + "version": "4.2.0", "source": { "type": "git", "url": "https://github.com/thephpleague/container.git", - "reference": "84ecbc2dbecc31bd23faf759a0e329ee49abddbd" + "reference": "375d13cb828649599ef5d48a339c4af7a26cd0ab" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/container/zipball/84ecbc2dbecc31bd23faf759a0e329ee49abddbd", - "reference": "84ecbc2dbecc31bd23faf759a0e329ee49abddbd", + "url": "https://api.github.com/repos/thephpleague/container/zipball/375d13cb828649599ef5d48a339c4af7a26cd0ab", + "reference": "375d13cb828649599ef5d48a339c4af7a26cd0ab", "shasum": "" }, "require": { - "php": "^7.0 || ^8.0", - "psr/container": "^1.0.0" + "php": "^7.2 || ^8.0", + "psr/container": "^1.1 || ^2.0" }, "provide": { "psr/container-implementation": "^1.0" @@ -1114,15 +1114,19 @@ "orno/di": "~2.0" }, "require-dev": { - "phpunit/phpunit": "^6.0 || ^7.0", + "nette/php-generator": "^3.4", + "nikic/php-parser": "^4.10", + "phpstan/phpstan": "^0.12.47", + "phpunit/phpunit": "^8.5.17", "roave/security-advisories": "dev-latest", "scrutinizer/ocular": "^1.8", - "squizlabs/php_codesniffer": "^3.5" + "squizlabs/php_codesniffer": "^3.6" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.x-dev", + "dev-master": "4.x-dev", + "dev-4.x": "4.x-dev", "dev-3.x": "3.x-dev", "dev-2.x": "2.x-dev", "dev-1.x": "1.x-dev" @@ -1140,8 +1144,7 @@ "authors": [ { "name": "Phil Bennett", - "email": "philipobenito@gmail.com", - "homepage": "http://www.philipobenito.com", + "email": "mail@philbennett.co.uk", "role": "Developer" } ], @@ -1158,7 +1161,7 @@ ], "support": { "issues": "https://github.com/thephpleague/container/issues", - "source": "https://github.com/thephpleague/container/tree/3.4.1" + "source": "https://github.com/thephpleague/container/tree/4.2.0" }, "funding": [ { @@ -1166,7 +1169,7 @@ "type": "github" } ], - "time": "2021-07-09T08:23:52+00:00" + "time": "2021-11-16T10:29:06+00:00" }, { "name": "nikic/php-parser", From a6ffa5d9f3e901c5fb580310d778a82847d01354 Mon Sep 17 00:00:00 2001 From: Greg Anderson Date: Sat, 19 Feb 2022 15:26:40 -0800 Subject: [PATCH 06/18] Maybe this might fix Drupal 10, maybe it might break other versions. --- src/Boot/DrupalBoot8.php | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/Boot/DrupalBoot8.php b/src/Boot/DrupalBoot8.php index 47f54a37e7..2a407feb59 100644 --- a/src/Boot/DrupalBoot8.php +++ b/src/Boot/DrupalBoot8.php @@ -5,6 +5,7 @@ use Drupal\Core\DrupalKernelInterface; use Consolidation\AnnotatedCommand\AnnotationData; use Drupal\Core\Database\Database; +use Drupal\Core\Render\HtmlResponse; use Drupal\Core\DrupalKernel; use Drush\Config\ConfigLocator; use Drush\Drupal\DrushLoggerServiceProvider; @@ -135,7 +136,15 @@ public function bootstrapDrupalSiteValidate(BootstrapManager $manager): bool 'SCRIPT_FILENAME' => getcwd() . '/index.php', 'SCRIPT_NAME' => isset($parsed_url['path']) ? $parsed_url['path'] . 'index.php' : '/index.php', ] + $_SERVER; - $request = Request::create($uri, 'GET', [], [], [], $server); + // To do: split into Drupal 9 and Drupal 10 bootstrap + if (method_exists(Request::class, 'create')) { + // Drupal 9 + $request = Request::create($uri, 'GET', [], [], [], $server); + } + else { + // Drupal 10 + $request = Request::createFromGlobals(); + } $request->overrideGlobals(); $this->setRequest($request); return true; @@ -290,7 +299,12 @@ public function terminate(): void parent::terminate(); if ($this->kernel) { - $response = Response::create(''); + if (method_exists(Response::class, 'create')) { + $response = Response::create(''); + } + else { + $response = new HtmlResponse(); + } $this->kernel->terminate($this->getRequest(), $response); } } From a18707ad3677f8427aa77d5859ca03b757685a46 Mon Sep 17 00:00:00 2001 From: Greg Anderson Date: Sat, 19 Feb 2022 15:29:38 -0800 Subject: [PATCH 07/18] Code style --- src/Boot/DrupalBoot8.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/Boot/DrupalBoot8.php b/src/Boot/DrupalBoot8.php index 2a407feb59..b8465bb5be 100644 --- a/src/Boot/DrupalBoot8.php +++ b/src/Boot/DrupalBoot8.php @@ -140,8 +140,7 @@ public function bootstrapDrupalSiteValidate(BootstrapManager $manager): bool if (method_exists(Request::class, 'create')) { // Drupal 9 $request = Request::create($uri, 'GET', [], [], [], $server); - } - else { + } else { // Drupal 10 $request = Request::createFromGlobals(); } @@ -301,8 +300,7 @@ public function terminate(): void if ($this->kernel) { if (method_exists(Response::class, 'create')) { $response = Response::create(''); - } - else { + } else { $response = new HtmlResponse(); } $this->kernel->terminate($this->getRequest(), $response); From 688a1141d7eb28709d4642930ff4440e5d9c3fe0 Mon Sep 17 00:00:00 2001 From: Greg Anderson Date: Sat, 19 Feb 2022 15:30:06 -0800 Subject: [PATCH 08/18] Rename test class --- tests/functional/{CoreTest.php => FunctionalCoreTest.php} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename tests/functional/{CoreTest.php => FunctionalCoreTest.php} (100%) diff --git a/tests/functional/CoreTest.php b/tests/functional/FunctionalCoreTest.php similarity index 100% rename from tests/functional/CoreTest.php rename to tests/functional/FunctionalCoreTest.php From 9f57b35c164668663daf343862f54c846dc6bb72 Mon Sep 17 00:00:00 2001 From: Lisa Ridley Date: Sun, 13 Feb 2022 11:57:39 -0500 Subject: [PATCH 09/18] The function "module_load_install()" was marked as deprecated in Drupal 9.4, and will be removed in Drupal 10.0.0. See https://www.drupal.org/node/3220952 for more information. This commit implements a call to ModuleHandler::loadInclude() instead. --- src/Drupal/Commands/pm/PmCommands.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Drupal/Commands/pm/PmCommands.php b/src/Drupal/Commands/pm/PmCommands.php index 1e00ac2087..cc8719451c 100644 --- a/src/Drupal/Commands/pm/PmCommands.php +++ b/src/Drupal/Commands/pm/PmCommands.php @@ -116,7 +116,7 @@ public function validateEnableModules(CommandData $commandData): void require_once DRUSH_DRUPAL_CORE . '/includes/install.inc'; $error = false; foreach ($modules as $module) { - module_load_install($module); + $this->moduleHandler->loadInclude($module, 'install'); $requirements = $this->getModuleHandler()->invoke($module, 'requirements', ['install']); if (is_array($requirements) && drupal_requirements_severity($requirements) == REQUIREMENT_ERROR) { $error = true; From 037728b25ba690842c1896498d5bad03abde9e8a Mon Sep 17 00:00:00 2001 From: Greg Anderson Date: Sat, 19 Feb 2022 21:09:55 -0800 Subject: [PATCH 10/18] Install enlightn/security-checker for Windows tests. Skip security checker tests on Drupal 10. --- appveyor.yml | 1 + tests/integration/SecurityUpdatesTest.php | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/appveyor.yml b/appveyor.yml index d2aecb76d1..c4ba7c61bd 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -55,6 +55,7 @@ install: - php -r "readfile('http://getcomposer.org/installer');" | php #Install dependencies via Composer - php composer.phar install --prefer-dist -n + - php composer.phar require enlightn/security-checker -n - SET PATH=%APPVEYOR_BUILD_FOLDER%;%APPVEYOR_BUILD_FOLDER%/vendor/bin;%PATH% # Uncomment this and on_finish line below to enable RDP into build machine https://www.appveyor.com/docs/how-to/rdp-to-build-worker/ # - ps: iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1')) diff --git a/tests/integration/SecurityUpdatesTest.php b/tests/integration/SecurityUpdatesTest.php index a38f8f6090..7e3d0d4ac5 100644 --- a/tests/integration/SecurityUpdatesTest.php +++ b/tests/integration/SecurityUpdatesTest.php @@ -16,6 +16,7 @@ class SecurityUpdatesTest extends UnishIntegrationTestCase */ public function testInsecureDrupalPackage() { + $this->skipIfSecurityCheckerNotAvailable(); list($expected_package, $expected_version) = ['drupal/semver_example', '2.3.0']; $this->drush('pm:security', [], ['format' => 'json'], self::EXIT_ERROR_WITH_CLARITY); $this->assertStringContainsString('One or more of your dependencies has an outstanding security update.', $this->getErrorOutput()); @@ -40,6 +41,7 @@ public function testInsecureDrupalPackage() */ public function testNoInsecureProductionDrupalPackage() { + $this->skipIfSecurityCheckerNotAvailable(); $this->drush('pm:security', [], ['format' => 'json', 'no-dev' => true], self::EXIT_SUCCESS); $this->assertStringContainsString('There are no outstanding security updates for Drupal projects', $this->getErrorOutput()); } @@ -49,6 +51,7 @@ public function testNoInsecureProductionDrupalPackage() */ public function testInsecurePhpPackage() { + $this->skipIfSecurityCheckerNotAvailable(); $this->drush('pm:security-php', [], ['format' => 'json'], self::EXIT_ERROR_WITH_CLARITY); $this->assertStringContainsString('One or more of your dependencies has an outstanding security update.', $this->getErrorOutput()); $this->assertStringContainsString('Run composer why david-garcia/phpwhois', $this->getErrorOutput()); @@ -61,7 +64,18 @@ public function testInsecurePhpPackage() */ public function testNoInsecureProductionPhpPackage() { + $this->skipIfSecurityCheckerNotAvailable(); $this->drush('pm:security-php', [], ['format' => 'json', 'no-dev' => true], self::EXIT_SUCCESS); $this->assertStringContainsString('There are no outstanding security updates for your dependencies.', $this->getErrorOutput()); } + + /** + * Mark the test skipped if we don't expect enlightn/security-checker to be available. + */ + protected function skipIfSecurityCheckerNotAvailable() + { + if ($this->isDrupalGreaterThanOrEqualTo('10.0.0')) { + $this->markTestSkipped('enlightn/security-checker not yet available for Drupal 10.'); + } + } } From 87bff30e4678f2901ea8b89ff00d26342b7fb52e Mon Sep 17 00:00:00 2001 From: Greg Anderson Date: Sat, 19 Feb 2022 21:50:54 -0800 Subject: [PATCH 11/18] Stop using deprecated drupal_get_installed_schema_version when new replacement update hook registry service is available. --- tests/functional/UpdateDBTest.php | 9 +++++++-- tests/functional/resources/updatedb_script.php | 4 ++-- tests/functional/resources/updatedb_script_legacy.php | 6 ++++++ 3 files changed, 15 insertions(+), 4 deletions(-) create mode 100644 tests/functional/resources/updatedb_script_legacy.php diff --git a/tests/functional/UpdateDBTest.php b/tests/functional/UpdateDBTest.php index 230702543f..eaf9f45660 100644 --- a/tests/functional/UpdateDBTest.php +++ b/tests/functional/UpdateDBTest.php @@ -16,6 +16,11 @@ class UpdateDBTest extends CommandUnishTestCase public function testUpdateDBStatus() { + $updatedb_script = 'updatedb_script_legacy'; + if ($this->isDrupalGreaterThanOrEqualTo('9.3.0')) { + $updatedb_script = 'updatedb_script'; + } + $this->setUpDrupal(1, true); $this->drush('pm:enable', ['drush_empty_module']); $this->drush('updatedb:status'); @@ -23,7 +28,7 @@ public function testUpdateDBStatus() $this->assertStringContainsString('[success] No database updates required.', $err); // Force a pending update. - $this->drush('php-script', ['updatedb_script'], ['script-path' => __DIR__ . '/resources']); + $this->drush('php-script', [$updatedb_script], ['script-path' => __DIR__ . '/resources']); // Assert that pending hook_update_n appears $this->drush('updatedb:status', [], ['format' => 'json']); @@ -67,7 +72,7 @@ public function testFailedUpdate($last_successful_update, $expected_status_repor $this->drush('pm-enable', ['woot'], $options); // Force a pending update. - $this->drush('php-script', ['updatedb_script'], ['script-path' => __DIR__ . '/resources']); + $this->drush('php-script', [$updatedb_script], ['script-path' => __DIR__ . '/resources']); // Force re-run of woot_update_8101(). $this->drush('php:eval', array('drupal_set_installed_schema_version("woot", ' . $last_successful_update . ')'), $options); diff --git a/tests/functional/resources/updatedb_script.php b/tests/functional/resources/updatedb_script.php index 1863a6172b..8e8845f378 100644 --- a/tests/functional/resources/updatedb_script.php +++ b/tests/functional/resources/updatedb_script.php @@ -2,5 +2,5 @@ // Set the schema version of drush_empty_module to a lower version, so we have a // pending update. -$current = drupal_get_installed_schema_version('drush_empty_module'); -drupal_set_installed_schema_version('drush_empty_module', $current - 1); +$current = \Drupal::service('update.update_hook_registry')->getInstalledVersion('drush_empty_module'); +\Drupal::service('update.update_hook_registry')->setInstalledVersion('drush_empty_module', $current - 1); diff --git a/tests/functional/resources/updatedb_script_legacy.php b/tests/functional/resources/updatedb_script_legacy.php new file mode 100644 index 0000000000..1863a6172b --- /dev/null +++ b/tests/functional/resources/updatedb_script_legacy.php @@ -0,0 +1,6 @@ + Date: Sat, 19 Feb 2022 22:06:42 -0800 Subject: [PATCH 12/18] Put update script name into a method --- tests/functional/UpdateDBTest.php | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/tests/functional/UpdateDBTest.php b/tests/functional/UpdateDBTest.php index eaf9f45660..229d5b37ee 100644 --- a/tests/functional/UpdateDBTest.php +++ b/tests/functional/UpdateDBTest.php @@ -16,11 +16,6 @@ class UpdateDBTest extends CommandUnishTestCase public function testUpdateDBStatus() { - $updatedb_script = 'updatedb_script_legacy'; - if ($this->isDrupalGreaterThanOrEqualTo('9.3.0')) { - $updatedb_script = 'updatedb_script'; - } - $this->setUpDrupal(1, true); $this->drush('pm:enable', ['drush_empty_module']); $this->drush('updatedb:status'); @@ -28,7 +23,7 @@ public function testUpdateDBStatus() $this->assertStringContainsString('[success] No database updates required.', $err); // Force a pending update. - $this->drush('php-script', [$updatedb_script], ['script-path' => __DIR__ . '/resources']); + $this->drush('php-script', [$this->updateDbScriptName()], ['script-path' => __DIR__ . '/resources']); // Assert that pending hook_update_n appears $this->drush('updatedb:status', [], ['format' => 'json']); @@ -72,7 +67,7 @@ public function testFailedUpdate($last_successful_update, $expected_status_repor $this->drush('pm-enable', ['woot'], $options); // Force a pending update. - $this->drush('php-script', [$updatedb_script], ['script-path' => __DIR__ . '/resources']); + $this->drush('php-script', [$this->updateDbScriptName()], ['script-path' => __DIR__ . '/resources']); // Force re-run of woot_update_8101(). $this->drush('php:eval', array('drupal_set_installed_schema_version("woot", ' . $last_successful_update . ')'), $options); @@ -91,6 +86,17 @@ public function testFailedUpdate($last_successful_update, $expected_status_repor } } + /** + * Select the appropriate update script for the current Drupal version + */ + protected function updateDbScriptName() + { + if ($this->isDrupalGreaterThanOrEqualTo('9.3.0')) { + return 'updatedb_script'; + } + return 'updatedb_script_legacy'; + } + /** * Data provider for ::testFailedUpdate(). */ From c2509f9d74d01684f4576ad9d0dc1f62614592f8 Mon Sep 17 00:00:00 2001 From: Greg Anderson Date: Sat, 19 Feb 2022 22:45:00 -0800 Subject: [PATCH 13/18] Avoid using drupal_set_installed_schema_version, removed in Drupal 10 --- src/Commands/core/UpdateDBCommands.php | 16 ++++++- tests/functional/UpdateDBTest.php | 47 ++++++++++++------- .../resources/updatedb_script_legacy.php | 6 --- 3 files changed, 43 insertions(+), 26 deletions(-) delete mode 100644 tests/functional/resources/updatedb_script_legacy.php diff --git a/src/Commands/core/UpdateDBCommands.php b/src/Commands/core/UpdateDBCommands.php index f6350efc99..ade45c1b6c 100644 --- a/src/Commands/core/UpdateDBCommands.php +++ b/src/Commands/core/UpdateDBCommands.php @@ -231,7 +231,13 @@ public static function updateDoOne(string $module, int $number, array $dependenc // Record the schema update if it was completed successfully. if ($context['finished'] >= 1 && empty($ret['#abort'])) { - drupal_set_installed_schema_version($module, $number); + // TODO: setInstalledVersion in update.update_hook_registry introduced in Drupal 9.3.0 + if (!function_exists('drupal_set_installed_schema_version')) { + \Drupal::service("update.update_hook_registry")->setInstalledVersion($module, $number); + } + else { + drupal_set_installed_schema_version($module, $number); + } // Setting this value will output a success message. // @see \DrushBatchContext::offsetSet() $context['message'] = "Update completed: $function"; @@ -368,7 +374,13 @@ public function updateBatch($options): bool // correct place. (The updates are already sorted, so we can simply base // this on the first one we come across in the above foreach loop.) if (isset($start[$update['module']])) { - drupal_set_installed_schema_version($update['module'], $update['number'] - 1); + // TODO: setInstalledVersion in update.update_hook_registry introduced in Drupal 9.3.0 + if (!function_exists('drupal_set_installed_schema_version')) { + \Drupal::service("update.update_hook_registry")->setInstalledVersion($update['module'], $update['number'] - 1); + } + else { + drupal_set_installed_schema_version($update['module'], $update['number'] - 1); + } unset($start[$update['module']]); } // Add this update function to the batch. diff --git a/tests/functional/UpdateDBTest.php b/tests/functional/UpdateDBTest.php index 229d5b37ee..69d25850b4 100644 --- a/tests/functional/UpdateDBTest.php +++ b/tests/functional/UpdateDBTest.php @@ -16,6 +16,10 @@ class UpdateDBTest extends CommandUnishTestCase public function testUpdateDBStatus() { + if (!$this->isDrupalGreaterThanOrEqualTo('9.3.0')) { + $this->markTestSkipped('Test uses setInstalledVersion from update.update_hook_registry, introduced in Drupal 9.3.0, instead of drupal_set_installed_schema_version'); + } + $this->setUpDrupal(1, true); $this->drush('pm:enable', ['drush_empty_module']); $this->drush('updatedb:status'); @@ -23,7 +27,7 @@ public function testUpdateDBStatus() $this->assertStringContainsString('[success] No database updates required.', $err); // Force a pending update. - $this->drush('php-script', [$this->updateDbScriptName()], ['script-path' => __DIR__ . '/resources']); + $this->drush('php-script', ['updatedb_script'], ['script-path' => __DIR__ . '/resources']); // Assert that pending hook_update_n appears $this->drush('updatedb:status', [], ['format' => 'json']); @@ -59,6 +63,9 @@ public function testFailedUpdate($last_successful_update, $expected_status_repor if (version_compare(phpversion(), '7.0.0') < 0) { $this->markTestSkipped('Catching fatal errors is supported in PHP 7.0 and higher.'); } + if (!$this->isDrupalGreaterThanOrEqualTo('9.3.0')) { + $this->markTestSkipped('Test uses setInstalledVersion from update.update_hook_registry, introduced in Drupal 9.3.0, instead of drupal_set_installed_schema_version'); + } $this->setUpDrupal(1, true); $options = [ 'yes' => null, @@ -67,10 +74,10 @@ public function testFailedUpdate($last_successful_update, $expected_status_repor $this->drush('pm-enable', ['woot'], $options); // Force a pending update. - $this->drush('php-script', [$this->updateDbScriptName()], ['script-path' => __DIR__ . '/resources']); + $this->drush('php-script', ['updatedb_script'], ['script-path' => __DIR__ . '/resources']); // Force re-run of woot_update_8101(). - $this->drush('php:eval', array('drupal_set_installed_schema_version("woot", ' . $last_successful_update . ')'), $options); + $this->drush('php:eval', array('\Drupal::service("update.update_hook_registry")->setInstalledVersion("woot", ' . $last_successful_update . ')'), $options); // Force re-run of the post-update woot_post_update_failing(). $this->forcePostUpdate('woot_post_update_failing', $options); @@ -86,17 +93,6 @@ public function testFailedUpdate($last_successful_update, $expected_status_repor } } - /** - * Select the appropriate update script for the current Drupal version - */ - protected function updateDbScriptName() - { - if ($this->isDrupalGreaterThanOrEqualTo('9.3.0')) { - return 'updatedb_script'; - } - return 'updatedb_script_legacy'; - } - /** * Data provider for ::testFailedUpdate(). */ @@ -153,6 +149,9 @@ public function testFailedPostUpdate() if ($this->isWindows()) { $this->markTestSkipped('See https://github.com/consolidation/site-process/pull/27'); } + if (!$this->isDrupalGreaterThanOrEqualTo('9.3.0')) { + $this->markTestSkipped('Test uses setInstalledVersion from update.update_hook_registry, introduced in Drupal 9.3.0, instead of drupal_set_installed_schema_version'); + } $this->setUpDrupal(1, true); $options = [ @@ -162,7 +161,7 @@ public function testFailedPostUpdate() $this->drush('pm-enable', ['woot'], $options); // Force re-run of woot_update_8104(). - $this->drush('php:eval', array('drupal_set_installed_schema_version("woot", 8103)'), $options); + $this->drush('php:eval', array('\Drupal::service("update.update_hook_registry")->setInstalledVersion("woot", 8103)'), $options); // Force re-run of post-update hooks. $this->forcePostUpdate('woot_post_update_a', $options); @@ -250,6 +249,10 @@ class: Drupal\woot\DependingService */ public function testSuccessfulUpdate() { + if (!$this->isDrupalGreaterThanOrEqualTo('9.3.0')) { + $this->markTestSkipped('Test uses setInstalledVersion from update.update_hook_registry, introduced in Drupal 9.3.0, instead of drupal_set_installed_schema_version'); + } + $this->setUpDrupal(1, true); $options = [ 'yes' => null, @@ -258,7 +261,7 @@ public function testSuccessfulUpdate() $this->drush('pm-enable', ['woot'], $options); // Force re-run of woot_update_8104() which is expected to be completed successfully. - $this->drush('php:eval', array('drupal_set_installed_schema_version("woot", 8103)'), $options); + $this->drush('php:eval', array('\Drupal::service("update.update_hook_registry")->setInstalledVersion("woot", 8103)'), $options); // Force re-run of post-update hooks which are expected to be completed successfully. $this->forcePostUpdate('woot_post_update_a', $options); @@ -281,6 +284,10 @@ public function testSuccessfulUpdate() */ public function testBatchUpdateLogMessages() { + if (!$this->isDrupalGreaterThanOrEqualTo('9.3.0')) { + $this->markTestSkipped('Test uses setInstalledVersion from update.update_hook_registry, introduced in Drupal 9.3.0, instead of drupal_set_installed_schema_version'); + } + $options = [ 'yes' => null, ]; @@ -289,7 +296,7 @@ public function testBatchUpdateLogMessages() $this->drush('pm:enable', ['woot'], $options); // Force re-run of woot_update_8105(). - $this->drush('php:eval', ['drupal_set_installed_schema_version("woot", 8104)'], $options); + $this->drush('php:eval', ['\Drupal::service("update.update_hook_registry")->setInstalledVersion("woot", 8104)'], $options); // Force re-run of woot_post_update_batch(). $this->forcePostUpdate('woot_post_update_batch', $options); @@ -324,6 +331,10 @@ public function testBatchUpdateLogMessages() */ public function testEnableModuleViaUpdate() { + if (!$this->isDrupalGreaterThanOrEqualTo('9.3.0')) { + $this->markTestSkipped('Test uses setInstalledVersion from update.update_hook_registry, introduced in Drupal 9.3.0, instead of drupal_set_installed_schema_version'); + } + $options = [ 'yes' => null, ]; @@ -332,7 +343,7 @@ public function testEnableModuleViaUpdate() $this->drush('pm:enable', ['woot'], $options); // Force re-run of woot_update_8106(). - $this->drush('php:eval', ['drupal_set_installed_schema_version("woot", 8105)'], $options); + $this->drush('php:eval', ['\Drupal::service("update.update_hook_registry")->setInstalledVersion("woot", 8105)'], $options); // Run updates. $this->drush('updatedb', [], $options); diff --git a/tests/functional/resources/updatedb_script_legacy.php b/tests/functional/resources/updatedb_script_legacy.php deleted file mode 100644 index 1863a6172b..0000000000 --- a/tests/functional/resources/updatedb_script_legacy.php +++ /dev/null @@ -1,6 +0,0 @@ - Date: Sat, 19 Feb 2022 22:47:51 -0800 Subject: [PATCH 14/18] Code style --- src/Commands/core/UpdateDBCommands.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/Commands/core/UpdateDBCommands.php b/src/Commands/core/UpdateDBCommands.php index ade45c1b6c..aab0f9cbeb 100644 --- a/src/Commands/core/UpdateDBCommands.php +++ b/src/Commands/core/UpdateDBCommands.php @@ -234,8 +234,7 @@ public static function updateDoOne(string $module, int $number, array $dependenc // TODO: setInstalledVersion in update.update_hook_registry introduced in Drupal 9.3.0 if (!function_exists('drupal_set_installed_schema_version')) { \Drupal::service("update.update_hook_registry")->setInstalledVersion($module, $number); - } - else { + } else { drupal_set_installed_schema_version($module, $number); } // Setting this value will output a success message. @@ -377,8 +376,7 @@ public function updateBatch($options): bool // TODO: setInstalledVersion in update.update_hook_registry introduced in Drupal 9.3.0 if (!function_exists('drupal_set_installed_schema_version')) { \Drupal::service("update.update_hook_registry")->setInstalledVersion($update['module'], $update['number'] - 1); - } - else { + } else { drupal_set_installed_schema_version($update['module'], $update['number'] - 1); } unset($start[$update['module']]); From a3017d12acf7e6abe1a338c53d2756e85a6316de Mon Sep 17 00:00:00 2001 From: Greg Anderson Date: Sat, 19 Feb 2022 23:36:32 -0800 Subject: [PATCH 15/18] Fix update to requirements check implementation. --- src/Drupal/Commands/pm/PmCommands.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/Drupal/Commands/pm/PmCommands.php b/src/Drupal/Commands/pm/PmCommands.php index cc8719451c..02ef370b47 100644 --- a/src/Drupal/Commands/pm/PmCommands.php +++ b/src/Drupal/Commands/pm/PmCommands.php @@ -116,7 +116,15 @@ public function validateEnableModules(CommandData $commandData): void require_once DRUSH_DRUPAL_CORE . '/includes/install.inc'; $error = false; foreach ($modules as $module) { - $this->moduleHandler->loadInclude($module, 'install'); + // Note: we can't just call the API ($moduleHandler->loadInclude($module, 'install')), + // because the API ignores modules that haven't been installed yet. We have + // to do it the same way the `function drupal_check_module($module)` does. + $module_list = \Drupal::service('extension.list.module'); + $file = DRUPAL_ROOT . '/' . $module_list->getPath($module) . "/$module.install"; + if (is_file($file)) { + require_once $file; + } + // Once we've loaded the module, we can invoke its requirements hook. $requirements = $this->getModuleHandler()->invoke($module, 'requirements', ['install']); if (is_array($requirements) && drupal_requirements_severity($requirements) == REQUIREMENT_ERROR) { $error = true; From e8da222468b4cc33f430fe88fc4ae8585204173d Mon Sep 17 00:00:00 2001 From: Greg Anderson Date: Sat, 19 Feb 2022 23:40:11 -0800 Subject: [PATCH 16/18] Code style --- src/Drupal/Commands/pm/PmCommands.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Drupal/Commands/pm/PmCommands.php b/src/Drupal/Commands/pm/PmCommands.php index 02ef370b47..236e07ffc4 100644 --- a/src/Drupal/Commands/pm/PmCommands.php +++ b/src/Drupal/Commands/pm/PmCommands.php @@ -122,7 +122,7 @@ public function validateEnableModules(CommandData $commandData): void $module_list = \Drupal::service('extension.list.module'); $file = DRUPAL_ROOT . '/' . $module_list->getPath($module) . "/$module.install"; if (is_file($file)) { - require_once $file; + require_once $file; } // Once we've loaded the module, we can invoke its requirements hook. $requirements = $this->getModuleHandler()->invoke($module, 'requirements', ['install']); From 056402ba1362cca82820a1c9291e9712121d8bb5 Mon Sep 17 00:00:00 2001 From: Greg Anderson Date: Sun, 20 Feb 2022 10:01:34 -0800 Subject: [PATCH 17/18] Update dependencies and remove an optional backslash --- composer.lock | 12 ++++++------ tests/functional/UpdateDBTest.php | 10 +++++----- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/composer.lock b/composer.lock index bd498132f5..9dbf028a4f 100644 --- a/composer.lock +++ b/composer.lock @@ -151,16 +151,16 @@ }, { "name": "consolidation/annotated-command", - "version": "4.5.1", + "version": "4.5.2", "source": { "type": "git", "url": "https://github.com/consolidation/annotated-command.git", - "reference": "701a7abe8505abe89520837be798e15a3953a367" + "reference": "24c1529436b4f4beec3d19aab71fd127817f47ef" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/consolidation/annotated-command/zipball/701a7abe8505abe89520837be798e15a3953a367", - "reference": "701a7abe8505abe89520837be798e15a3953a367", + "url": "https://api.github.com/repos/consolidation/annotated-command/zipball/24c1529436b4f4beec3d19aab71fd127817f47ef", + "reference": "24c1529436b4f4beec3d19aab71fd127817f47ef", "shasum": "" }, "require": { @@ -201,9 +201,9 @@ "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.1" + "source": "https://github.com/consolidation/annotated-command/tree/4.5.2" }, - "time": "2021-12-30T04:00:37+00:00" + "time": "2022-02-20T16:36:18+00:00" }, { "name": "consolidation/config", diff --git a/tests/functional/UpdateDBTest.php b/tests/functional/UpdateDBTest.php index 69d25850b4..1a9b596ac7 100644 --- a/tests/functional/UpdateDBTest.php +++ b/tests/functional/UpdateDBTest.php @@ -77,7 +77,7 @@ public function testFailedUpdate($last_successful_update, $expected_status_repor $this->drush('php-script', ['updatedb_script'], ['script-path' => __DIR__ . '/resources']); // Force re-run of woot_update_8101(). - $this->drush('php:eval', array('\Drupal::service("update.update_hook_registry")->setInstalledVersion("woot", ' . $last_successful_update . ')'), $options); + $this->drush('php:eval', array('Drupal::service("update.update_hook_registry")->setInstalledVersion("woot", ' . $last_successful_update . ')'), $options); // Force re-run of the post-update woot_post_update_failing(). $this->forcePostUpdate('woot_post_update_failing', $options); @@ -161,7 +161,7 @@ public function testFailedPostUpdate() $this->drush('pm-enable', ['woot'], $options); // Force re-run of woot_update_8104(). - $this->drush('php:eval', array('\Drupal::service("update.update_hook_registry")->setInstalledVersion("woot", 8103)'), $options); + $this->drush('php:eval', array('Drupal::service("update.update_hook_registry")->setInstalledVersion("woot", 8103)'), $options); // Force re-run of post-update hooks. $this->forcePostUpdate('woot_post_update_a', $options); @@ -261,7 +261,7 @@ public function testSuccessfulUpdate() $this->drush('pm-enable', ['woot'], $options); // Force re-run of woot_update_8104() which is expected to be completed successfully. - $this->drush('php:eval', array('\Drupal::service("update.update_hook_registry")->setInstalledVersion("woot", 8103)'), $options); + $this->drush('php:eval', array('Drupal::service("update.update_hook_registry")->setInstalledVersion("woot", 8103)'), $options); // Force re-run of post-update hooks which are expected to be completed successfully. $this->forcePostUpdate('woot_post_update_a', $options); @@ -296,7 +296,7 @@ public function testBatchUpdateLogMessages() $this->drush('pm:enable', ['woot'], $options); // Force re-run of woot_update_8105(). - $this->drush('php:eval', ['\Drupal::service("update.update_hook_registry")->setInstalledVersion("woot", 8104)'], $options); + $this->drush('php:eval', ['Drupal::service("update.update_hook_registry")->setInstalledVersion("woot", 8104)'], $options); // Force re-run of woot_post_update_batch(). $this->forcePostUpdate('woot_post_update_batch', $options); @@ -343,7 +343,7 @@ public function testEnableModuleViaUpdate() $this->drush('pm:enable', ['woot'], $options); // Force re-run of woot_update_8106(). - $this->drush('php:eval', ['\Drupal::service("update.update_hook_registry")->setInstalledVersion("woot", 8105)'], $options); + $this->drush('php:eval', ['Drupal::service("update.update_hook_registry")->setInstalledVersion("woot", 8105)'], $options); // Run updates. $this->drush('updatedb', [], $options); From 04b5ac05232890b65cb00aedede3c45e7c1f449c Mon Sep 17 00:00:00 2001 From: Greg Anderson Date: Sun, 20 Feb 2022 10:33:28 -0800 Subject: [PATCH 18/18] Correctly skip security tests on Drupal 10 --- tests/integration/SecurityUpdatesTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/integration/SecurityUpdatesTest.php b/tests/integration/SecurityUpdatesTest.php index 7e3d0d4ac5..78eec6c892 100644 --- a/tests/integration/SecurityUpdatesTest.php +++ b/tests/integration/SecurityUpdatesTest.php @@ -74,7 +74,7 @@ public function testNoInsecureProductionPhpPackage() */ protected function skipIfSecurityCheckerNotAvailable() { - if ($this->isDrupalGreaterThanOrEqualTo('10.0.0')) { + if ($this->isDrupalGreaterThanOrEqualTo('10.0.0@dev')) { $this->markTestSkipped('enlightn/security-checker not yet available for Drupal 10.'); } }