Skip to content

Commit 5c633a1

Browse files
zanvidmarMPParsleywebflogreg-1-andersonpaulvandenburg
authored
update 8x branch (#4)
* Deprecate PHP 7.0 and 7.1 (drupal-composer#518) * Revert "Deprecate PHP 7.1" (drupal-composer#521) This reverts commit 5085410. * Issue drupal-composer#518: Bump minimum php version to 7.0.8 * Update CI to Ubuntu 18.04 (drupal-composer#520) * Revert "Update CI to Ubuntu 18.04" (drupal-composer#526) This reverts commit ee5bf36. * Add 'contrib' to Drush commandfile installer path (drupal-composer#525) * Prefer usage of && operator instead of "and" (drupal-composer#530) * Use scaffold plugin and composer packages from Drupal core 8.8.0 (drupal-composer#522) * Issue drupal-composer#539: Remove deprecated CONFIG_SYNC_DIRECTORY Co-authored-by: Maarten Segers <[email protected]> Co-authored-by: Florian Weber <[email protected]> Co-authored-by: Greg Anderson <[email protected]> Co-authored-by: Paul <[email protected]>
1 parent ec0f411 commit 5c633a1

File tree

5 files changed

+51
-61
lines changed

5 files changed

+51
-61
lines changed

.travis.yml

+7-10
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,12 @@ install:
2929

3030
script:
3131
- if [[ $RELEASE = dev ]]; then composer --verbose remove --no-update drupal/console; fi;
32-
- if [[ $RELEASE = dev ]]; then composer --verbose require --no-update drupal/core:8.8.x-dev webflo/drupal-core-require-dev:8.8.x-dev; fi;
32+
- if [[ $RELEASE = dev ]]; then composer --verbose require --no-update drupal/core:8.8.x-dev; composer --verbose require --no-update --dev drupal/core-dev:8.8.x-dev; fi;
3333
- if [[ $RELEASE = dev ]]; then composer --verbose update; fi;
34-
- cd $TRAVIS_BUILD_DIR/web
35-
- ./../vendor/bin/drush site-install --verbose --yes --db-url=sqlite://tmp/site.sqlite
36-
- ./../vendor/bin/drush runserver $SIMPLETEST_BASE_URL &
34+
- ./vendor/bin/drush site-install --verbose --yes --db-url=sqlite://tmp/site.sqlite
35+
- ./vendor/bin/drush runserver $SIMPLETEST_BASE_URL &
3736
- until curl -s $SIMPLETEST_BASE_URL; do true; done > /dev/null
38-
# Skip core/tests/Drupal/Tests/ComposerIntegrationTest.php because web/ has no composer.json
39-
# Ignore PageCache group temporarily, @see https://www.drupal.org/node/2770673
40-
# Ignore Setup group temporarily, @see https://www.drupal.org/node/2962157
41-
- ./../vendor/bin/phpunit -c core --testsuite unit --exclude-group Composer,DependencyInjection,PageCache,Setup
42-
- ./../vendor/bin/drush
43-
- if [[ $RELEASE = stable ]]; then ./../vendor/bin/drupal; fi;
37+
# Run a single unit test to verfiy the testing setup.
38+
- ./vendor/bin/phpunit -c ./web/core ./web/core/modules/system/tests/src/Unit/SystemRequirementsTest.php
39+
- ./vendor/bin/drush
40+
- if [[ $RELEASE = stable ]]; then ./vendor/bin/drupal; fi;

README.md

+24-24
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ the [Documentation on drupal.org](https://www.drupal.org/node/2471553).
1414
First you need to [install composer](https://getcomposer.org/doc/00-intro.md#installation-linux-unix-osx).
1515

1616
> Note: The instructions below refer to the [global composer installation](https://getcomposer.org/doc/00-intro.md#globally).
17-
You might need to replace `composer` with `php composer.phar` (or similar)
17+
You might need to replace `composer` with `php composer.phar` (or similar)
1818
for your setup.
1919

2020
After that you can create the project:
@@ -23,16 +23,16 @@ After that you can create the project:
2323
composer create-project drupal-composer/drupal-project:8.x-dev some-dir --no-interaction
2424
```
2525

26-
With `composer require ...` you can download new dependencies to your
26+
With `composer require ...` you can download new dependencies to your
2727
installation.
2828

2929
```
3030
cd some-dir
3131
composer require drupal/devel:~1.0
3232
```
3333

34-
The `composer create-project` command passes ownership of all files to the
35-
project that is created. You should create a new git repository, and commit
34+
The `composer create-project` command passes ownership of all files to the
35+
project that is created. You should create a new git repository, and commit
3636
all files not excluded by the .gitignore file.
3737

3838
## What does the template do?
@@ -53,26 +53,26 @@ When installing the given `composer.json` some tasks are taken care of:
5353

5454
## Updating Drupal Core
5555

56-
This project will attempt to keep all of your Drupal Core files up-to-date; the
57-
project [drupal-composer/drupal-scaffold](https://github.com/drupal-composer/drupal-scaffold)
58-
is used to ensure that your scaffold files are updated every time drupal/core is
59-
updated. If you customize any of the "scaffolding" files (commonly .htaccess),
60-
you may need to merge conflicts if any of your modified files are updated in a
56+
This project will attempt to keep all of your Drupal Core files up-to-date; the
57+
project [drupal/core-composer-scaffold](https://github.com/drupal/core-composer-scaffold)
58+
is used to ensure that your scaffold files are updated every time drupal/core is
59+
updated. If you customize any of the "scaffolding" files (commonly .htaccess),
60+
you may need to merge conflicts if any of your modified files are updated in a
6161
new release of Drupal core.
6262

6363
Follow the steps below to update your core files.
6464

65-
1. Run `composer update drupal/core webflo/drupal-core-require-dev "symfony/*" --with-dependencies` to update Drupal Core and its dependencies.
66-
1. Run `git diff` to determine if any of the scaffolding files have changed.
67-
Review the files for any changes and restore any customizations to
65+
1. Run `composer update drupal/core drupal/core-dev --with-dependencies` to update Drupal Core and its dependencies.
66+
2. Run `git diff` to determine if any of the scaffolding files have changed.
67+
Review the files for any changes and restore any customizations to
6868
`.htaccess` or `robots.txt`.
6969
1. Commit everything all together in a single commit, so `web` will remain in
7070
sync with the `core` when checking out branches or running `git bisect`.
71-
1. In the event that there are non-trivial conflicts in step 2, you may wish
72-
to perform these steps on a branch, and use `git merge` to combine the
73-
updated core files with your customized files. This facilitates the use
74-
of a [three-way merge tool such as kdiff3](http://www.gitshah.com/2010/12/how-to-setup-kdiff-as-diff-tool-for-git.html). This setup is not necessary if your changes are simple;
75-
keeping all of your modifications at the beginning or end of the file is a
71+
1. In the event that there are non-trivial conflicts in step 2, you may wish
72+
to perform these steps on a branch, and use `git merge` to combine the
73+
updated core files with your customized files. This facilitates the use
74+
of a [three-way merge tool such as kdiff3](http://www.gitshah.com/2010/12/how-to-setup-kdiff-as-diff-tool-for-git.html). This setup is not necessary if your changes are simple;
75+
keeping all of your modifications at the beginning or end of the file is a
7676
good strategy to keep merges easy.
7777

7878
## Generate composer.json from existing project
@@ -86,12 +86,12 @@ that the generated `composer.json` might differ from this project's file.
8686

8787
### Should I commit the contrib modules I download?
8888

89-
Composer recommends **no**. They provide [argumentation against but also
89+
Composer recommends **no**. They provide [argumentation against but also
9090
workrounds if a project decides to do it anyway](https://getcomposer.org/doc/faqs/should-i-commit-the-dependencies-in-my-vendor-directory.md).
9191

9292
### Should I commit the scaffolding files?
9393

94-
The [drupal-scaffold](https://github.com/drupal-composer/drupal-scaffold) plugin can download the scaffold files (like
94+
The [Drupal Composer Scaffold](https://github.com/drupal/core-composer-scaffold) plugin can download the scaffold files (like
9595
index.php, update.php, …) to the web/ directory of your project. If you have not customized those files you could choose
9696
to not check them into your version control system (e.g. git). If that is the case for your project it might be
9797
convenient to automatically run the drupal-scaffold plugin after every install or update of your project. You can
@@ -111,11 +111,11 @@ achieve that by registering `@composer drupal:scaffold` as post-install and post
111111
```
112112
### How can I apply patches to downloaded modules?
113113

114-
If you need to apply patches (depending on the project being modified, a pull
115-
request is often a better solution), you can do so with the
114+
If you need to apply patches (depending on the project being modified, a pull
115+
request is often a better solution), you can do so with the
116116
[composer-patches](https://github.com/cweagans/composer-patches) plugin.
117117

118-
To add a patch to drupal module foobar insert the patches section in the extra
118+
To add a patch to drupal module foobar insert the patches section in the extra
119119
section of composer.json:
120120
```json
121121
"extra": {
@@ -132,14 +132,14 @@ Follow the instructions in the [documentation on drupal.org](https://www.drupal.
132132

133133
### How do I specify a PHP version ?
134134

135-
This project supports PHP 5.6 as minimum version (see [Drupal 8 PHP requirements](https://www.drupal.org/docs/8/system-requirements/drupal-8-php-requirements)), however it's possible that a `composer update` will upgrade some package that will then require PHP 7+.
135+
This project supports PHP 7.0 as minimum version (see [Drupal 8 PHP requirements](https://www.drupal.org/docs/8/system-requirements/drupal-8-php-requirements)), however it's possible that a `composer update` will upgrade some package that will then require PHP 7+.
136136

137137
To prevent this you can add this code to specify the PHP version you want to use in the `config` section of `composer.json`:
138138
```json
139139
"config": {
140140
"sort-packages": true,
141141
"platform": {
142-
"php": "5.6.40"
142+
"php": "7.0.33"
143143
}
144144
},
145145
```

composer.json

+12-14
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,19 @@
1616
}
1717
],
1818
"require": {
19-
"php": ">=5.6",
19+
"php": ">=7.0.8",
2020
"composer/installers": "^1.2",
2121
"cweagans/composer-patches": "^1.6.5",
22-
"drupal-composer/drupal-scaffold": "^2.5",
2322
"drupal/console": "^1.0.2",
24-
"drupal/core": "^8.7.0",
25-
"drush/drush": "^9.0.0",
26-
"vlucas/phpdotenv": "^2.4",
23+
"drupal/core": "^8.8.0",
24+
"drupal/core-composer-scaffold": "^8.8.0",
25+
"drush/drush": "^9.7.1 | ^10.0.0",
26+
"vlucas/phpdotenv": "^4.0",
2727
"webflo/drupal-finder": "^1.0.0",
28-
"webmozart/path-util": "^2.3",
2928
"zaporylie/composer-drupal-optimizations": "^1.0"
3029
},
3130
"require-dev": {
32-
"webflo/drupal-core-require-dev": "^8.7.0"
31+
"drupal/core-dev": "^8.8.0"
3332
},
3433
"conflict": {
3534
"drupal/drupal": "*"
@@ -64,19 +63,18 @@
6463
"patchLevel": {
6564
"drupal/core": "-p2"
6665
},
66+
"drupal-scaffold": {
67+
"locations": {
68+
"web-root": "web/"
69+
}
70+
},
6771
"installer-paths": {
6872
"web/core": ["type:drupal-core"],
6973
"web/libraries/{$name}": ["type:drupal-library"],
7074
"web/modules/contrib/{$name}": ["type:drupal-module"],
7175
"web/profiles/contrib/{$name}": ["type:drupal-profile"],
7276
"web/themes/contrib/{$name}": ["type:drupal-theme"],
73-
"drush/Commands/{$name}": ["type:drupal-drush"]
74-
},
75-
"drupal-scaffold": {
76-
"initial": {
77-
".editorconfig": "../.editorconfig",
78-
".gitattributes": "../.gitattributes"
79-
}
77+
"drush/Commands/contrib/{$name}": ["type:drupal-drush"]
8078
}
8179
}
8280
}

load.environment.php

+2-7
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,5 @@
1111
/**
1212
* Load any .env file. See /.env.example.
1313
*/
14-
$dotenv = new Dotenv(__DIR__);
15-
try {
16-
$dotenv->load();
17-
}
18-
catch (InvalidPathException $e) {
19-
// Do nothing. Production environments rarely use .env files.
20-
}
14+
$dotenv = Dotenv::createImmutable(__DIR__);
15+
$dotenv->safeLoad();

scripts/composer/ScriptHandler.php

+6-6
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
use Composer\Script\Event;
1111
use Composer\Semver\Comparator;
12+
use Drupal\Core\Site\Settings;
1213
use DrupalFinder\DrupalFinder;
1314
use Symfony\Component\Filesystem\Filesystem;
1415
use Webmozart\PathUtil\Path;
@@ -36,15 +37,14 @@ public static function createRequiredFiles(Event $event) {
3637
}
3738

3839
// Prepare the settings file for installation
39-
if (!$fs->exists($drupalRoot . '/sites/default/settings.php') and $fs->exists($drupalRoot . '/sites/default/default.settings.php')) {
40+
if (!$fs->exists($drupalRoot . '/sites/default/settings.php') && $fs->exists($drupalRoot . '/sites/default/default.settings.php')) {
4041
$fs->copy($drupalRoot . '/sites/default/default.settings.php', $drupalRoot . '/sites/default/settings.php');
4142
require_once $drupalRoot . '/core/includes/bootstrap.inc';
4243
require_once $drupalRoot . '/core/includes/install.inc';
43-
$settings['config_directories'] = [
44-
CONFIG_SYNC_DIRECTORY => (object) [
45-
'value' => Path::makeRelative($drupalFinder->getComposerRoot() . '/config/sync', $drupalRoot),
46-
'required' => TRUE,
47-
],
44+
new Settings([]);
45+
$settings['settings']['config_sync_directory'] = (object) [
46+
'value' => Path::makeRelative($drupalFinder->getComposerRoot() . '/config/sync', $drupalRoot),
47+
'required' => TRUE,
4848
];
4949
drupal_rewrite_settings($settings, $drupalRoot . '/sites/default/settings.php');
5050
$fs->chmod($drupalRoot . '/sites/default/settings.php', 0666);

0 commit comments

Comments
 (0)