Skip to content

Commit d8967c7

Browse files
author
Norman Kämper-Leymann
authored
Merge pull request #574 from drupal-composer/init_9x_branch
Init 9.x branch.
2 parents d4c011e + 90c6cca commit d8967c7

File tree

3 files changed

+41
-48
lines changed

3 files changed

+41
-48
lines changed

.travis.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ install:
2626
- composer --verbose install
2727

2828
script:
29-
- if [[ $RELEASE = dev ]]; then composer --verbose remove --no-update drupal/console; fi;
30-
- 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;
29+
- if [[ $RELEASE = dev ]]; then composer --verbose require --no-update drupal/core-recommended:9.0.x-dev; composer --verbose require --no-update --dev drupal/core-dev:9.0.x-dev; fi;
3130
- if [[ $RELEASE = dev ]]; then composer --verbose update; fi;
3231
- ./vendor/bin/drush site-install --verbose --yes --db-url=sqlite://tmp/site.sqlite
3332
- ./vendor/bin/drush runserver $SIMPLETEST_BASE_URL &

README.md

+22-30
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,35 @@
11
# Composer template for Drupal projects
22

3-
[![Build Status](https://travis-ci.org/drupal-composer/drupal-project.svg?branch=8.x)](https://travis-ci.org/drupal-composer/drupal-project)
3+
[![Build Status](https://travis-ci.org/drupal-composer/drupal-project.svg?branch=9.x)](https://travis-ci.org/drupal-composer/drupal-project)
44

55
This project template provides a starter kit for managing your site
66
dependencies with [Composer](https://getcomposer.org/).
77

8-
If you want to know how to use it as replacement for
9-
[Drush Make](https://github.com/drush-ops/drush/blob/8.x/docs/make.md) visit
10-
the [Documentation on drupal.org](https://www.drupal.org/node/2471553).
11-
128
## Usage
139

14-
First you need to [install composer](https://getcomposer.org/doc/00-intro.md#installation-linux-unix-osx).
10+
First you need to [install Composer](https://getcomposer.org/doc/00-intro.md#installation-linux-unix-osx).
1511

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

2016
After that you can create the project:
2117

2218
```
23-
composer create-project drupal-composer/drupal-project:8.x-dev some-dir --no-interaction
19+
composer create-project drupal-composer/drupal-project:9.x-dev some-dir --no-interaction
2420
```
2521

2622
With `composer require ...` you can download new dependencies to your
2723
installation.
2824

2925
```
3026
cd some-dir
31-
composer require drupal/devel:~1.0
27+
composer require drupal/devel
3228
```
3329

3430
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
36-
all files not excluded by the .gitignore file.
31+
project that is created. You should create a new Git repository, and commit
32+
all files not excluded by the `.gitignore` file.
3733

3834
## What does the template do?
3935

@@ -56,13 +52,13 @@ When installing the given `composer.json` some tasks are taken care of:
5652
This project will attempt to keep all of your Drupal Core files up-to-date; the
5753
project [drupal/core-composer-scaffold](https://github.com/drupal/core-composer-scaffold)
5854
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),
55+
updated. If you customize any of the "scaffolding" files (commonly `.htaccess`),
6056
you may need to merge conflicts if any of your modified files are updated in a
6157
new release of Drupal core.
6258

6359
Follow the steps below to update your core files.
6460

65-
1. Run `composer update drupal/core drupal/core-dev --with-dependencies` to update Drupal Core and its dependencies.
61+
1. Run `composer update drupal/core-recommended drupal/core-dev --with-dependencies` to update Drupal Core and its dependencies.
6662
2. Run `git diff` to determine if any of the scaffolding files have changed.
6763
Review the files for any changes and restore any customizations to
6864
`.htaccess` or `robots.txt`.
@@ -75,13 +71,6 @@ Follow the steps below to update your core files.
7571
keeping all of your modifications at the beginning or end of the file is a
7672
good strategy to keep merges easy.
7773

78-
## Generate composer.json from existing project
79-
80-
With using [the "Composer Generate" drush extension](https://www.drupal.org/project/composer_generate)
81-
you can now generate a basic `composer.json` file from an existing project. Note
82-
that the generated `composer.json` might differ from this project's file.
83-
84-
8574
## FAQ
8675

8776
### Should I commit the contrib modules I download?
@@ -91,11 +80,14 @@ workrounds if a project decides to do it anyway](https://getcomposer.org/doc/faq
9180

9281
### Should I commit the scaffolding files?
9382

94-
The [Drupal Composer Scaffold](https://github.com/drupal/core-composer-scaffold) plugin can download the scaffold files (like
95-
index.php, update.php, …) to the web/ directory of your project. If you have not customized those files you could choose
96-
to not check them into your version control system (e.g. git). If that is the case for your project it might be
97-
convenient to automatically run the drupal-scaffold plugin after every install or update of your project. You can
98-
achieve that by registering `@composer drupal:scaffold` as post-install and post-update command in your composer.json:
83+
The [Drupal Composer Scaffold](https://github.com/drupal/core-composer-scaffold)
84+
plugin can download the scaffold files (like index.php, update.php, …) to the
85+
web/ directory of your project. If you have not customized those files you could
86+
choose to not check them into your version control system (e.g. git). If that is
87+
the case for your project it might be convenient to automatically run the
88+
drupal-scaffold plugin after every install or update of your project. You can
89+
achieve that by registering `@composer drupal:scaffold` as post-install and
90+
post-update command in your composer.json:
9991

10092
```json
10193
"scripts": {
@@ -109,6 +101,7 @@ achieve that by registering `@composer drupal:scaffold` as post-install and post
109101
]
110102
},
111103
```
104+
112105
### How can I apply patches to downloaded modules?
113106

114107
If you need to apply patches (depending on the project being modified, a pull
@@ -117,6 +110,7 @@ request is often a better solution), you can do so with the
117110

118111
To add a patch to drupal module foobar insert the patches section in the extra
119112
section of composer.json:
113+
120114
```json
121115
"extra": {
122116
"patches": {
@@ -126,20 +120,18 @@ section of composer.json:
126120
}
127121
}
128122
```
129-
### How do I switch from packagist.drupal-composer.org to packages.drupal.org?
130-
131-
Follow the instructions in the [documentation on drupal.org](https://www.drupal.org/docs/develop/using-composer/using-packagesdrupalorg).
132123

133124
### How do I specify a PHP version ?
134125

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+.
126+
This project supports PHP 7.3 as minimum version (see [Environment requirements of Drupal 9](https://www.drupal.org/docs/understanding-drupal/how-drupal-9-was-made-and-what-is-included/environment-requirements-of)), however it's possible that a `composer update` will upgrade some package that will then require PHP 7.3+.
136127

137128
To prevent this you can add this code to specify the PHP version you want to use in the `config` section of `composer.json`:
129+
138130
```json
139131
"config": {
140132
"sort-packages": true,
141133
"platform": {
142-
"php": "7.0.33"
134+
"php": "7.3.19"
143135
}
144136
},
145137
```

composer.json

+18-16
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "drupal-composer/drupal-project",
3-
"description": "Project template for Drupal 8 projects with composer",
3+
"description": "Project template for Drupal 9 projects with Composer",
44
"type": "project",
55
"license": "GPL-2.0-or-later",
66
"authors": [
@@ -16,26 +16,26 @@
1616
}
1717
],
1818
"require": {
19-
"php": ">=7.0.8",
20-
"composer/installers": "^1.2",
21-
"cweagans/composer-patches": "^1.6.5",
22-
"drupal/console": "^1.0.2",
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",
27-
"webflo/drupal-finder": "^1.0.0",
28-
"zaporylie/composer-drupal-optimizations": "^1.0"
19+
"php": ">=7.3",
20+
"composer/installers": "^1.9",
21+
"cweagans/composer-patches": "^1.6",
22+
"drupal/core-composer-scaffold": "^9.0",
23+
"drupal/core-recommended": "^9.0",
24+
"drush/drush": "^10.3",
25+
"vlucas/phpdotenv": "^5.1",
26+
"webflo/drupal-finder": "^1.2"
2927
},
3028
"require-dev": {
31-
"drupal/core-dev": "^8.8.0"
29+
"drupal/core-dev": "^9.0",
30+
"zaporylie/composer-drupal-optimizations": "^1.1"
3231
},
3332
"conflict": {
3433
"drupal/drupal": "*"
3534
},
3635
"minimum-stability": "dev",
3736
"prefer-stable": true,
3837
"config": {
38+
"discard-changes": true,
3939
"sort-packages": true
4040
},
4141
"autoload": {
@@ -59,10 +59,6 @@
5959
]
6060
},
6161
"extra": {
62-
"composer-exit-on-patch-failure": true,
63-
"patchLevel": {
64-
"drupal/core": "-p2"
65-
},
6662
"drupal-scaffold": {
6763
"locations": {
6864
"web-root": "web/"
@@ -75,6 +71,12 @@
7571
"web/profiles/contrib/{$name}": ["type:drupal-profile"],
7672
"web/themes/contrib/{$name}": ["type:drupal-theme"],
7773
"drush/Commands/contrib/{$name}": ["type:drupal-drush"]
74+
},
75+
"composer-exit-on-patch-failure": true,
76+
"patchLevel": {
77+
"drupal/core": "-p2"
78+
},
79+
"patches": {
7880
}
7981
}
8082
}

0 commit comments

Comments
 (0)