sh

start_docker.sh
# start Docker anywhere
up:
    @if [ -n "$(docker ps -q)" ]; then \
        echo "Stopping existing containers..."; \
        docker stop $(docker ps -q); \
    fi; \
    echo "Starting project containers..."; \
    doc up
21.03.2025 | Lothar Ferreira Neumann

Start Docker anywhere via just task

lenient.sh
# Get lenient.
composer require mglaman/composer-drupal-lenient

# Add the module to the allow list. Use escapes for the quote signs. \" ... \"
composer config --merge --json extra.drupal-lenient.allowed-list '[\"drupal/module_with_incompatible_core_version\"]'

# You can check if the merge worked, either just take a look
# into the composer.json or use this command.
composer config --merge --json extra.drupal-lenient.allowed-list
lenient_allowed_list.json
"drupal-lenient": {
  "allowed-list": [
    "drupal/module_with_incompatible_core_version"
  ]
}

terminal.sh
# Syntax.
composer show vendor/package

# Example.
composer show drupal/eca

terminal_result.sh
name     : drupal/eca
descrip. : Event, Conditions, Actions - powerful, versatile, and user-friendly rules engine for Drupal
keywords : 
versions : * 2.1.0
type     : drupal-module
license  : GNU General Public License v2.0 or later (GPL-2.0-or-later) (OSI approved) https://spdx.org/licenses/GPL-2.0-or-later.html#licenseText
homepage : https://www.drupal.org/project/eca
source   : [git] https://git.drupalcode.org/project/eca.git 2.1.0
dist     : [zip] https://ftp.drupal.org/files/projects/eca-2.1.0.zip 2.1.0
path     : /var/www/html/web/modules/contrib/eca
names    : drupal/eca

support
source : https://drupal.org/project/eca
issues : https://drupal.org/project/issues/eca

requires
dragonmantank/cron-expression ^3.1
drupal/core ^10.3||^11
ext-dom *
ext-json *
mtownsend/xml-to-array ^2.0
php >=8.1

requires (dev)
drupal/eca_ui *
drupal/entity_reference_revisions ^1.12
drupal/inline_entity_form ^3.0
drupal/paragraphs ^1.18
drupal/token ^1.15
drupal/webform dev-3465838-drupal-11-compatibility

Internal Snippet.

import_pg_db.sh
mc cat s3/customer/backups/prod/customer-20250131011503.sql.gz | gunzip -c | psql postgres://$POSTGRESQL_U
SER:$POSTGRESQL_PASSWORD@$POSTGRESQL_HOST:$POSTGRESQL_PORT/$POSTGRESQL_DATABASE

14.02.2025 | Nikolas Kopp

Postgres DB Import

media-install.sh
drush php-eval "\Drupal::moduleHandler()->loadInclude('media', 'install');media_install();";
13.11.2025 | Pascal Crott

Fix broken media previews

fix_php_version.sh
// Remove the vendor folder
rm -rf vendor

// Switch inside the container (if you are using Docker)
doc exec bash

// Now run Composer inside the container
/usr/local/bin/composer install
15.08.2024 | Lothar Ferreira Neumann

How to handle a wrong PHP version in the vendor folder

php.ini
// Default, only plaintext.
xdebug.cli_color=0
// Coloured if your terminal will support it.
xdebug.cli_color=1
// Forced coloured output.
xdebug.cli_color=2

06.08.2026 | Michael Ebert

Enable XDebug syntax highlighting in PHP

solveMC.sh
git fetch all
git checkout BRANCHNAME
git pull origin BRANCHNAME
git merge origin/develop
# Solve the merge conflict. 
# The commit message gets generated. 
git commit
git push origin/BRANCHNAME

Lets do a step by step view of this:

Lets say we want to take our branch with the name feature/my_branch and merge origin/develop branch into it. This is common practice to make sure to always start to work with an up to date branch. 
The first step should be to do a git fetch all. It will gather the changes for all branches that are within the repository and your local system of the current project you are in.

Then make sure you are on the branch you want with git switch feature/my_branch or if you don't have a local version yet get it from the repository with git checkout feature/my_branch.

Then get all the changes previously gathered with the git fetch all command with git pull. So now our branch that we are on should be on the most recent state for itself.

Now to get to the part where we want the recent changes of the develop branch into our branch.

git merge origin/develop will try to merge all the changes that happened on origin/develop into the branch you are currently on. Lets say you and develop both worked on the same file. Which is a common thing with the composer.lock or composer.json. You will have to solve the merge conflict by hand, step by step. Here is an example for an merge conflict:

merge_conflict_example.json
{
  "name": "example/project",
  "require": {
<<<<<<< HEAD
    "drupal/core": "^9.4",
    "drupal/devel": "^4.1"
=======
    "drupal/core": "^9.5",
    "drupal/admin_toolbar": "^3.0"
>>>>>>> feature/my_branch
  }
}

As you can see within the code, we updated Drupal core and add the new module admin_toolbar. It's important to not just use your own changes, you need to check if it is the right choice indeed. To proceed you need to delete the lines that mark the changes and keep the code you want.

solved_merge_conflict.json
{
  "name": "example/project",
  "require": {
    "drupal/core": "^9.5",
    "drupal/admin_toolbar": "^3.0"
    "drupal/devel": "^4.1"
  }
}

So if we solved the merge conflict like in the code above we want to commit the changes. In this case you don't need to create your own message for this commit, since we are in the process of a merge we can use simply git commit and a pre-generated commit message will be shown. Depending on your IDE you save the message and then can do the last step with

git push origin/feature/my_branch. 

That concludes how to commit and push a change the right way!