Because, let's face it, Drupal 8.8 core missed some key components that made drupal-composer/drupal-project
awesome.
Here, we tackle the .gitignore
file and .env
.
The Drupal 8.8+ composer-ready project templates nearly shipped with a .gitignore
that would ignore composer-managed files (e.g. vendor/
, web/modules/contrib
). Although Composer documentation recommends that vendored files should not be committed, there are opposing schools of thought about whether vendored files should be a part of one's git repository. That .gitignore
was deemed too opinionated for core. This ticket may try to address this shortcoming.
Here we provide an oppinionated .gitignore
that follows Composer recommended model of ignoring vendored files.
We also missed out on the very useful dotenv
file for environment specific variables.
- Copy the
autoload
property tocomposer.json
. - Uncomment the
/web/sites/defatul/settings.php
in.gitignore
- Follow the directions noted in
.env.example
- Place
load.environment.php
in your project root - Run the following:
composer require vlucas/phpdotenv
Drush is great. Let's grab it, and add policies which protect production from any unwanted drush site-alias database or file overwrites.
- Copy
PolicyCommands.php
todrush/Commands/
- Run the following:
composer require drush/drush