drupaljedi / project
Project template for Drupal 8 projects with composer
Installs: 25
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 4
Forks: 942
Open Issues: 1
Type:project
Requires
- php: >=7.1.0
- ext-mcrypt: *
- composer/installers: ^1.2
- cweagans/composer-patches: ^1.6
- drupal-composer/drupal-scaffold: ^2.2
- drupal/admin_toolbar: ^1.19
- drupal/coffee: ^1.0@beta
- drupal/core: ~8.0
- webflo/drupal-finder: ^0|^1.0.0
Requires (Dev)
- drupal/devel: ^1.0
- drush/drush: ^8.1
Conflicts
This package is auto-updated.
Last update: 2024-11-12 04:58:27 UTC
README
This project template should provide a kickstart for managing your site dependencies with Composer.
Usage
- Install composer.
- Create the project :
composer create-project drupaljedi/project project_name --stability dev --no-interaction
- Execute the
./tools/scripts/before-install.sh project_name
command to prepare project for installation. - Run docker containers:
cd provision/local && docker-compose up -d && cd -
- Install Drupal:
./tools/scripts/install.sh
With composer require ...
you can download new dependencies to your
installation.
cd project_name
composer require drupal/be_sure
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?
When installing the given composer.json
some tasks are taken care of:
- Drupal will be installed in the
docroot
-directory. - Autoloader is implemented to use the generated composer autoloader in
vendor/autoload.php
, instead of the one provided by Drupal (drupal/vendor/autoload.php
). - Modules (packages of type
drupal-module
) will be placed indocroot/modules/contrib/
- Theme (packages of type
drupal-theme
) will be placed indocroot/themes/contrib/
- Profiles (packages of type
drupal-profile
) will be placed indocroot/profiles/contrib/
Updating Drupal Core
This project will attempt to keep all of your Drupal Core files up-to-date; the project 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 modified files are updated in a new release of Drupal core.
Follow the steps below to update your core files.
- Run
composer update
to update Drupal core, contrib modules and its dependencies. - 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
orrobots.txt
. - Commit everything all together in a single commit, so
docroot
will remain in sync with thecore
when checking out branches or runninggit bisect
.
FAQ
Should I commit the contrib modules I download?
Composer recommends NO. They provide argumentation against but also workrounds if a project decides to do it anyway.
Should I commit the scaffolding files?
The drupal-scaffold plugin can download the scaffold files (like
index.php, update.php, …) to the docroot/ 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 @drupal-scaffold
as post-install and post-update command in your composer.json:
"scripts": { "drupal-scaffold": "DrupalComposer\\DrupalScaffold\\Plugin::scaffold", "post-install-cmd": [ "@drupal-scaffold", "..." ], "post-update-cmd": [ "@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 composer-patches plugin.
To add a patch to drupal module foobar insert the patches section in the extra section of composer.json:
"extra": { "patches": { "drupal/foobar": { "Patch description": "URL to patch" } } }