From 68cdb1d0b78bf4ca4abae10f08a2a4954cfe9173 Mon Sep 17 00:00:00 2001 From: MatthieuScarset Date: Sun, 25 Oct 2020 15:04:49 +0100 Subject: [PATCH 01/14] Add VSCode folder to ignore #580 --- .gitignore | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 50d278d8f4..12ad63d871 100644 --- a/.gitignore +++ b/.gitignore @@ -14,11 +14,12 @@ # Ignore Drupal's file directory /web/sites/*/files/ -# Ignore SimpleTest multi-site environment. +# Ignore SimpleTest multi-site environment /web/sites/simpletest -# Ignore files generated by PhpStorm +# Ignore files generated by common IDEs /.idea/ +/.vscode/ # Ignore .env files as they are personal /.env From eeea242679ba3052156a8b9b0ff5a1dfee8e7cfb Mon Sep 17 00:00:00 2001 From: Joel Pittet Date: Fri, 11 Dec 2020 14:42:16 -0800 Subject: [PATCH 02/14] Allow getenv() to work again with vlucas/phpdotenv 5.x (#584) Allow getenv() to work again, update load.environment.php Co-authored-by: Florian Weber --- load.environment.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/load.environment.php b/load.environment.php index eef1d28d07..c275442d84 100644 --- a/load.environment.php +++ b/load.environment.php @@ -10,6 +10,9 @@ /** * Load any .env file. See /.env.example. + * + * Drupal has no official method for loading environment variables and uses + * getenv() in some places. */ -$dotenv = Dotenv::createImmutable(__DIR__); -$dotenv->safeLoad(); +$dotenv = Dotenv::createUnsafeImmutable(__DIR__); +$dotenv->load(); From a7dab54f624d04a0276e76dd6113c12760db35f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Norman=20Ka=CC=88mper-Leymann?= Date: Sun, 27 Dec 2020 16:43:52 +0100 Subject: [PATCH 03/14] Safe-load .env if existent to prevent Fatal error during site install. --- load.environment.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/load.environment.php b/load.environment.php index c275442d84..eb5e3a0f8f 100644 --- a/load.environment.php +++ b/load.environment.php @@ -6,13 +6,12 @@ */ use Dotenv\Dotenv; -use Dotenv\Exception\InvalidPathException; /** * Load any .env file. See /.env.example. * - * Drupal has no official method for loading environment variables and uses + * Drupal has no official method for loading environment variables and uses * getenv() in some places. */ $dotenv = Dotenv::createUnsafeImmutable(__DIR__); -$dotenv->load(); +$dotenv->safeLoad(); From eacd0558d93e2b4bcac7eb6e67b0cebdf97a125f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Norman=20K=C3=A4mper-Leymann?= Date: Tue, 12 Jan 2021 14:10:54 +0100 Subject: [PATCH 04/14] Update the update command. The command also needs to pick up `drupal/core-composer-scaffold`. See #585 and also https://www.drupal.org/docs/updating-drupal/updating-drupal-core-via-composer#s-update-drupal-core-code. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3dd7d5f853..1e2cfcb43d 100644 --- a/README.md +++ b/README.md @@ -58,7 +58,7 @@ new release of Drupal core. Follow the steps below to update your core files. -1. Run `composer update drupal/core-recommended drupal/core-dev --with-dependencies` to update Drupal Core and its dependencies. +1. Run `composer update "drupal/core-*" --with-dependencies` to update Drupal Core and its dependencies. 2. Run `git diff` to determine if any of the scaffolding files have changed. Review the files for any changes and restore any customizations to `.htaccess` or `robots.txt`. From 11fed1c14dcab0727fbe0cf4fd931d6a1aaae92b Mon Sep 17 00:00:00 2001 From: Florian Weber Date: Mon, 1 Mar 2021 14:03:13 +0100 Subject: [PATCH 05/14] Switch to Github Actions (#595) --- .github/workflows/ci.yml | 73 ++++++++++++++++++++++++++++++++++++++++ .travis.yml | 41 ---------------------- composer.json | 6 ++-- 3 files changed, 76 insertions(+), 44 deletions(-) create mode 100644 .github/workflows/ci.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000000..435662706d --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,73 @@ +name: CI + +on: [push] + +env: + COMPOSER_MEMORY_LIMIT: -1 + SIMPLETEST_DB: sqlite://tmp/site.sqlite + SIMPLETEST_BASE_URL: "http://127.0.0.1:8080" + +jobs: + build: + runs-on: 'ubuntu-20.04' + strategy: + fail-fast: false + matrix: + php-versions: ['7.3', '7.4', '8.0'] + drupal-release: ['stable'] + composer-channel: ['stable'] + include: + - php-versions: '8.0' + drupal-release: dev + composer-channel: stable + - php-versions: '8.0' + drupal-release: stable + composer-channel: snapshot + steps: + - name: Dump matrix context + env: + MATRIX_CONTEXT: ${{ toJSON(matrix) }} + run: echo "$MATRIX_CONTEXT" + + - name: Checkout + uses: actions/checkout@v2 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-versions }} + extensions: gd, pdo_sqlite + + - name: Update composer + run: composer --verbose self-update --${{ matrix.composer-channel }} + + - name: Dump composer verson + run: composer --version + + - name: Validate composer.json + run: composer --verbose validate + + - name: Install dependencies + run: composer --verbose install + + - if: matrix.drupal-release == 'dev' + run: composer --verbose require --no-update drupal/core-recommended:9.2.x-dev && composer --verbose require --no-update --dev drupal/core-dev:9.2.x-dev + + - if: matrix.drupal-release == 'dev' + run: composer --verbose update + + - run: ./vendor/bin/drush site-install --verbose --yes --db-url=sqlite://tmp/site.sqlite + + - run: ./vendor/bin/drush runserver $SIMPLETEST_BASE_URL & + + - run: until curl -s $SIMPLETEST_BASE_URL; do true; done > /dev/null + + # https://www.drupal.org/project/drupal/issues/3182653 + # https://www.drupal.org/node/3176567 + - if: ${{ matrix.php-versions == '7.4' }} || ${{ matrix.php-versions == '8.0' }} + run: composer require phpspec/prophecy-phpunit:^2 + + - name: Run a single unit test to verfiy the testing setup. + run: ./vendor/bin/phpunit -c ./web/core ./web/core/modules/user/tests/src/Unit/UserAccessControlHandlerTest.php + + - run: ./vendor/bin/drush diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 8f94fc41c5..0000000000 --- a/.travis.yml +++ /dev/null @@ -1,41 +0,0 @@ -language: php -dist: bionic -sudo: false - -php: - - 7.3 - - 7.4 - -env: - global: - - COMPOSER_MEMORY_LIMIT=-1 - - SIMPLETEST_DB=sqlite://tmp/site.sqlite - - SIMPLETEST_BASE_URL="http://127.0.0.1:8080" - matrix: - - RELEASE=stable COMPOSER_CHANNEL=stable - - RELEASE=dev COMPOSER_CHANNEL=stable - - RELEASE=stable COMPOSER_CHANNEL=snapshot - -before_install: - # https://www.drupal.org/project/drupal/issues/3107155 - - sudo echo "deb http://archive.ubuntu.com/ubuntu focal main restricted universe multiverse" >> /etc/apt/sources.list - - sudo apt-get update - - sudo apt-get -y install sqlite3/focal - - echo 'sendmail_path = /bin/true' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini - - phpenv config-rm xdebug.ini - - composer --verbose self-update --$COMPOSER_CHANNEL - - composer --version - -install: - - composer --verbose validate - - composer --verbose install - -script: - - if [[ $RELEASE = dev ]]; then composer --verbose require --no-update drupal/core-recommended:9.0.x-dev; composer --verbose require --no-update --dev drupal/core-dev:9.0.x-dev; fi; - - if [[ $RELEASE = dev ]]; then composer --verbose update; fi; - - ./vendor/bin/drush site-install --verbose --yes --db-url=sqlite://tmp/site.sqlite - - ./vendor/bin/drush runserver $SIMPLETEST_BASE_URL & - - until curl -s $SIMPLETEST_BASE_URL; do true; done > /dev/null - # Run a single unit test to verfiy the testing setup. - - ./vendor/bin/phpunit -c ./web/core ./web/core/modules/user/tests/src/Unit/UserAccessControlHandlerTest.php - - ./vendor/bin/drush diff --git a/composer.json b/composer.json index 3ab0e4f2ce..1e5828add3 100644 --- a/composer.json +++ b/composer.json @@ -19,14 +19,14 @@ "php": ">=7.3", "composer/installers": "^1.9", "cweagans/composer-patches": "^1.7", - "drupal/core-composer-scaffold": "^9.0", - "drupal/core-recommended": "^9.0", + "drupal/core-composer-scaffold": "^9.1", + "drupal/core-recommended": "^9.1", "drush/drush": "^10.3", "vlucas/phpdotenv": "^5.1", "webflo/drupal-finder": "^1.2" }, "require-dev": { - "drupal/core-dev": "^9.0", + "drupal/core-dev": "^9.1", "zaporylie/composer-drupal-optimizations": "^1.2" }, "conflict": { From 7ecc6d6d70f84dc47f517e7ccb84aa2165f71108 Mon Sep 17 00:00:00 2001 From: Florian Weber Date: Mon, 1 Mar 2021 14:04:12 +0100 Subject: [PATCH 06/14] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1e2cfcb43d..93c66aea64 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Composer template for Drupal projects -[![Build Status](https://travis-ci.org/drupal-composer/drupal-project.svg?branch=9.x)](https://travis-ci.org/drupal-composer/drupal-project) +[![CI](https://github.com/drupal-composer/drupal-project/actions/workflows/ci.yml/badge.svg?branch=9.x)](https://github.com/drupal-composer/drupal-project/actions/workflows/ci.yml) This project template provides a starter kit for managing your site dependencies with [Composer](https://getcomposer.org/). From 107bcf3df4dd923f3e869d4b39e77589b0b49f3e Mon Sep 17 00:00:00 2001 From: Dave Date: Wed, 22 Dec 2021 13:29:05 +0100 Subject: [PATCH 07/14] Fix typo in .github/workflows/ci.yml --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 435662706d..3eaf19adc6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -41,7 +41,7 @@ jobs: - name: Update composer run: composer --verbose self-update --${{ matrix.composer-channel }} - - name: Dump composer verson + - name: Dump composer version run: composer --version - name: Validate composer.json From b27e29ac03fefdacf046afa90b67ad69ab4e807a Mon Sep 17 00:00:00 2001 From: Florian Weber Date: Thu, 23 Dec 2021 10:24:45 +0100 Subject: [PATCH 08/14] Remove CI for PHP 7.3 --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3eaf19adc6..b225d20de6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,7 +13,7 @@ jobs: strategy: fail-fast: false matrix: - php-versions: ['7.3', '7.4', '8.0'] + php-versions: ['7.4', '8.0'] drupal-release: ['stable'] composer-channel: ['stable'] include: From 718d7662f78b422d03929c1b2b1aee43572237f4 Mon Sep 17 00:00:00 2001 From: Florian Weber Date: Thu, 23 Dec 2021 10:30:43 +0100 Subject: [PATCH 09/14] Update composer.json --- .github/workflows/ci.yml | 2 +- composer.json | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b225d20de6..f83c0f4c06 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -51,7 +51,7 @@ jobs: run: composer --verbose install - if: matrix.drupal-release == 'dev' - run: composer --verbose require --no-update drupal/core-recommended:9.2.x-dev && composer --verbose require --no-update --dev drupal/core-dev:9.2.x-dev + run: composer --verbose require --no-update drupal/core-recommended:9.4.x-dev && composer --verbose require --no-update --dev drupal/core-dev:9.4.x-dev - if: matrix.drupal-release == 'dev' run: composer --verbose update diff --git a/composer.json b/composer.json index 1e5828add3..3c6ae9111b 100644 --- a/composer.json +++ b/composer.json @@ -16,17 +16,17 @@ } ], "require": { - "php": ">=7.3", + "php": ">=7.4", "composer/installers": "^1.9", "cweagans/composer-patches": "^1.7", - "drupal/core-composer-scaffold": "^9.1", - "drupal/core-recommended": "^9.1", - "drush/drush": "^10.3", + "drupal/core-composer-scaffold": "^9.3", + "drupal/core-recommended": "^9.3", + "drush/drush": "^10.6", "vlucas/phpdotenv": "^5.1", "webflo/drupal-finder": "^1.2" }, "require-dev": { - "drupal/core-dev": "^9.1", + "drupal/core-dev": "^9.3", "zaporylie/composer-drupal-optimizations": "^1.2" }, "conflict": { From 2c488fd3a12915f4083ca0e34c7e90917dc09ccb Mon Sep 17 00:00:00 2001 From: Florian Weber Date: Mon, 24 Jan 2022 23:20:45 +0100 Subject: [PATCH 10/14] Update composer.json for composer 2.x with allow-plugins and remove zaporylie/composer-drupal-optimizations --- composer.json | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index 3c6ae9111b..4b7218a714 100644 --- a/composer.json +++ b/composer.json @@ -26,8 +26,7 @@ "webflo/drupal-finder": "^1.2" }, "require-dev": { - "drupal/core-dev": "^9.3", - "zaporylie/composer-drupal-optimizations": "^1.2" + "drupal/core-dev": "^9.3" }, "conflict": { "drupal/drupal": "*" @@ -36,7 +35,12 @@ "prefer-stable": true, "config": { "discard-changes": true, - "sort-packages": true + "sort-packages": true, + "allow-plugins": { + "composer/installers": true, + "cweagans/composer-patches": true, + "drupal/core-composer-scaffold": true + } }, "autoload": { "classmap": [ From beb4dd96f9d3a0d12cbb0541292ad8c8d8d6823c Mon Sep 17 00:00:00 2001 From: Florian Weber Date: Fri, 1 Jul 2022 10:16:33 +0200 Subject: [PATCH 11/14] Bump to Drupal 9.4 --- composer.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index 4b7218a714..715a35e94e 100644 --- a/composer.json +++ b/composer.json @@ -19,14 +19,14 @@ "php": ">=7.4", "composer/installers": "^1.9", "cweagans/composer-patches": "^1.7", - "drupal/core-composer-scaffold": "^9.3", - "drupal/core-recommended": "^9.3", - "drush/drush": "^10.6", + "drupal/core-composer-scaffold": "^9.4", + "drupal/core-recommended": "^9.4", + "drush/drush": "^11.0", "vlucas/phpdotenv": "^5.1", "webflo/drupal-finder": "^1.2" }, "require-dev": { - "drupal/core-dev": "^9.3" + "drupal/core-dev": "^9.4" }, "conflict": { "drupal/drupal": "*" From 61d1e8bb202a4c1e076a1e4b3d042ae86c280e0b Mon Sep 17 00:00:00 2001 From: Florian Weber Date: Fri, 1 Jul 2022 10:18:13 +0200 Subject: [PATCH 12/14] Allow dealerdirect/phpcodesniffer-composer-installer by default --- composer.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 715a35e94e..15561eea1b 100644 --- a/composer.json +++ b/composer.json @@ -39,7 +39,8 @@ "allow-plugins": { "composer/installers": true, "cweagans/composer-patches": true, - "drupal/core-composer-scaffold": true + "drupal/core-composer-scaffold": true, + "dealerdirect/phpcodesniffer-composer-installer": true } }, "autoload": { From 7ed1e4f3006375cc4918ad24ad8b1ec16d61434e Mon Sep 17 00:00:00 2001 From: Florian Weber Date: Fri, 1 Jul 2022 10:20:19 +0200 Subject: [PATCH 13/14] Test PHP 7.4 and 8.1 --- .github/workflows/ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f83c0f4c06..669bb18ef4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,14 +13,14 @@ jobs: strategy: fail-fast: false matrix: - php-versions: ['7.4', '8.0'] + php-versions: ['7.4', '8.1'] drupal-release: ['stable'] composer-channel: ['stable'] include: - - php-versions: '8.0' + - php-versions: '8.1' drupal-release: dev composer-channel: stable - - php-versions: '8.0' + - php-versions: '8.1' drupal-release: stable composer-channel: snapshot steps: @@ -64,7 +64,7 @@ jobs: # https://www.drupal.org/project/drupal/issues/3182653 # https://www.drupal.org/node/3176567 - - if: ${{ matrix.php-versions == '7.4' }} || ${{ matrix.php-versions == '8.0' }} + - if: ${{ matrix.php-versions == '7.4' }} || ${{ matrix.php-versions == '8.1' }} run: composer require phpspec/prophecy-phpunit:^2 - name: Run a single unit test to verfiy the testing setup. From 137b38fa130fe801dafaac91114b3c30bd9c02c0 Mon Sep 17 00:00:00 2001 From: Vincent Leduc Date: Wed, 6 Jul 2022 07:49:21 -0400 Subject: [PATCH 14/14] Update php requirements in README.md php 7.4 is minimum required version of php with respect to Drupal 9.4 and drush 11. --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 93c66aea64..2425542697 100644 --- a/README.md +++ b/README.md @@ -123,7 +123,7 @@ section of composer.json: ### How do I specify a PHP version ? -This project supports PHP 7.3 as minimum version (see [Environment requirements of Drupal 9](https://www.drupal.org/docs/understanding-drupal/how-drupal-9-was-made-and-what-is-included/environment-requirements-of)), however it's possible that a `composer update` will upgrade some package that will then require PHP 7.3+. +This project supports PHP 7.4 as minimum version (see Drupal 9.4 [PHP requirements](https://www.drupal.org/docs/system-requirements/php-requirements#versions)) and [Drop official PHP 7.3 support in Drupal 9.4](https://www.drupal.org/project/drupal/issues/2917655), however it's possible that a `composer update` will upgrade some package that will then require PHP 7.4+. To prevent this you can add this code to specify the PHP version you want to use in the `config` section of `composer.json`: @@ -131,7 +131,7 @@ To prevent this you can add this code to specify the PHP version you want to use "config": { "sort-packages": true, "platform": { - "php": "7.3.19" + "php": "7.4.30" } }, ```