diff --git a/.github/workflows/test-drupal-setup.yml b/.github/workflows/test-drupal-setup.yml index 34ce83f289..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 @@ -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" 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); }