Skip to content

Commit b802bb3

Browse files
elizollerweitzmanzaporyliemorenstratwebflo
authored andcommitted
Update to Drupal 8.8.1 (islandora-deprecated#34)
* Honor .env files and suggest usage (drupal-composer#351) * Remove extra whitespace (drupal-composer#371) * Updated argument name * Bump minimal version * Bump minimal version to 8.5.3 * Fix installer path for drush commandfiles. * Update drupal-composer/drupal-scaffold drupal-composer/drupal-scaffold is a full featured plugin and provides its own command. * Fix tests on Travis CI (drupal-composer#405) * Copy the editor config and gitattributes from drupal to the root. (drupal-composer#404) * Remove "drupal-scaffold" from scripts (drupal-composer#275) * Fix typo in README.md * Remove unused use statement. (drupal-composer#406) * Adjust default core patch level to -p2. (drupal-composer#418) * Bump minimum required composer-patches version to support default patch level (drupal-composer#410) * Update composer.json to require latest stable version of Drupal (drupal-composer#424) * Require zaporylie/composer-drupal-optimizations (drupal-composer#442) * Issue drupal-composer#408: Bump minimum PHP version to 5.6 * Removing redundant "--stability dev" from installation command (drupal-composer#450) Fixes drupal-composer#449. * Added "composer-exit-on-patch-failure": true option to composer.json (drupal-composer#420) * Sync new lines at the end of the files (drupal-composer#453) * Quote wildcards to avoid issues in some shells (drupal-composer#456) * Add PHP 7.3 to Travis CI (drupal-composer#476) * Change createRequiredFiles messages to reflect what occured (drupal-composer#467) * Drop PHP 5.6 testing (drupal-composer#489) * Bump minimum version to 8.7.0 (drupal-composer#488) * Update .travis.yml * 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) * update to drupal 8.8.0 * replace webflo/drupal-core-require-dev with drupal/core-dev * Use scaffold plugin and composer packages from Drupal core 8.8.0 (drupal-composer#522) * Issue drupal-composer#539: Remove deprecated CONFIG_SYNC_DIRECTORY * update to 8.8.1 Co-authored-by: Moshe Weitzman <[email protected]> Co-authored-by: Jakub Piasecki <[email protected]> Co-authored-by: Markus Orenstrat <[email protected]> Co-authored-by: Florian Weber <[email protected]> Co-authored-by: Rodrigo <[email protected]> Co-authored-by: Norman Kämper-Leymann <[email protected]> Co-authored-by: Alex Milkovskyi <[email protected]> Co-authored-by: Dezső BICZÓ <[email protected]> Co-authored-by: Matthew Grasmick <[email protected]> Co-authored-by: Andy Postnikov <[email protected]> Co-authored-by: Hans Fredrik Nordhaug <[email protected]> Co-authored-by: Maarten Segers <[email protected]> Co-authored-by: Peter Kokot <[email protected]> Co-authored-by: Simon Perdrisat <[email protected]> Co-authored-by: Charles Tanton <[email protected]> Co-authored-by: Greg Anderson <[email protected]> Co-authored-by: Paul <[email protected]>
1 parent 1428793 commit b802bb3

File tree

6 files changed

+159
-8187
lines changed

6 files changed

+159
-8187
lines changed

.travis.yml

+7-10
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,12 @@ install:
3434

3535
script:
3636
- if [[ $RELEASE = dev ]]; then composer --verbose remove --no-update drupal/console; fi;
37-
- 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;
37+
- 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;
3838
- if [[ $RELEASE = dev ]]; then composer --verbose update; fi;
39-
- cd $TRAVIS_BUILD_DIR/web
40-
- ./../vendor/bin/drush site-install --verbose --yes --db-url=sqlite://tmp/site.sqlite
41-
- ./../vendor/bin/drush runserver $SIMPLETEST_BASE_URL &
39+
- ./vendor/bin/drush site-install --verbose --yes --db-url=sqlite://tmp/site.sqlite
40+
- ./vendor/bin/drush runserver $SIMPLETEST_BASE_URL &
4241
- until curl -s $SIMPLETEST_BASE_URL; do true; done > /dev/null
43-
# Skip core/tests/Drupal/Tests/ComposerIntegrationTest.php because web/ has no composer.json
44-
# Ignore PageCache group temporarily, @see https://www.drupal.org/node/2770673
45-
# Ignore Setup group temporarily, @see https://www.drupal.org/node/2962157
46-
- ./../vendor/bin/phpunit -c core --testsuite unit --exclude-group Composer,DependencyInjection,PageCache,Setup
47-
- ./../vendor/bin/drush
48-
- if [[ $RELEASE = stable ]]; then ./../vendor/bin/drupal; fi;
42+
# Run a single unit test to verfiy the testing setup.
43+
- ./vendor/bin/phpunit -c ./web/core ./web/core/modules/system/tests/src/Unit/SystemRequirementsTest.php
44+
- ./vendor/bin/drush
45+
- if [[ $RELEASE = stable ]]; then ./vendor/bin/drupal; fi;

README.md

+132
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
[![LICENSE](https://img.shields.io/badge/license-GPLv2-blue.svg?style=flat-square)](./LICENSE)
77

88
## Introduction
9+
This project template provides a starter kit for managing your site
10+
dependencies with [Composer](https://getcomposer.org/).
911

1012
Fork of [drupal-composer/drupal-project](https://github.com/drupal-composer/drupal-project) used to pin down Drupal core versions
1113
for [islandora-playbook](https://github.com/Islandora-Devops/islandora-playbook).
@@ -46,3 +48,133 @@ We recommend using the [islandora-playbook](https://github.com/Islandora-Devops/
4648
## License
4749

4850
[GPLv2](http://www.gnu.org/licenses/gpl-2.0.txt)
51+
> Note: The instructions below refer to the [global composer installation](https://getcomposer.org/doc/00-intro.md#globally).
52+
You might need to replace `composer` with `php composer.phar` (or similar)
53+
for your setup.
54+
55+
After that you can create the project:
56+
57+
```
58+
composer create-project drupal-composer/drupal-project:8.x-dev some-dir --no-interaction
59+
```
60+
61+
With `composer require ...` you can download new dependencies to your
62+
installation.
63+
64+
```
65+
cd some-dir
66+
composer require drupal/devel:~1.0
67+
```
68+
69+
The `composer create-project` command passes ownership of all files to the
70+
project that is created. You should create a new git repository, and commit
71+
all files not excluded by the .gitignore file.
72+
73+
## What does the template do?
74+
75+
When installing the given `composer.json` some tasks are taken care of:
76+
77+
* Drupal will be installed in the `web`-directory.
78+
* Autoloader is implemented to use the generated composer autoloader in `vendor/autoload.php`,
79+
instead of the one provided by Drupal (`web/vendor/autoload.php`).
80+
* Modules (packages of type `drupal-module`) will be placed in `web/modules/contrib/`
81+
* Theme (packages of type `drupal-theme`) will be placed in `web/themes/contrib/`
82+
* Profiles (packages of type `drupal-profile`) will be placed in `web/profiles/contrib/`
83+
* Creates default writable versions of `settings.php` and `services.yml`.
84+
* Creates `web/sites/default/files`-directory.
85+
* Latest version of drush is installed locally for use at `vendor/bin/drush`.
86+
* Latest version of DrupalConsole is installed locally for use at `vendor/bin/drupal`.
87+
* Creates environment variables based on your .env file. See [.env.example](.env.example).
88+
89+
## Updating Drupal Core
90+
91+
This project will attempt to keep all of your Drupal Core files up-to-date; the
92+
project [drupal/core-composer-scaffold](https://github.com/drupal/core-composer-scaffold)
93+
is used to ensure that your scaffold files are updated every time drupal/core is
94+
updated. If you customize any of the "scaffolding" files (commonly .htaccess),
95+
you may need to merge conflicts if any of your modified files are updated in a
96+
new release of Drupal core.
97+
98+
Follow the steps below to update your core files.
99+
100+
1. Run `composer update drupal/core drupal/core-dev --with-dependencies` to update Drupal Core and its dependencies.
101+
2. Run `git diff` to determine if any of the scaffolding files have changed.
102+
Review the files for any changes and restore any customizations to
103+
`.htaccess` or `robots.txt`.
104+
1. Commit everything all together in a single commit, so `web` will remain in
105+
sync with the `core` when checking out branches or running `git bisect`.
106+
1. In the event that there are non-trivial conflicts in step 2, you may wish
107+
to perform these steps on a branch, and use `git merge` to combine the
108+
updated core files with your customized files. This facilitates the use
109+
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;
110+
keeping all of your modifications at the beginning or end of the file is a
111+
good strategy to keep merges easy.
112+
113+
## Generate composer.json from existing project
114+
115+
With using [the "Composer Generate" drush extension](https://www.drupal.org/project/composer_generate)
116+
you can now generate a basic `composer.json` file from an existing project. Note
117+
that the generated `composer.json` might differ from this project's file.
118+
119+
120+
## FAQ
121+
122+
### Should I commit the contrib modules I download?
123+
124+
Composer recommends **no**. They provide [argumentation against but also
125+
workrounds if a project decides to do it anyway](https://getcomposer.org/doc/faqs/should-i-commit-the-dependencies-in-my-vendor-directory.md).
126+
127+
### Should I commit the scaffolding files?
128+
129+
The [Drupal Composer Scaffold](https://github.com/drupal/core-composer-scaffold) plugin can download the scaffold files (like
130+
index.php, update.php, …) to the web/ directory of your project. If you have not customized those files you could choose
131+
to not check them into your version control system (e.g. git). If that is the case for your project it might be
132+
convenient to automatically run the drupal-scaffold plugin after every install or update of your project. You can
133+
achieve that by registering `@composer drupal:scaffold` as post-install and post-update command in your composer.json:
134+
135+
```json
136+
"scripts": {
137+
"post-install-cmd": [
138+
"@composer drupal:scaffold",
139+
"..."
140+
],
141+
"post-update-cmd": [
142+
"@composer drupal:scaffold",
143+
"..."
144+
]
145+
},
146+
```
147+
### How can I apply patches to downloaded modules?
148+
149+
If you need to apply patches (depending on the project being modified, a pull
150+
request is often a better solution), you can do so with the
151+
[composer-patches](https://github.com/cweagans/composer-patches) plugin.
152+
153+
To add a patch to drupal module foobar insert the patches section in the extra
154+
section of composer.json:
155+
```json
156+
"extra": {
157+
"patches": {
158+
"drupal/foobar": {
159+
"Patch description": "URL or local path to patch"
160+
}
161+
}
162+
}
163+
```
164+
### How do I switch from packagist.drupal-composer.org to packages.drupal.org?
165+
166+
Follow the instructions in the [documentation on drupal.org](https://www.drupal.org/docs/develop/using-composer/using-packagesdrupalorg).
167+
168+
### How do I specify a PHP version ?
169+
170+
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+.
171+
172+
To prevent this you can add this code to specify the PHP version you want to use in the `config` section of `composer.json`:
173+
```json
174+
"config": {
175+
"sort-packages": true,
176+
"platform": {
177+
"php": "7.0.33"
178+
}
179+
},
180+
```

composer.json

+12-14
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,19 @@
1717
}
1818
],
1919
"require": {
20-
"php": ">=5.6",
20+
"php": ">=7.0.8",
2121
"composer/installers": "^1.2",
2222
"cweagans/composer-patches": "^1.6.5",
23-
"drupal-composer/drupal-scaffold": "^2.5",
2423
"drupal/console": "^1.0.2",
25-
"drupal/core": "^8.7.0",
26-
"drush/drush": "^9.0.0",
27-
"vlucas/phpdotenv": "^2.4",
24+
"drupal/core": "^8.8.1",
25+
"drupal/core-composer-scaffold": "^8.8.0",
26+
"drush/drush": "^9.7.1 | ^10.0.0",
27+
"vlucas/phpdotenv": "^4.0",
2828
"webflo/drupal-finder": "^1.0.0",
29-
"webmozart/path-util": "^2.3",
3029
"zaporylie/composer-drupal-optimizations": "^1.0"
3130
},
3231
"require-dev": {
33-
"webflo/drupal-core-require-dev": "^8.7.0"
32+
"drupal/core-dev": "^8.8.1"
3433
},
3534
"conflict": {
3635
"drupal/drupal": "*"
@@ -67,19 +66,18 @@
6766
"patchLevel": {
6867
"drupal/core": "-p2"
6968
},
69+
"drupal-scaffold": {
70+
"locations": {
71+
"web-root": "web/"
72+
}
73+
},
7074
"installer-paths": {
7175
"web/core": ["type:drupal-core"],
7276
"web/libraries/{$name}": ["type:drupal-library"],
7377
"web/modules/contrib/{$name}": ["type:drupal-module"],
7478
"web/profiles/contrib/{$name}": ["type:drupal-profile"],
7579
"web/themes/contrib/{$name}": ["type:drupal-theme"],
76-
"drush/Commands/{$name}": ["type:drupal-drush"]
77-
},
78-
"drupal-scaffold": {
79-
"initial": {
80-
".editorconfig": "../.editorconfig",
81-
".gitattributes": "../.gitattributes"
82-
}
80+
"drush/Commands/contrib/{$name}": ["type:drupal-drush"]
8381
}
8482
}
8583
}

0 commit comments

Comments
 (0)