Skip to content

Commit

Permalink
Use scaffold plugin and composer packages from Drupal core 8.8.0 (#522)
Browse files Browse the repository at this point in the history
  • Loading branch information
greg-1-anderson authored and webflo committed Dec 5, 2019
1 parent 53f6910 commit d2e7410
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 33 deletions.
17 changes: 7 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,12 @@ install:

script:
- 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 webflo/drupal-core-require-dev:8.8.x-dev; 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 $SIMPLETEST_BASE_URL &
- ./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
# Skip core/tests/Drupal/Tests/ComposerIntegrationTest.php because web/ has no composer.json
# Ignore PageCache group temporarily, @see https://www.drupal.org/node/2770673
# Ignore Setup group temporarily, @see https://www.drupal.org/node/2962157
- ./../vendor/bin/phpunit -c core --testsuite unit --exclude-group Composer,DependencyInjection,PageCache,Setup
- ./../vendor/bin/drush
- if [[ $RELEASE = stable ]]; then ./../vendor/bin/drupal; fi;
# 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;
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,16 @@ When installing the given `composer.json` some tasks are taken care of:
## 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)
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 webflo/drupal-core-require-dev "symfony/*" --with-dependencies` to update Drupal Core and its dependencies.
1. Run `git diff` to determine if any of the scaffolding files have changed.
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
Expand Down Expand Up @@ -91,7 +91,7 @@ workrounds if a project decides to do it anyway](https://getcomposer.org/doc/faq

### Should I commit the scaffolding files?

The [drupal-scaffold](https://github.com/drupal-composer/drupal-scaffold) plugin can download the scaffold files (like
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
Expand Down
22 changes: 10 additions & 12 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,16 @@
"php": ">=7.0.8",

This comment has been minimized.

Copy link
@tormi

tormi Dec 6, 2019

@greg-1-anderson, is "php": ">=7.0.8", needed here anymore?

This comment has been minimized.

Copy link
@tormi

tormi Dec 6, 2019

Because it seems to be covered in vendor/drupal/core-composer-scaffold/composer.json.

This comment has been minimized.

Copy link
@tormi

tormi Dec 6, 2019

This comment has been minimized.

Copy link
@petk

petk Jan 9, 2020

Contributor

Worth noting that having php version requirement in the project's root composer.json makes it clear which PHP version project as a whole should use. This is mostly bumped to some alive version of PHP in most projects. In current composer.json here even this should be added because otherwise some packages might be installed/bumped differently based on the PHP version used:

"platform": {
      "php": "7.4.0"
    },
"composer/installers": "^1.2",
"cweagans/composer-patches": "^1.6.5",
"drupal-composer/drupal-scaffold": "^2.5",
"drupal/console": "^1.0.2",
"drupal/core": "^8.7.0",
"drush/drush": "^9.0.0",
"vlucas/phpdotenv": "^2.4",
"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",
"webmozart/path-util": "^2.3",
"zaporylie/composer-drupal-optimizations": "^1.0"
},
"require-dev": {
"webflo/drupal-core-require-dev": "^8.7.0"
"drupal/core-dev": "^8.8.0"
},
"conflict": {
"drupal/drupal": "*"
Expand Down Expand Up @@ -64,19 +63,18 @@
"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/Commands/contrib/{$name}": ["type:drupal-drush"]
},
"drupal-scaffold": {
"initial": {
".editorconfig": "../.editorconfig",
".gitattributes": "../.gitattributes"
}
}
}
}
9 changes: 2 additions & 7 deletions load.environment.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,5 @@
/**
* Load any .env file. See /.env.example.
*/
$dotenv = new Dotenv(__DIR__);
try {
$dotenv->load();
}
catch (InvalidPathException $e) {
// Do nothing. Production environments rarely use .env files.
}
$dotenv = Dotenv::createImmutable(__DIR__);
$dotenv->safeLoad();

0 comments on commit d2e7410

Please sign in to comment.