Skip to content

Commit 8d442cc

Browse files
authored
improve: DEV-2095: update to latest versions, Drupal 10, remove deprecated drunomics/multisite-matcher (#69)
* improve: DEV-2095: update to latest versions, Drupal 10, remove deprecated drunomics/multisite-matcher * Update composer.json * update dotenv loader to symfony/dotenv v5
1 parent 293223c commit 8d442cc

4 files changed

Lines changed: 23 additions & 46 deletions

File tree

.build-gitignore

Lines changed: 0 additions & 11 deletions
This file was deleted.

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Builds upon https://github.com/drupal-composer/drupal-project.
1010
| Git branch/tag: | Drupal core: |
1111
|--- | --- |
1212
| 5.x | Drupal 8 |
13-
| 6.x | Drupal 9 |
13+
| 6.x | Drupal 9+ |
1414

1515
## Usage
1616

@@ -67,4 +67,3 @@ The following variables are supported:
6767
Environment variables that can be configured project-wide are managed in
6868
`.defaults.env`. Refer to the prepared variables in the file for environment
6969
variables tha are already supported in the template.
70-

composer.json

Lines changed: 15 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "drunomics/drupal-project",
3-
"description": "Project template for drunomics Drupal 8 projects with composer",
3+
"description": "Project template for drunomics Drupal projects",
44
"type": "project",
55
"license": "GPL-2.0-or-later",
66
"authors": [
@@ -11,15 +11,14 @@
1111
],
1212
"require": {
1313
"cweagans/composer-patches": "^1.7.2",
14-
"drunomics/multisite-request-matcher": "^1.7.1",
15-
"drupal/core-composer-scaffold": "^9",
16-
"drupal/core-recommended": "^9",
14+
"drupal/core-composer-scaffold": "^10",
15+
"drupal/core-recommended": "^10",
1716
"drush/drush": "*",
1817
"oomphinc/composer-installers-extender": "^2.0.1",
19-
"symfony/dotenv": "^3.4.47"
18+
"symfony/dotenv": "^5.4.22"
2019
},
2120
"require-dev": {
22-
"drupal/core-dev": "^9",
21+
"drupal/core-dev": "^10",
2322
"drunomics/playwright-drupal-utils": "^1.0.0"
2423
},
2524
"conflict": {
@@ -75,21 +74,17 @@
7574
"cs": "vendor/bin/phpcs --colors",
7675
"cbf": "vendor/bin/phpcbf",
7776
"check-security": "local-php-security-checker && composer audit",
78-
"test": "./tests/behat/run.sh --colors"
77+
"test": "./tests/behat/run.sh --colors"
7978
},
8079
"extra": {
8180
"drupal-scaffold": {
8281
"file-mapping": {
83-
"[web-root]/sites/development.services.yml": {
84-
"mode": "skip"
85-
},
86-
"[web-root]/sites/example.settings.local.php": "web/sites/example.local.settings.php",
87-
"[web-root]/sites/default/default.services.yml": {
88-
"mode": "replace",
89-
"path": "web/sites/all/services.yml",
90-
"overwrite": false
91-
},
92-
"[web-root]/sites/example/default.settings.php": "web/core/assets/scaffold/files/default.settings.php"
82+
"[web-root]/sites/development.services.yml": false,
83+
"[web-root]/sites/default/default.services.yml": false,
84+
"[web-root]/sites/default/default.settings.php": false,
85+
"[web-root]/sites/example.local.settings.php": "web/sites/example.local.settings.php",
86+
"[web-root]/sites/all/example.default.services.yml": "web/core/assets/scaffold/files/default.services.yml",
87+
"[web-root]/sites/all/example.default.settings.php": "web/core/assets/scaffold/files/default.settings.php"
9388
},
9489
"locations": {
9590
"web-root": "web/"
@@ -120,8 +115,8 @@
120115
},
121116
"tools": {
122117
"phapp": {
123-
"url": "https://github.com/drunomics/phapp-cli/releases/download/0.7.0/phapp.phar",
124-
"version": "0.7.0"
118+
"url": "https://github.com/drunomics/phapp-cli/releases/download/0.7.1/phapp.phar",
119+
"version": "0.7.1"
125120
},
126121
"local-php-security-checker": {
127122
"url": "https://github.com/fabpot/local-php-security-checker/releases/download/v2.0.6/local-php-security-checker_2.0.6_linux_amd64",
@@ -137,12 +132,7 @@
137132
"test": "Run tests."
138133
},
139134
"enable-patching": true,
140-
"composer-exit-on-patch-failure": true,
141-
"patches": {
142-
"lsolesen/pel": {
143-
"#183: PelIllegalFormatException: Unknown format: 0x0": "https://patch-diff.githubusercontent.com/raw/pel/pel/pull/199.patch"
144-
}
145-
}
135+
"composer-exit-on-patch-failure": true
146136
},
147137
"config": {
148138
"platform": {
@@ -161,9 +151,5 @@
161151
"drupal/core-composer-scaffold": true,
162152
"drupal/core-vendor-hardening": true
163153
}
164-
},
165-
"suggest": {
166-
"drunomics/dsk_media": "1.*",
167-
"drunomics/dsk_devel": "1.*"
168154
}
169155
}

dotenv/loader.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -198,15 +198,18 @@ public static function getSiteVariables($site = NULL, $site_variant = '') {
198198
// The following process must follow the same logic as loader.sh, but instead
199199
// evaluating .env content with bash we use dotenv to parse it.
200200
$dotenv = new Dotenv();
201-
$dotenv->populate($dotenv->parse(PhappEnvironmentLoader::getDotenvFiles()));
202-
$dotenv->populate($dotenv->parse(PhappEnvironmentLoader::determineEnvironment()));
201+
$dotenv->usePutenv(TRUE);
202+
$dotenv->populate($dotenv->parse(PhappEnvironmentLoader::getDotenvFiles()), TRUE);
203+
if ($env = PhappEnvironmentLoader::determineEnvironment()) {
204+
$dotenv->populate($dotenv->parse($env), TRUE);
205+
}
203206
if (!getenv('PHAPP_ENV')) {
204207
die("Missing .env file or PHAPP_ENV environment variable. Did you run phapp setup?");
205208
}
206-
$dotenv->populate($dotenv->parse(PhappEnvironmentLoader::prepareDeterminedEnvironment()));
209+
$dotenv->populate($dotenv->parse(PhappEnvironmentLoader::prepareDeterminedEnvironment()), TRUE);
207210

208211
// Match the request and prepare site-specific dotenv vars.
209212
$site = drunomics\MultisiteRequestMatcher\RequestMatcher::getInstance()
210213
->match();
211-
$dotenv->populate($dotenv->parse(PhappEnvironmentLoader::prepareAppEnvironment()));
214+
$dotenv->populate($dotenv->parse(PhappEnvironmentLoader::prepareAppEnvironment()), TRUE);
212215
}

0 commit comments

Comments
 (0)