Skip to content
Snippets Groups Projects
Commit 5ba22706 authored by Jürgen Haas's avatar Jürgen Haas
Browse files

Describe recommended setup for developer's HOME directory

parent 89b22a50
No related branches found
No related tags found
No related merge requests found
Pipeline #417511 passed
---
title: Debugging
tags:
- documentation
- tools
---
# Debugging Drupal Code
## Add a PHP Server
First, you have to set up a Drupal environment with the tool [l3d](../docker/l3d/index.md). The tool is
based on Docker containers.
Now navigate to File->Settings in your IDE and create a server:
![Screenshot](/files/screenshots/settings_php_new_server.png)
Set the following values:
![Screenshot](/files/screenshots/settings_php_add_server.png)
**Important: Always use Docker as name of your server.**
Do not forget to add the file mapping to `/var/www/html`.
## Add a new Run/Debug Configuration
![Screenshot](/files/screenshots/configuration_add.png)
First create a new `PHP Web Page` configuration:
![Screenshot](/files/screenshots/configuration_new_webpage.png)
Set the following values:
![Screenshot](/files/screenshots/configuration_done.png)
Select the server you just have created.
**Important: Always use Docker as name of your configuration.**
## Start Debugging
First, check the debug settings in your IDE. It should look something like this:
![Screenshot](/files/screenshots/settings_php_debug.png)
Now activate the `Phone` icon in your IDE:
![Screenshot](/files/screenshots/start_debug.png)
Now you can set your breakpoints and enjoy debugging Drupal code.
---
title: Host setup
tags:
- documentation
- tools
---
# Host setup
## Recommended files in developer's HOME directory
### ~/.env
```dotenv
COMPOSER_DOWNGRADE=0
DOCKER4DRUPAL_LIVE_HOST_USERNAME=YOURNAME
DOCKER4DRUPAL_TRAEFIK_CERT=fullchain.pem
DOCKER4DRUPAL_TRAEFIK_DOMAIN=docker.localhost
DOCKER4DRUPAL_TRAEFIK_KEY=privkey.pem
DOCKER4DRUPAL_TRAEFIK_PORT=80
DOCKER4DRUPAL_TRAEFIK_PORTAINER=1
DOCKER4DRUPAL_TRAEFIK_PORTS=443
DOCKER4DRUPAL_TRAEFIK_USESSL=0
DORGFLOW=0
DRUPAL_LIVE=0
MAILHOG_HOST=smtp.freesmtpservers.com
MAILHOG_MECHANISM=NONE
MAILHOG_PASSWORD=
MAILHOG_PORT=25
MAILHOG_USERNAME=
PHP_DEBUG=0
PHP_VERSION=7.4
WEBSERVER_CONFIG_OVERWRITE=0
```
### ~/.gitconfig
```editorconfig
[user]
name = YOURNAME
email = YOUREMAIL
[core]
autocrlf = input
excludesfile = ~/.gitignore_global
[push]
default = simple
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
required = true
process = git-lfs filter-process
[credential]
helper = cache --timeout=3600
[init]
templatedir = ~/.git-templates
```
### ~/.gitignore_global
```gitignore
.idea/
*.iml
test.http
```
### ~/.composer/auth.json
```json
{
"http-basic": {
"git.drupalcode.org": {
"username": "YOURNAME",
"password": null
}
},
"github-oauth": {
"github.com": "YOURTOKEN"
},
"gitlab-oauth": {},
"gitlab-token": {
"gitlab.lakedrops.com": "YOURTOKEN",
"gitlab.com": "YOURTOKEN",
"git.drupalcode.org": "YOURTOKEN"
}
}
```
### ~/.docker/config.json
```json
{
"auths": {
"registry.gitlab.com": {
"auth": "YOURAUTH"
},
"registry.lakedrops.com": {
"auth": "YOURAUTH"
}
}
}
```
......@@ -10,54 +10,3 @@ tags:
We use the IDE's IntelliJ and PHPStorm from [Jetbrains](https://jetbrains.com), because we are convinced to use best toolset in the
market so far.
## Debugging Drupal Code
### Add a PHP Server
First, you have to set up a Drupal environment with the tool [l3d](../docker/l3d/index.md). The tool is
based on Docker containers.
Now navigate to File->Settings in your IDE and create a server:
![Screenshot](/files/screenshots/settings_php_new_server.png)
Set the following values:
![Screenshot](/files/screenshots/settings_php_add_server.png)
**Important: Always use Docker as name of your server.**
Do not forget to add the file mapping to `/var/www/html`.
### Add a new Run/Debug Configuration
![Screenshot](/files/screenshots/configuration_add.png)
First create a new `PHP Web Page` configuration:
![Screenshot](/files/screenshots/configuration_new_webpage.png)
Set the following values:
![Screenshot](/files/screenshots/configuration_done.png)
Select the server you just have created.
**Important: Always use Docker as name of your configuration.**
### Start Debugging
First, check the debug settings in your IDE. It should look something like this:
![Screenshot](/files/screenshots/settings_php_debug.png)
Now activate the `Phone` icon in your IDE:
![Screenshot](/files/screenshots/start_debug.png)
Now you can set your breakpoints and enjoy debugging Drupal code.
## Execute Drupal tests within your IDE
---
title: Testing
tags:
- documentation
- tools
---
# Testing Drupal Code
......@@ -226,3 +226,6 @@ nav:
- Tools: devops/alm/tools.md
- Developer Tools:
- Home: dev_tools/index.md
- Host Setup: dev_tools/host.md
- Debugging: dev_tools/debug.md
- Testing: dev_tools/test.md
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment