Make sure you have Drush 9 installed. This guide helps installing the 'default' site on the developer computer.
- Create a database liiweb in MySQL
- Clone this repository this project in
/home/user/work/liiweb/website
folder - Create a virtual host in Apache which should look like this. For consistency please use the same domain.
<VirtualHost *:80>
ServerName liiweb.test
DocumentRoot /home/user/work/liiweb/website/web/
<Directory /home/user/work/liiweb/website/web/>
AllowOverride All
Require all granted
</Directory>
<FilesMatch ".+\.php$">
SetHandler "proxy:unix:/run/php/php7.3-fpm.sock|fcgi://localhost"
</FilesMatch>
</VirtualHost>
- Create Drupal settings file
cp web/sites/example.settings.local.php web/sites/default/settings.local.php
Then open the configuration file and set the missing variables: $settings['hash_salt']
, $databases['default']['default'
at minimum. If available, configure additional settings: Solr integration etc.
At this stage if you visit http://liiweb.test it should open the Drupal installation procedure. Proceed further.
- Install the instance using Drush
drush site:install --existing-config -y
drush cim sync -y
drush cr
- Open the local instance
When you open the instance http://liiweb.test again you should be able to log in with the username and passwords set by Drush.
If you already have a local instance installed and configured with code and database, use git
to get the latest developments from the master
branch or switch to another branch you wish to test and pull changes, then execute the following commands:
drush updatedb -y
drush cim sync -y
drush updatedb -y
drush locale:check -y
drush locale:update -y
drush cr
Which imports the new configuration, applies all the pending updates and imports new translations - if available.
Step 1. Export any configuration chances done to your Drupal instance (i.e. add new fields, change settings).
drush cex -y
Step 2. Stage for commit code and configuration changes (YML files). We recommend using git add -p
to commit only relevant changes. Sometimes a configuration export might export other changes not necessarily related to current functionality.
git add -p /path/to/modified/file
git add /path/to/new/file
git commit -m "refs #123 Added new fields"
TODO: Add multi-site configuration details here.
Follow the steps below to update your core files.
- Run
composer update drupal/core webflo/drupal-core-require-dev "symfony/*" --with-dependencies
to update Drupal Core 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
web
will remain in sync with thecore
when checking out branches or runninggit bisect
. - 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. 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.
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 or local path to patch"
}
}
}