ohanome / project-template-drupal
Project template for Drupal 9 projects with a relocated document root
Installs: 8
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:project
pkg:composer/ohanome/project-template-drupal
Requires
- php: ^8.1
- composer/installers: ^1.9
- deployer/deployer: ^7.0
- drupal/core-composer-scaffold: ^10
- drupal/core-recommended: ^10
- drush/drush: ^11.2
- vlucas/phpdotenv: ^5.4
Conflicts
README
This project template should provide a kickstart for new Drupal projects.
Installation
Run the following command to initialize the project:
composer create-project ohanome/project-template-drupal PROJECT_NAME
Contents
Lando
A preconfigured Lando configuration is included. To start Lando, modify the name entry inside .lando.yml and run the following command:
lando start
This configuration will create a Lando environment with the following services:
- appserver, using apache2 and PHP 8.1
- database, using MariaDB
- mailhog, to catch outgoing emails
- phpmyadmin, to access the database via a web interface
- testdb, a second database for testing purposes
- testdb_phpmyadmin, a web interface for the test database
Deployer
A preconfigured Deployer configuration is included. To use the configuration, copy the file deploy.php.dist to deploy.php and modify the contents of the file.
Afterwards you can run
/vendor/bin/dep deploy <STAGE>
where <STAGE> is the selected stage specified in your deploy.php as parameter to the defined host() calls.
ENV file support
Based on the discontinued project drupal-composer/drupal-project, this project template supports the use of .env files. To use this feature, copy the file .env.example to .env and modify the values to your needs.
The file web/sites/default.settings.php for example will automatically load the values from the .env file.
Preconfigured settings.php
The following settings have been preconfigured in web/sites/default.settings.php:
- Database connection:
- The database credentials are loaded from the .envfile
 
- The database credentials are loaded from the 
- config_sync_directory: The directory for the configuration sync is set to- ../config/default(at project root)
- file_private_path: The private file path is set to- ../private(at project root)
- file_temporary_path: The temporary file path is set to- ../tmp(at project root)
- The settings.local.phpfile is loaded if it exists (by Drupals default, that part is commented out)