Skip to content

Travis builds are failing due to composer-plugin-api version mismatch fix #559

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 96 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
96 commits
Select commit Hold shift + click to select a range
88597c8
#192: Update README with a new link (#195)
zaporylie Sep 24, 2016
56acbbe
Disable DI unit test
webflo Oct 1, 2016
448d297
Use packages.drupal.org repository (#159)
webflo Oct 4, 2016
bb8b534
Update README.md composer require command (#206)
keopx Oct 12, 2016
568d804
Ignore SimpleTest multi-site environment (#208)
webflo Nov 5, 2016
3204837
Update composer/installers and drupal-composer/drupal-scaffold
webflo Nov 5, 2016
cc2b57d
Add FAQ section about scaffolding files to README.md (#216)
jorissteyn Nov 5, 2016
b900940
Minor README improvement: embed only valid json (#217)
jorissteyn Nov 18, 2016
4661c97
Update paths in .gitignore (#210)
Saphyel Dec 3, 2016
3faf65b
Add FAQ regarding switch to packages.drupal.org (#231)
Jan 9, 2017
fbccecf
Ignore libraries directory
rwanyoike Jan 12, 2017
d892c44
Ignore web/sites/*/settings.php and web/sites/*/settings.local.php by…
ceefour Feb 14, 2017
42599a1
Prefix paths with a slash (#245)
pfrenssen Mar 6, 2017
52feb35
Update dev dependencies (SA-CORE-2017-001)
webflo Mar 17, 2017
947dfef
Fix typo in README.md
webflo Mar 22, 2017
2285c9f
Add PHP 7.1
webflo Mar 22, 2017
2a00504
Run tests with 8.3.x (#256)
webflo Mar 22, 2017
af67f7a
Sort packages by name in composer.json
webflo Mar 23, 2017
8268a5e
Store site configuration outside of the docroot
webflo Mar 22, 2017
6cf92ff
Remove ScriptHandler::getDrupalRoot retrieve the data from composer m…
webflo Mar 22, 2017
94906ff
Run tests with 8.4.x-dev
webflo Apr 6, 2017
febdc86
Do not copy default.services.yml to services.yml by default. (#265)
mikran Apr 19, 2017
a49d5a9
Fix typo in README.md (#267)
clouseau May 1, 2017
c3da0a1
Update to drush 9 for 8.4.x
webflo May 3, 2017
431ac56
Update .travis.yml
webflo May 3, 2017
f8f2d6d
Update .travis.yml
webflo May 3, 2017
4285401
Update .travis.yml
webflo May 3, 2017
d08cee3
Remove 5.5
webflo May 4, 2017
c7e1ac4
Add remove --no-update
webflo May 5, 2017
9b3f88b
Fix
webflo May 5, 2017
a61b059
Use trusty as build env
webflo May 5, 2017
e6cdc67
Replace sleep with until
webflo May 5, 2017
7017531
Update composer.json
webflo May 9, 2017
1bb12d3
Fix 8.4.x
webflo Jun 22, 2017
394415e
Update .travis.yml
webflo Jun 22, 2017
309df54
Update .travis.yml
webflo Jun 22, 2017
a82bc15
Update .travis.yml
webflo Jun 22, 2017
852fbff
Issue #287: Fix dead link to Drush make
webflo Jul 2, 2017
09fcf3f
Update composer.json (#293)
webflo Aug 8, 2017
e262db4
Update .travis.yml (#296)
webflo Aug 12, 2017
dd317ff
Update drupal/console (#301)
webflo Aug 22, 2017
dec59de
Fix whitespace
webflo Aug 28, 2017
8934061
Added composer validate to CI.
thom8 Sep 25, 2017
3928aec
Add support for Drush 9 and Drupal 8.4
pfrenssen Sep 4, 2017
f36093b
Update .travis.yml
webflo Sep 4, 2017
13669c8
Update .travis.yml
webflo Sep 4, 2017
af59c27
Declare compatibility with versions of Drush and CSS selector that ar…
pfrenssen Oct 11, 2017
9fe7fa7
Update composer dependencies (#325)
webflo Nov 1, 2017
7839f8a
Update README.md (#334)
Nov 13, 2017
0c76b98
Run tests with 8.5.x (#329)
webflo Dec 8, 2017
61aab1d
Replace GPL-2.0+ by GPL-2.0-or-later
webflo Jan 21, 2018
383234e
Bump drush version
webflo Jan 24, 2018
975142b
Replace require-dev with webflo/drupal-core-require-dev (#348)
webflo Jan 30, 2018
e1d5d8a
Update /drush dir for Drush9
weitzman Feb 9, 2018
3f6c79b
Revert "Update /drush dir for Drush9"
weitzman Feb 9, 2018
3f5e7f4
Update /drush dir for Drush9 (#350)
weitzman Mar 6, 2018
42a8e92
Add platform version to FAQ to help user specifying PHP version, fixe…
tostinni Mar 7, 2018
c8842bd
Update to Drupal 8.5
webflo Mar 7, 2018
4795ece
Run tests with 8.6.x
webflo Mar 8, 2018
40d2c6f
Improve update instructions (#366)
alexpott Mar 8, 2018
1c19e08
Honor .env files and suggest usage (#351)
weitzman Mar 16, 2018
5660c40
Remove extra whitespace (#371)
zaporylie Mar 27, 2018
0c34a6b
Bump minimal version
webflo Mar 28, 2018
fe09e67
Updated argument name
Mar 28, 2018
0c06224
Bump minimal version to 8.5.3
webflo Apr 26, 2018
d270fb1
Fix installer path for drush commandfiles.
weitzman May 25, 2018
79496e4
Update drupal-composer/drupal-scaffold
webflo May 29, 2018
34b1e19
Fix tests on Travis CI (#405)
webflo Jun 26, 2018
6d17109
Copy the editor config and gitattributes from drupal to the root. (#404)
rodrigoaguilera Jun 26, 2018
595f3f9
Remove "drupal-scaffold" from scripts (#275)
webflo Jun 26, 2018
2d94d7f
Fix typo in README.md
webflo Jun 26, 2018
c83e121
Remove unused use statement. (#406)
Jun 28, 2018
b30cb3f
Adjust default core patch level to -p2. (#418)
milkovsky Aug 16, 2018
5c5eb92
Bump minimum required composer-patches version to support default pat…
mxr576 Aug 16, 2018
d131ec0
Update composer.json to require latest stable version of Drupal (#424)
grasmash Sep 6, 2018
742c937
Require zaporylie/composer-drupal-optimizations (#442)
andypost Jan 26, 2019
d0d8919
Issue #408: Bump minimum PHP version to 5.6
webflo Jan 26, 2019
5a5306b
Removing redundant "--stability dev" from installation command (#450)
hansfn Jan 26, 2019
ceb9024
Added "composer-exit-on-patch-failure": true option to composer.json …
MPParsley Jan 26, 2019
d4ed9f1
Sync new lines at the end of the files (#453)
petk Jan 31, 2019
0b6d607
Quote wildcards to avoid issues in some shells (#456)
gagarine Mar 13, 2019
8b4f17f
Add PHP 7.3 to Travis CI (#476)
petk Apr 8, 2019
34c463a
Change createRequiredFiles messages to reflect what occured (#467)
foxtrotcharlie Apr 9, 2019
b8c593c
Drop PHP 5.6 testing (#489)
webflo May 2, 2019
cf0aa3f
Bump minimum version to 8.7.0 (#488)
webflo May 2, 2019
d8d44ad
Update .travis.yml
webflo May 2, 2019
dcc3651
Deprecate PHP 7.0 and 7.1 (#518)
MPParsley Sep 20, 2019
993cbec
Revert "Deprecate PHP 7.1" (#521)
webflo Sep 20, 2019
131819c
Issue #518: Bump minimum php version to 7.0.8
webflo Sep 21, 2019
108312a
Update CI to Ubuntu 18.04 (#520)
webflo Sep 21, 2019
7c18e5b
Revert "Update CI to Ubuntu 18.04" (#526)
webflo Sep 26, 2019
7b98f0e
Add 'contrib' to Drush commandfile installer path (#525)
greg-1-anderson Sep 26, 2019
964da82
Prefer usage of && operator instead of "and" (#530)
paulvandenburg Nov 8, 2019
c15de3d
Use scaffold plugin and composer packages from Drupal core 8.8.0 (#522)
greg-1-anderson Dec 5, 2019
40db001
Issue #539: Remove deprecated CONFIG_SYNC_DIRECTORY
webflo Dec 18, 2019
add6295
Issue-558: Commented out composer snapshot
shrop Apr 11, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#
# Copy and rename this file to .env at root of this project.
#

# A common use case is to supply database creds via the environment. Edit settings.php
# like so:
#
# $databases['default']['default'] = [
# 'database' => getenv('MYSQL_DATABASE'),
# 'driver' => 'mysql',
# 'host' => getenv('MYSQL_HOSTNAME'),
# 'namespace' => 'Drupal\\Core\\Database\\Driver\\mysql',
# 'password' => getenv('MYSQL_PASSWORD'),
# 'port' => getenv('MYSQL_PORT'),
# 'prefix' => '',
# 'username' => getenv('MYSQL_USER'),
# ];
#
# Uncomment and populate as needed.
# MYSQL_DATABASE=
# MYSQL_HOSTNAME=
# MYSQL_PASSWORD=
# MYSQL_PORT=
# MYSQL_USER=

# Another common use case is to set Drush's --uri via environment.
# DRUSH_OPTIONS_URI=http://example.com
27 changes: 19 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,24 @@
# Ignore directories generated by Composer
drush/contrib
vendor
web/core
web/modules/contrib
web/themes/contrib
web/profiles/contrib
/drush/contrib/
/vendor/
/web/core/
/web/modules/contrib/
/web/themes/contrib/
/web/profiles/contrib/
/web/libraries/

# Ignore sensitive information
/web/sites/*/settings.php
/web/sites/*/settings.local.php

# Ignore Drupal's file directory
web/sites/*/files
/web/sites/*/files/

# Ignore SimpleTest multi-site environment.
/web/sites/simpletest

# Ignore files generated by PhpStorm
.idea
/.idea/

# Ignore .env files as they are personal
/.env
32 changes: 17 additions & 15 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
language: php
dist: trusty
sudo: false

php:
- 5.5
- 5.6
- 7.0

sudo: false
- 7.1
- 7.2
- 7.3

env:
global:
Expand All @@ -13,7 +15,7 @@ env:
matrix:
- RELEASE=stable COMPOSER_CHANNEL=stable
- RELEASE=dev COMPOSER_CHANNEL=stable
- RELEASE=stable COMPOSER_CHANNEL=snapshot
# - RELEASE=stable COMPOSER_CHANNEL=snapshot

before_install:
- echo 'sendmail_path = /bin/true' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
Expand All @@ -22,17 +24,17 @@ before_install:
- composer --version

install:
- composer --verbose validate
- composer --verbose install

script:
- if [[ $RELEASE = dev ]]; then composer --verbose require --no-update drupal/core:8.1.x-dev; fi;
- if [[ $RELEASE = dev ]]; then composer --verbose remove --no-update drupal/console; fi;
- 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;
- if [[ $RELEASE = dev ]]; then composer --verbose update; fi;
- cd $TRAVIS_BUILD_DIR/web
- ./../vendor/bin/drush site-install --verbose --yes --db-url=sqlite://tmp/site.sqlite
- ./../vendor/bin/drush runserver http://127.0.0.1:8080 &
- sleep 3
# Skip core/tests/Drupal/Tests/ComposerIntegrationTest.php because web/ has no composer.json
# Ignore PageCache group temporarily, @see https://www.drupal.org/node/2770673
- ./../vendor/bin/phpunit -c core --testsuite unit --exclude-group Composer,PageCache
- ./../vendor/bin/drush
- ./../vendor/bin/drupal
- ./vendor/bin/drush site-install --verbose --yes --db-url=sqlite://tmp/site.sqlite
- ./vendor/bin/drush runserver $SIMPLETEST_BASE_URL &
- until curl -s $SIMPLETEST_BASE_URL; do true; done > /dev/null
# Run a single unit test to verfiy the testing setup.
- ./vendor/bin/phpunit -c ./web/core ./web/core/modules/system/tests/src/Unit/SystemRequirementsTest.php
- ./vendor/bin/drush
- if [[ $RELEASE = stable ]]; then ./vendor/bin/drupal; fi;
94 changes: 66 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,37 @@

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

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

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

## Usage

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

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

After that you can create the project:

```
composer create-project drupal-composer/drupal-project:8.x-dev some-dir --stability dev --no-interaction
composer create-project drupal-composer/drupal-project:8.x-dev some-dir --no-interaction
```

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

```
cd some-dir
composer require drupal/devel:8.*
composer require drupal/devel:~1.0
```

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

## What does the template do?
Expand All @@ -46,32 +46,33 @@ When installing the given `composer.json` some tasks are taken care of:
* Theme (packages of type `drupal-theme`) will be placed in `web/themes/contrib/`
* Profiles (packages of type `drupal-profile`) will be placed in `web/profiles/contrib/`
* Creates default writable versions of `settings.php` and `services.yml`.
* Creates `sites/default/files`-directory.
* Creates `web/sites/default/files`-directory.
* Latest version of drush is installed locally for use at `vendor/bin/drush`.
* Latest version of DrupalConsole is installed locally for use at `vendor/bin/drupal`.
* Creates environment variables based on your .env file. See [.env.example](.env.example).

## Updating Drupal Core

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

Follow the steps below to update your core files.

1. Run `composer update drupal/core --with-dependencies` to update Drupal Core and its dependencies.
1. Run `git diff` to determine if any of the scaffolding files have changed.
Review the files for any changes and restore any customizations to
1. Run `composer update drupal/core drupal/core-dev --with-dependencies` to update Drupal Core and its dependencies.
2. Run `git diff` to determine if any of the scaffolding files have changed.
Review the files for any changes and restore any customizations to
`.htaccess` or `robots.txt`.
1. Commit everything all together in a single commit, so `web` will remain in
sync with the `core` when checking out branches or running `git bisect`.
1. In the event that there are non-trivial conflicts in step 2, you may wish
to perform these steps on a branch, and use `git merge` to combine the
updated core files with your customized files. This facilitates the use
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;
keeping all of your modifications at the beginning or end of the file is a
1. In the event that there are non-trivial conflicts in step 2, you may wish
to perform these steps on a branch, and use `git merge` to combine the
updated core files with your customized files. This facilitates the use
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;
keeping all of your modifications at the beginning or end of the file is a
good strategy to keep merges easy.

## Generate composer.json from existing project
Expand All @@ -83,25 +84,62 @@ that the generated `composer.json` might differ from this project's file.

## FAQ

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

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

### Should I commit the scaffolding files?

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

```json
"scripts": {
"post-install-cmd": [
"@composer drupal:scaffold",
"..."
],
"post-update-cmd": [
"@composer drupal:scaffold",
"..."
]
},
```
### How can I apply patches to downloaded modules?

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

To add a patch to drupal module foobar insert the patches section in the extra
To add a patch to drupal module foobar insert the patches section in the extra
section of composer.json:
```json
"extra": {
"patches": {
"drupal/foobar": {
"Patch description": "URL to patch"
"Patch description": "URL or local path to patch"
}
}
}
```
### How do I switch from packagist.drupal-composer.org to packages.drupal.org?

Follow the instructions in the [documentation on drupal.org](https://www.drupal.org/docs/develop/using-composer/using-packagesdrupalorg).

### How do I specify a PHP version ?

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+.

To prevent this you can add this code to specify the PHP version you want to use in the `config` section of `composer.json`:
```json
"config": {
"sort-packages": true,
"platform": {
"php": "7.0.33"
}
},
```
46 changes: 28 additions & 18 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "drupal-composer/drupal-project",
"description": "Project template for Drupal 8 projects with composer",
"type": "project",
"license": "GPL-2.0+",
"license": "GPL-2.0-or-later",
"authors": [
{
"name": "",
Expand All @@ -12,38 +12,39 @@
"repositories": [
{
"type": "composer",
"url": "https://packagist.drupal-composer.org"
"url": "https://packages.drupal.org/8"
}
],
"require": {
"composer/installers": "^1.0.20",
"drupal-composer/drupal-scaffold": "^2.0.1",
"cweagans/composer-patches": "~1.0",
"drupal/core": "~8.0",
"drush/drush": "~8.0",
"drupal/console": "~1.0"
"php": ">=7.0.8",
"composer/installers": "^1.2",
"cweagans/composer-patches": "^1.6.5",
"drupal/console": "^1.0.2",
"drupal/core": "^8.8.0",
"drupal/core-composer-scaffold": "^8.8.0",
"drush/drush": "^9.7.1 | ^10.0.0",
"vlucas/phpdotenv": "^4.0",
"webflo/drupal-finder": "^1.0.0",
"zaporylie/composer-drupal-optimizations": "^1.0"
},
"require-dev": {
"behat/mink": "~1.7",
"behat/mink-goutte-driver": "~1.2",
"jcalderonzumba/gastonjs": "~1.0.2",
"jcalderonzumba/mink-phantomjs-driver": "~0.3.1",
"mikey179/vfsStream": "~1.2",
"phpunit/phpunit": "~4.8",
"symfony/css-selector": "~2.8"
"drupal/core-dev": "^8.8.0"
},
"conflict": {
"drupal/drupal": "*"
},
"minimum-stability": "dev",
"prefer-stable": true,
"config": {
"sort-packages": true
},
"autoload": {
"classmap": [
"scripts/composer/ScriptHandler.php"
]
],
"files": ["load.environment.php"]
},
"scripts": {
"drupal-scaffold": "DrupalComposer\\DrupalScaffold\\Plugin::scaffold",
"pre-install-cmd": [
"DrupalProject\\composer\\ScriptHandler::checkComposerVersion"
],
Expand All @@ -58,13 +59,22 @@
]
},
"extra": {
"composer-exit-on-patch-failure": true,
"patchLevel": {
"drupal/core": "-p2"
},
"drupal-scaffold": {
"locations": {
"web-root": "web/"
}
},
"installer-paths": {
"web/core": ["type:drupal-core"],
"web/libraries/{$name}": ["type:drupal-library"],
"web/modules/contrib/{$name}": ["type:drupal-module"],
"web/profiles/contrib/{$name}": ["type:drupal-profile"],
"web/themes/contrib/{$name}": ["type:drupal-theme"],
"drush/contrib/{$name}": ["type:drupal-drush"]
"drush/Commands/contrib/{$name}": ["type:drupal-drush"]
}
}
}
Loading