From b8c06b926c9daa06f15283377930d41ed0e53bc9 Mon Sep 17 00:00:00 2001 From: Wolfgang Ziegler Date: Tue, 16 Apr 2024 13:01:28 +0200 Subject: [PATCH 1/3] tests: fix tests to work after updates --- .github/workflows/test-drupal-setup.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-drupal-setup.yml b/.github/workflows/test-drupal-setup.yml index 34ce83f289..93451cc2bd 100644 --- a/.github/workflows/test-drupal-setup.yml +++ b/.github/workflows/test-drupal-setup.yml @@ -37,6 +37,7 @@ jobs: - name: Install composer dependencies. run: | composer config platform-check false + composer config --no-plugins allow-plugins.phpstan/extension-installer true composer create-project composer install - name: Setup the environment @@ -54,4 +55,4 @@ jobs: docker-compose exec cli phapp install --no-build - name: Check connection and response of the site run: | - curl -v http://example.drupal-project.localdev.space | grep "Drupal 9" + curl -v http://example.drupal-project.localdev.space | grep "Drupal 10" From 2dbfe11110aa8aa119aa1ec937932a66cc4345ef Mon Sep 17 00:00:00 2001 From: Wolfgang Ziegler Date: Tue, 16 Apr 2024 13:14:16 +0200 Subject: [PATCH 2/3] fix: fix dotenv loader to work without request matcher and to support grouping --- dotenv/loader.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/dotenv/loader.php b/dotenv/loader.php index 627fcbe007..31b7edf5ad 100644 --- a/dotenv/loader.php +++ b/dotenv/loader.php @@ -111,6 +111,14 @@ public static function prepareAppEnvironment() { if (file_exists(__DIR__ . '/sites/all.env')) { $vars .= file_get_contents(__DIR__ . '/sites/all.env') . "\n"; } + // Support dots in the environment name and load files by prefix. + // This allows grouping environments by host having shared settings. + if (strpos($phapp_env, '.') !== FALSE) { + $parts = explode('.', $phapp_env, 2); + if (file_exists(__DIR__ . '/sites/all.env-' . $parts[0] . '.env')) { + $vars .= file_get_contents(__DIR__ . '/sites/all.env-' . $parts[0] . '.env') . "\n"; + } + } // Support per-environment all.env files. if (file_exists(__DIR__ . '/sites/all.env-' . $phapp_env . '.env')) { $vars .= file_get_contents(__DIR__ . '/sites/all.env-' . $phapp_env . '.env') . "\n"; @@ -209,7 +217,6 @@ public static function getSiteVariables($site = NULL, $site_variant = '') { $dotenv->populate($dotenv->parse(PhappEnvironmentLoader::prepareDeterminedEnvironment()), TRUE); // Match the request and prepare site-specific dotenv vars. - $site = drunomics\MultisiteRequestMatcher\RequestMatcher::getInstance() - ->match(); + $site = PhappEnvironmentLoader::determineActiveSite(); $dotenv->populate($dotenv->parse(PhappEnvironmentLoader::prepareAppEnvironment()), TRUE); } From bb42b10b2047fbf9fe4dc1c970893c8be8e65954 Mon Sep 17 00:00:00 2001 From: Wolfgang Ziegler Date: Tue, 16 Apr 2024 13:18:28 +0200 Subject: [PATCH 3/3] Update test-drupal-setup.yml --- .github/workflows/test-drupal-setup.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-drupal-setup.yml b/.github/workflows/test-drupal-setup.yml index 93451cc2bd..370d19ce1d 100644 --- a/.github/workflows/test-drupal-setup.yml +++ b/.github/workflows/test-drupal-setup.yml @@ -6,14 +6,14 @@ on: branches: - '6.**' pull_request: - types: [opened, reopened] + types: [opened, reopened, edited] jobs: test-drupal-setup: name: Build and install drupal project runs-on: ubuntu-latest timeout-minutes: 10 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Setup PHP run: | sudo update-alternatives --set php /usr/bin/php8.1