├── .ddev ├── .dbimageBuild │ └── Dockerfile ├── .global_commands │ ├── db │ │ ├── README.txt │ │ └── mysqldump.example │ ├── host │ │ ├── README.txt │ │ ├── heidisql │ │ ├── mysqlworkbench.example │ │ ├── phpstorm.example │ │ ├── sequelace │ │ ├── sequelpro │ │ ├── tableplus │ │ └── yarn │ └── web │ │ ├── README.txt │ │ ├── artisan │ │ ├── blackfire │ │ ├── drush │ │ ├── magento │ │ ├── typo3 │ │ ├── typo3cms │ │ ├── wp │ │ └── xhprof ├── .sshimageBuild │ └── Dockerfile ├── .webimageBuild │ └── Dockerfile ├── apache │ ├── README.apache.txt │ ├── apache-site.conf │ └── seconddocroot.conf.example ├── commands │ ├── db │ │ ├── README.txt │ │ └── mysql │ ├── host │ │ ├── README.txt │ │ ├── code.sh │ │ ├── drowl-init-dev.sh │ │ ├── drowl-init-from-existing.sh │ │ ├── drowl-init.sh │ │ ├── drowl-reset-db.sh │ │ ├── launch │ │ └── solrtail.example │ ├── solr │ │ ├── README.txt │ │ └── solrtail.example │ └── web │ │ ├── README.txt │ │ ├── db-targets │ │ └── README.txt │ │ ├── deploy-db │ │ ├── dump-db │ │ ├── eslint.sh │ │ ├── phpcbf.sh │ │ ├── phpcs.sh │ │ ├── phpstan.sh │ │ ├── phpunit-coverage.sh │ │ ├── phpunit.sh │ │ ├── stylelint.sh │ │ └── xdebug ├── config.local.yaml ├── config.yaml ├── db-build │ └── Dockerfile.example ├── homeadditions │ ├── README.txt │ └── bash_aliases.example ├── initiation-additions │ ├── .vscode │ │ ├── extensions.json │ │ ├── launch.json │ │ ├── settings.json │ │ └── tasks.json │ ├── cspell.json │ ├── jsconfig.json │ ├── phpstan.neon │ ├── phpunit.xml │ ├── services.local.yml │ ├── settings.local.php │ └── settings.php ├── mysql │ └── maxTimeOut.cnf ├── nginx_full │ ├── README.nginx_full.txt │ ├── nginx-site.conf │ └── seconddocroot.conf.example ├── php │ ├── apc_cache.ini │ ├── timeOut.ini │ └── xdebug.ini ├── providers │ ├── README.txt │ ├── acquia.yaml.example │ ├── localfile.yaml.example │ ├── pantheon.yaml.example │ ├── platform.yaml.example │ └── rsync.yaml.example ├── web-build │ └── Dockerfile.example └── xhprof │ └── xhprof_prepend.php ├── .gitignore └── README.md /.ddev/.dbimageBuild/Dockerfile: -------------------------------------------------------------------------------- 1 | 2 | ARG BASE_IMAGE 3 | FROM $BASE_IMAGE 4 | 5 | ARG username 6 | ARG uid 7 | ARG gid 8 | RUN (groupadd --gid $gid "$username" || groupadd "$username" || true) && (useradd -l -m -s "/bin/bash" --gid "$username" --comment '' --uid $uid "$username" || useradd -l -m -s "/bin/bash" --gid "$username" --comment '' "$username") 9 | -------------------------------------------------------------------------------- /.ddev/.global_commands/db/README.txt: -------------------------------------------------------------------------------- 1 | #ddev-generated 2 | Scripts in this directory will be executed inside the db 3 | container. 4 | 5 | See https://ddev.readthedocs.io/en/stable/users/extend/custom-commands/#environment-variables-provided for a list of environment variables that can be used in the scripts. 6 | -------------------------------------------------------------------------------- /.ddev/.global_commands/db/mysqldump.example: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ## #ddev-generated 4 | ## Description: run mysqldump in web container 5 | ## Usage: mysqldump [flags] [args] 6 | ## Example: "ddev mysqldump db" or "ddev mysqldump otherdb" or "ddev mysqldump db | gzip >db.sql.gz" 7 | 8 | mysqldump -uroot -proot $@ 9 | -------------------------------------------------------------------------------- /.ddev/.global_commands/host/README.txt: -------------------------------------------------------------------------------- 1 | #ddev-generated 2 | Scripts in this directory will be executed on the host 3 | but they can take easily take action on containers by using 4 | `ddev exec`. 5 | 6 | See https://ddev.readthedocs.io/en/stable/users/extend/custom-commands/#environment-variables-provided for a list of environment variables that can be used in the scripts. 7 | -------------------------------------------------------------------------------- /.ddev/.global_commands/host/heidisql: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ## #ddev-generated: If you want to edit and own this file, remove this line. 4 | ## Description: Run HeidiSQL against current db 5 | ## Usage: heidisql 6 | ## Example: "ddev heidisql" 7 | ## OSTypes: windows,wsl2 8 | ## HostBinaryExists: /mnt/c/Program Files/HeidiSQL/heidisql.exe,C:\Program Files\HeidiSQL\Heidisql.exe 9 | 10 | arguments="--host=127.0.0.1 --port=${DDEV_HOST_DB_PORT} --user=root --password=root --description=${DDEV_SITENAME}" 11 | 12 | case $OSTYPE in 13 | "win*"* | "msys"*) 14 | '/c/Program Files/HeidiSQL/heidisql.exe' "$arguments" & 15 | ;; 16 | # linux-gnu in this case is only WSL2 as selected in OSTypes above 17 | "linux-gnu") 18 | # HeidiSQL is Microsoft only, but we want to start it from WSL2 19 | "/mnt/c/Program Files/HeidiSQL/heidisql.exe" "$arguments" & 20 | ;; 21 | esac 22 | -------------------------------------------------------------------------------- /.ddev/.global_commands/host/mysqlworkbench.example: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ## #ddev-generated 4 | ## Description: Run MySQLWorkbench against current db 5 | ## Usage: mysqlworkbench 6 | ## Example: "ddev mysqlworkbench" 7 | 8 | # Note that this examle uses $DDEV_HOST_DB_PORT to get the port for the connection 9 | # Mysql Workbench can be obtained from https://dev.mysql.com/downloads/workbench/ 10 | 11 | query="root:root@127.0.0.1:${DDEV_HOST_DB_PORT}" 12 | 13 | case $OSTYPE in 14 | linux-gnu) 15 | # You may need "apt-get install libproj-dev gnome-keyring" if it complains about those 16 | mysql-workbench --query "$query" & 17 | echo "Attempted to launch mysql-workbench" 18 | ;; 19 | 20 | "darwin"*) 21 | "/Applications/MySQLWorkbench.app/Contents/MacOS/MySQLWorkbench" --query "$query" & 22 | echo "Attempted to launch MySQLWorkbench.app" 23 | ;; 24 | 25 | "win*"* | "msys"*) 26 | # 'C:\Program Files\MySQL\MySQL Workbench 8.0 CE\mysqlworkbench.exe' 27 | # You may need to add it to your system %PATH% or change the path here 28 | 'C:\Program Files\MySQL\MySQL Workbench 8.0 CE\mysqlworkbench.exe' --query "$query" 29 | #;; 30 | esac 31 | -------------------------------------------------------------------------------- /.ddev/.global_commands/host/phpstorm.example: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ## #ddev-generated 4 | ## Description: Open PHPStorm with the current project 5 | ## Usage: phpstorm 6 | ## Example: "ddev phpstorm" 7 | 8 | # Example is macOS-specific, but easy to adapt to any OS 9 | open -a PHPStorm.app ${DDEV_APPROOT} 10 | -------------------------------------------------------------------------------- /.ddev/.global_commands/host/sequelace: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | #ddev-generated 4 | ## Description: Run sequelace with current project database 5 | ## Usage: sequelace 6 | ## Example: "ddev sequelace" 7 | ## OSTypes: darwin 8 | ## HostBinaryExists: /Applications/Sequel ace.app 9 | 10 | set -x 11 | query="mysql://root:root@127.0.0.1:${DDEV_HOST_DB_PORT}/db" 12 | 13 | open "$query" -a "/Applications/Sequel Ace.app/Contents/MacOS/Sequel Ace" 14 | 15 | -------------------------------------------------------------------------------- /.ddev/.global_commands/host/sequelpro: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | #ddev-generated 4 | ## Description: Run sequelpro with current project database 5 | ## Usage: sequelpro 6 | ## Example: "ddev sequelpro" 7 | ## OSTypes: darwin 8 | ## HostBinaryExists: /Applications/Sequel Pro.app 9 | 10 | tmpdir=$(mktemp -d -t sequelpro-XXXXXXXXXX) 11 | templatepath="$tmpdir/sequelpro.spf" 12 | 13 | cat >$templatepath < 15 | 16 | 17 | 18 | ContentFilters 19 | 20 | auto_connect 21 | 22 | data 23 | 24 | connection 25 | 26 | database 27 | db 28 | host 29 | 127.0.0.1 30 | name 31 | ${DDEV_SITENAME} 32 | password 33 | root 34 | port 35 | $DDEV_HOST_DB_PORT 36 | rdbms_type 37 | mysql 38 | sslCACertFileLocation 39 | 40 | sslCACertFileLocationEnabled 41 | 0 42 | sslCertificateFileLocation 43 | 44 | sslCertificateFileLocationEnabled 45 | 0 46 | sslKeyFileLocation 47 | 48 | sslKeyFileLocationEnabled 49 | 0 50 | type 51 | SPTCPIPConnection 52 | useSSL 53 | 0 54 | user 55 | root 56 | 57 | 58 | encrypted 59 | 60 | format 61 | connection 62 | queryFavorites 63 | 64 | queryHistory 65 | 66 | rdbms_type 67 | mysql 68 | rdbms_version 69 | 5.5.44 70 | version 71 | 1 72 | 73 | 74 | END 75 | 76 | open "${templatepath}" 77 | 78 | -------------------------------------------------------------------------------- /.ddev/.global_commands/host/tableplus: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | #ddev-generated 4 | # Support for TablePlus, https://tableplus.com/ 5 | # This command is available if macOS and TablePlus is installed in the normal place 6 | ## Description: Run tableplus with current project database 7 | ## Usage: tableplus 8 | ## Example: "ddev tableplus" 9 | ## OSTypes: darwin 10 | ## HostBinaryExists: /Applications/TablePlus.app 11 | 12 | set -x 13 | query="mysql://root:root@127.0.0.1:${DDEV_HOST_DB_PORT}/db" 14 | 15 | open "$query" -a "/Applications/TablePlus.app/Contents/MacOS/TablePlus" 16 | 17 | -------------------------------------------------------------------------------- /.ddev/.global_commands/host/yarn: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #ddev-generated 3 | ## Description: Run yarn inside the web container in the root of the project (Use --cwd for another directory) 4 | ## Usage: yarn [flags] [args] 5 | ## Example: "ddev yarn install" or "ddev yarn add learna" or "ddev yarn --cwd web/core add learna" 6 | 7 | ddev exec yarn "$@" 8 | ddev mutagen sync 2>/dev/null 9 | -------------------------------------------------------------------------------- /.ddev/.global_commands/web/README.txt: -------------------------------------------------------------------------------- 1 | #ddev-generated 2 | Scripts in this directory will be executed inside the web 3 | container. You can copy the example file or just rename it: 4 | `mv reload-nginx.example reload-nginx`, for example, and "ddev reload-nginx" will become 5 | a live command. 6 | 7 | See https://ddev.readthedocs.io/en/stable/users/extend/custom-commands/#environment-variables-provided for a list of environment variables that can be used in the scripts. 8 | -------------------------------------------------------------------------------- /.ddev/.global_commands/web/artisan: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | #ddev-generated 4 | ## Description: Run artisan CLI inside the web container 5 | ## Usage: artisan [flags] [args] 6 | ## Example: "ddev artisan list" or "ddev artisan cache:clear" 7 | ## ProjectTypes: laravel 8 | 9 | ./artisan "$@" 10 | 11 | -------------------------------------------------------------------------------- /.ddev/.global_commands/web/blackfire: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | #ddev-generated: Remove this line to take over this script 4 | ## Description: Enable or disable blackfire.io profiling 5 | ## Usage: blackfire start|stop|on|off|enable|disable|true|false|status 6 | ## Example: "ddev blackfire" (default is "on"), "ddev blackfire off", "ddev blackfire on", "ddev blackfire status" 7 | 8 | function enable { 9 | if [ -z ${BLACKFIRE_SERVER_ID} ] || [ -z ${BLACKFIRE_SERVER_TOKEN} ]; then 10 | echo "BLACKFIRE_SERVER_ID and BLACKFIRE_SERVER_TOKEN environment variables must be set" >&2 11 | echo "See docs for how to set in global or project config" >&2 12 | echo "For example, ddev config global --web-environment=BLACKFIRE_SERVER_ID=,BLACKFIRE_SERVER_TOKEN=" 13 | exit 1 14 | fi 15 | phpdismod xhprof xdebug 16 | phpenmod blackfire 17 | killall -USR2 php-fpm && killall -HUP nginx 18 | # Can't use killall here because it kills this process! 19 | pid=$(ps -ef | awk '$8~/^blackfire.*/ { print $2 }' 2>/dev/null) 20 | if [ "${pid}" != "" ]; then kill $pid; fi 21 | nohup blackfire agent:start --log-level=4 >/tmp/blackfire_nohup.out 2>&1 & 22 | sleep 1 23 | echo "Enabled blackfire PHP extension and started blackfire agent" 24 | exit 25 | } 26 | function disable { 27 | phpdismod blackfire 28 | killall -USR2 php-fpm 29 | # Can't use killall here because it kills this process! 30 | pid=$(ps -ef | awk '$8~/^blackfire.*/ { print $2 }' 2>/dev/null) 31 | if [ "${pid}" != "" ]; then kill ${pid}; fi 32 | echo "Disabled blackfire PHP extension and stopped blackfire agent" 33 | exit 34 | } 35 | 36 | 37 | if [ $# -eq 0 ] ; then 38 | enable 39 | fi 40 | 41 | case $1 in 42 | on|true|enable|start) 43 | disable_xdebug 44 | enable 45 | ;; 46 | off|false|disable|stop) 47 | disable 48 | ;; 49 | status) 50 | php --version | grep "with blackfire" >/dev/null 2>&1 51 | phpstatus=$? 52 | # Can't use killall here because it kills this process! 53 | agentstatus=$(ps -ef | awk '$8~/^blackfire.*/ { print $2 }' 2>/dev/null) 54 | if [ ${phpstatus} -eq 0 ]; then echo "blackfire PHP extension enabled"; else echo "blackfire PHP extension disabled"; fi 55 | if [ "${agentstatus}" != "" ]; then echo "blackfire agent running"; else echo "blackfire agent not running"; fi 56 | if [ ${phpstatus} -eq 0 ]; then printf "probe version %s\n" "$(php -v | awk -F '[ ,\~]+' '/blackfire/{ print $4; }')"; fi 57 | printf "blackfire version %s\n" "$(blackfire version | awk '{print $3;}')" 58 | ;; 59 | 60 | *) 61 | echo "Invalid argument: $1" 62 | ;; 63 | esac 64 | -------------------------------------------------------------------------------- /.ddev/.global_commands/web/drush: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | #ddev-generated 4 | ## Description: Run drush CLI inside the web container 5 | ## Usage: drush [flags] [args] 6 | ## Example: "ddev drush uli" or "ddev drush sql-cli" or "ddev drush --version" 7 | ## ProjectTypes: drupal7,drupal8,drupal9,backdrop 8 | 9 | if ! command -v drush >/dev/null; then 10 | echo "drush is not available. You may need to 'ddev composer require drush/drush'" 11 | exit 1 12 | fi 13 | drush "$@" 14 | -------------------------------------------------------------------------------- /.ddev/.global_commands/web/magento: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | #ddev-generated 4 | ## Description: Run magento CLI inside the web container 5 | ## Usage: magento [flags] [args] 6 | ## Example: "ddev magento list" or "ddev magento maintenance:enable" or "ddev magento sampledata:reset" 7 | ## ProjectTypes: magento2 8 | 9 | bin/magento "$@" 10 | 11 | -------------------------------------------------------------------------------- /.ddev/.global_commands/web/typo3: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | #ddev-generated 4 | # This assumes that the typo3 command will be in the $PATH; if in vendor/bin/ it will be 5 | 6 | ## Description: Run TYPO3 CLI (typo3) command inside the web container 7 | ## Usage: typo3 [args] 8 | ## Example: "ddev typo3 site:list" or "ddev typo3 list" or "ddev typo3 extension:list" 9 | ## ProjectTypes: typo3 10 | 11 | typo3 "$@" 12 | -------------------------------------------------------------------------------- /.ddev/.global_commands/web/typo3cms: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | #ddev-generated 4 | # This assumes that the typo3cms command will be in the $PATH; if in vendor/bin/ it will be 5 | 6 | ## Description: Run TYPO3 Console (typo3cms) command inside the web container 7 | ## Usage: typo3cms [args] 8 | ## Example: "ddev typo3cms cache:flush" or "ddev typo3cms database:export" 9 | ## ProjectTypes: typo3 10 | 11 | typo3cms "$@" 12 | -------------------------------------------------------------------------------- /.ddev/.global_commands/web/wp: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ## Description: Run WordPress CLI inside the web container 4 | ## Usage: wp [flags] [args] 5 | ## Example: "ddev wp core version" or "ddev wp plugin install user-switching --activate" 6 | ## ProjectTypes: wordpress 7 | 8 | wp "$@" 9 | -------------------------------------------------------------------------------- /.ddev/.global_commands/web/xhprof: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ## #ddev-generated 4 | ## Description: Enable or disable xhprof 5 | ## Usage: xhprof on|off|enable|disable|true|false|status 6 | ## Example: "ddev xhprof" (default is "on"), "ddev xhprof off", "ddev xhprof on", "ddev xhprof status" 7 | 8 | if [ $# -eq 0 ]; then 9 | enable_xhprof 10 | exit 11 | fi 12 | 13 | case $1 in 14 | on | true | enable) 15 | enable_xhprof 16 | ;; 17 | off | false | disable) 18 | disable_xhprof 19 | ;; 20 | status) 21 | status=$(php -m | grep 'xhprof') 22 | if [ "${status}" = "xhprof" ]; then 23 | result="xhprof is enabled" 24 | else 25 | result="xhprof is disabled" 26 | fi 27 | echo $result 28 | ;; 29 | *) 30 | echo "Invalid argument: $1" 31 | ;; 32 | esac 33 | -------------------------------------------------------------------------------- /.ddev/.sshimageBuild/Dockerfile: -------------------------------------------------------------------------------- 1 | 2 | ARG BASE_IMAGE 3 | FROM $BASE_IMAGE 4 | 5 | ARG username 6 | ARG uid 7 | ARG gid 8 | RUN (groupadd --gid $gid "$username" || groupadd "$username" || true) && (useradd -l -m -s "/bin/bash" --gid "$username" --comment '' --uid $uid "$username" || useradd -l -m -s "/bin/bash" --gid "$username" --comment '' "$username") 9 | -------------------------------------------------------------------------------- /.ddev/.webimageBuild/Dockerfile: -------------------------------------------------------------------------------- 1 | 2 | ARG BASE_IMAGE 3 | FROM $BASE_IMAGE 4 | 5 | ARG username 6 | ARG uid 7 | ARG gid 8 | RUN (groupadd --gid $gid "$username" || groupadd "$username" || true) && (useradd -l -m -s "/bin/bash" --gid "$username" --comment '' --uid $uid "$username" || useradd -l -m -s "/bin/bash" --gid "$username" --comment '' "$username") 9 | 10 | RUN if command -v composer >/dev/null 2>&1 ; then export XDEBUG_MODE=off && (composer self-update --2 || composer self-update --2 ) && chmod 777 /usr/local/bin/composer; fi 11 | -------------------------------------------------------------------------------- /.ddev/apache/README.apache.txt: -------------------------------------------------------------------------------- 1 | #ddev-generated 2 | The .ddev/apache directory contains a generated apache-site.conf file 3 | possibly specially adapted for the specific project type chosen in .ddev/config.yaml. 4 | and it handles most projects on ddev, including those with multiple 5 | hostnames, etc. 6 | 7 | However, if you have very specific needs for configuration, you can edit 8 | the apache-site.conf file and remove the #ddev-generated line in it and change 9 | as you see fit. Use `ddev start` to restart. 10 | 11 | You can also add more configurations, for example with separate configurations 12 | for each site, as demonstrated by the second_docroot.conf.example, which shows how to have apache serve completely different configurations for a named site that is different from the default. 13 | 14 | The files will be copied into /etc/apache2/sites-enabled directory. 15 | -------------------------------------------------------------------------------- /.ddev/apache/apache-site.conf: -------------------------------------------------------------------------------- 1 | # ddev generic/default/php config for apache2 2 | 3 | # If you want to take over this file and customize it, remove the line above 4 | # and ddev will respect it and won't overwrite the file. 5 | # See https://ddev.readthedocs.io/en/stable/users/extend/customization-extendibility/#providing-custom-apache-configuration 6 | 7 | RewriteEngine On 8 | RewriteCond %{HTTP:X-Forwarded-Proto} =https 9 | RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} -d 10 | RewriteRule ^(.+[^/])$ https://%{HTTP_HOST}$1/ [redirect,last] 11 | 12 | SetEnvIf X-Forwarded-Proto "https" HTTPS=on 13 | 14 | ServerAdmin webmaster@localhost 15 | DocumentRoot /var/www/html/web 16 | 17 | AllowOverride All 18 | Allow from All 19 | 20 | # Available loglevels: trace8, ..., trace1, debug, info, notice, warn, 21 | # error, crit, alert, emerg. 22 | # It is also possible to configure the loglevel for particular 23 | # modules, e.g. 24 | #LogLevel info ssl:warn 25 | 26 | ErrorLog /dev/stdout 27 | CustomLog ${APACHE_LOG_DIR}/access.log combined 28 | 29 | # Enourmasly increase the Apache Proxy timeout for developing purposes: 30 | TimeOut 9999 31 | 32 | # For most configuration files from conf-available/, which are 33 | # enabled or disabled at a global level, it is possible to 34 | # include a line for only one particular virtual host. For example the 35 | # following line enables the CGI configuration for this host only 36 | # after it has been globally disabled with "a2disconf". 37 | #Include conf-available/serve-cgi-bin.conf 38 | 39 | # Increase allowed field size for large cookies header. 40 | LimitRequestFieldSize 16380 41 | 42 | # Simple ddev technique to get a phpstatus 43 | Alias "/phpstatus" "/var/www/phpstatus.php" 44 | Alias "/xhprof" "/var/www/xhprof/xhprof_html" 45 | 46 | 47 | 48 | 49 | SSLEngine on 50 | SSLCertificateFile /etc/ssl/certs/master.crt 51 | SSLCertificateKeyFile /etc/ssl/certs/master.key 52 | 53 | # Workaround from https://mail-archives.apache.org/mod_mbox/httpd-users/201403.mbox/%3C49404A24C7FAD94BB7B45E86A9305F6214D04652@MSGEXSV21103.ent.wfb.bank.corp%3E 54 | # See also https://gist.github.com/nurtext/b6ac07ac7d8c372bc8eb 55 | 56 | RewriteEngine On 57 | RewriteCond %{HTTP:X-Forwarded-Proto} =https 58 | RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} -d 59 | RewriteRule ^(.+[^/])$ https://%{HTTP_HOST}$1/ [redirect,last] 60 | 61 | SetEnvIf X-Forwarded-Proto "https" HTTPS=on 62 | 63 | ServerAdmin webmaster@localhost 64 | DocumentRoot /var/www/html/web 65 | 66 | AllowOverride All 67 | Allow from All 68 | 69 | # Available loglevels: trace8, ..., trace1, debug, info, notice, warn, 70 | # error, crit, alert, emerg. 71 | # It is also possible to configure the loglevel for particular 72 | # modules, e.g. 73 | #LogLevel info ssl:warn 74 | 75 | ErrorLog /dev/stdout 76 | CustomLog ${APACHE_LOG_DIR}/access.log combined 77 | 78 | # Enourmasly increase the Apache Proxy timeout for developing purposes: 79 | TimeOut 9999 80 | 81 | # Increase allowed field size for large cookies header. 82 | LimitRequestFieldSize 16380 83 | 84 | # For most configuration files from conf-available/, which are 85 | # enabled or disabled at a global level, it is possible to 86 | # include a line for only one particular virtual host. For example the 87 | # following line enables the CGI configuration for this host only 88 | # after it has been globally disabled with "a2disconf". 89 | #Include conf-available/serve-cgi-bin.conf 90 | # Simple ddev technique to get a phpstatus 91 | Alias "/phpstatus" "/var/www/phpstatus.php" 92 | Alias "/xhprof" "/var/www/xhprof/xhprof_html" 93 | 94 | 95 | # vim: syntax=apache ts=4 sw=4 sts=4 sr noet 96 | -------------------------------------------------------------------------------- /.ddev/apache/seconddocroot.conf.example: -------------------------------------------------------------------------------- 1 | # ddev generic/default/php config for apache2 2 | 3 | #ddev-generated 4 | # If you want to take over this file and customize it, remove the line above 5 | # and ddev will respect it and won't overwrite the file. 6 | # See https://ddev.readthedocs.io/en/stable/users/extend/customization-extendibility/#providing-custom-apache-configuration 7 | 8 | RewriteEngine On 9 | RewriteCond %{HTTP:X-Forwarded-Proto} =https 10 | RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} -d 11 | RewriteRule ^(.+[^/])$ https://%{HTTP_HOST}$1/ [redirect,last] 12 | 13 | SetEnvIf X-Forwarded-Proto "https" HTTPS=on 14 | 15 | ServerName seconddocroot.ddev.site 16 | DocumentRoot /var/www/html/seconddocroot 17 | 18 | AllowOverride All 19 | Allow from All 20 | 21 | # Available loglevels: trace8, ..., trace1, debug, info, notice, warn, 22 | # error, crit, alert, emerg. 23 | # It is also possible to configure the loglevel for particular 24 | # modules, e.g. 25 | #LogLevel info ssl:warn 26 | 27 | ErrorLog /dev/stdout 28 | CustomLog ${APACHE_LOG_DIR}/access.log combined 29 | 30 | # For most configuration files from conf-available/, which are 31 | # enabled or disabled at a global level, it is possible to 32 | # include a line for only one particular virtual host. For example the 33 | # following line enables the CGI configuration for this host only 34 | # after it has been globally disabled with "a2disconf". 35 | #Include conf-available/serve-cgi-bin.conf 36 | # Simple ddev technique to get a phpstatus 37 | Alias "/phpstatus" "/var/www/phpstatus.php" 38 | 39 | 40 | 41 | 42 | SSLEngine on 43 | SSLCertificateFile /etc/ssl/certs/master.crt 44 | SSLCertificateKeyFile /etc/ssl/certs/master.key 45 | 46 | # Workaround from https://mail-archives.apache.org/mod_mbox/httpd-users/201403.mbox/%3C49404A24C7FAD94BB7B45E86A9305F6214D04652@MSGEXSV21103.ent.wfb.bank.corp%3E 47 | # See also https://gist.github.com/nurtext/b6ac07ac7d8c372bc8eb 48 | 49 | RewriteEngine On 50 | RewriteCond %{HTTP:X-Forwarded-Proto} =https 51 | RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} -d 52 | RewriteRule ^(.+[^/])$ https://%{HTTP_HOST}$1/ [redirect,last] 53 | 54 | SetEnvIf X-Forwarded-Proto "https" HTTPS=on 55 | 56 | ServerName seconddocroot.ddev.site 57 | DocumentRoot /var/www/html/seconddocroot 58 | 59 | AllowOverride All 60 | Allow from All 61 | 62 | # Available loglevels: trace8, ..., trace1, debug, info, notice, warn, 63 | # error, crit, alert, emerg. 64 | # It is also possible to configure the loglevel for particular 65 | # modules, e.g. 66 | #LogLevel info ssl:warn 67 | 68 | ErrorLog /dev/stdout 69 | CustomLog ${APACHE_LOG_DIR}/access.log combined 70 | 71 | # For most configuration files from conf-available/, which are 72 | # enabled or disabled at a global level, it is possible to 73 | # include a line for only one particular virtual host. For example the 74 | # following line enables the CGI configuration for this host only 75 | # after it has been globally disabled with "a2disconf". 76 | #Include conf-available/serve-cgi-bin.conf 77 | # Simple ddev technique to get a phpstatus 78 | Alias "/phpstatus" "/var/www/phpstatus.php" 79 | 80 | 81 | # vim: syntax=apache ts=4 sw=4 sts=4 sr noet 82 | -------------------------------------------------------------------------------- /.ddev/commands/db/README.txt: -------------------------------------------------------------------------------- 1 | #ddev-generated 2 | Scripts in this directory will be executed inside the db 3 | container. A number of environment variables are supplied to the scripts. 4 | 5 | See https://ddev.readthedocs.io/en/stable/users/extend/custom-commands/#environment-variables-provided for a list of environment variables. 6 | -------------------------------------------------------------------------------- /.ddev/commands/db/mysql: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ## #ddev-generated 4 | ## Description: run mysql client in db container 5 | ## Usage: mysql [flags] [args] 6 | ## Example: "ddev mysql" or "ddev mysql -uroot -proot" or "echo 'SHOW TABLES;' | ddev mysql" 7 | ## `ddev mysql --database=mysql -uroot -proot` gets you to the 'mysql' database with root privileges 8 | 9 | mysql -udb -pdb $@ 10 | -------------------------------------------------------------------------------- /.ddev/commands/host/README.txt: -------------------------------------------------------------------------------- 1 | #ddev-generated 2 | Scripts in this directory will be executed on the host 3 | but they can take easily take action on containers by using 4 | `ddev exec`. 5 | 6 | See https://ddev.readthedocs.io/en/stable/users/extend/custom-commands/#environment-variables-provided for a list of environment variables that can be used in the scripts. 7 | -------------------------------------------------------------------------------- /.ddev/commands/host/code.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ## Description: Open VSCode attached to Web-Container of the current Project 4 | ## Usage: code 5 | ## Example: "ddev code" 6 | 7 | # Get the webserver container name: 8 | WEBSERVER_NAME=ddev-"$DDEV_SITENAME"-web 9 | # Attach vscode to the webserver using a hex representation of the webserver name: 10 | code --folder-uri=vscode-remote://attached-container+$(printf "$WEBSERVER_NAME" | od -A n -t x1 | sed 's/ *//g' | tr -d '\n')/var/www/html 11 | -------------------------------------------------------------------------------- /.ddev/commands/host/drowl-init-dev.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ## Description: Startup A Drupal DDEV Environment, using DROWL Best Practices 4 | ## Usage: drowl-init-dev 5 | ## Example: drowl-init-dev 6 | 7 | # exit when any command fails 8 | set -e 9 | # keep track of the last executed command 10 | trap 'last_command=$current_command; current_command=$BASH_COMMAND' DEBUG 11 | 12 | echo -e $"\e\n[32mInitialising a Drupal DEV environment! This will take about ~5 min...\n\e[0m" 13 | 14 | PHP_VERSION=8.3 15 | 16 | # Remove README.md: 17 | rm ./README.md 18 | 19 | # Remove git files: 20 | rm -r ./.git ./.gitignore ./.gitattributes -f 21 | 22 | # Create the config.yaml: 23 | ddev config --composer-version="stable" --php-version="${PHP_VERSION}" --docroot="web" --webserver-type="apache-fpm" --project-type="drupal" --disable-settings-management --auto 24 | 25 | # For the dev version we are requiring https://github.com/joachim-n/drupal-core-development-project: 26 | ddev composer create -y "joachim-n/drupal-core-development-project" 27 | 28 | # Update the config: 29 | ddev config --update 30 | 31 | # Require the "PHPMyAdmin" plugin: 32 | echo 'Requiring the "ddev-phpmyadmin" plugin...' 33 | ddev get ddev/ddev-phpmyadmin 34 | echo 'Requiring the "ddev-selenium-standalone-chrome" plugin...' 35 | ddev get ddev/ddev-selenium-standalone-chrome 36 | 37 | # Starting Drupal DDEV Containers 38 | ddev start 39 | 40 | # Allow specific composer packages: 41 | ddev composer config --no-plugins allow-plugins.cweagans/composer-patches true 42 | ddev composer config --no-plugins allow-plugins.oomphinc/composer-installers-extender true 43 | ddev composer config --no-plugins allow-plugins.szeidler/composer-patches-cli true 44 | ddev composer config --no-plugins allow-plugins.tbachert/spi true 45 | 46 | # Add general dependencies: 47 | ddev composer require cweagans/composer-patches szeidler/composer-patches-cli oomphinc/composer-installers-extender --no-audit 48 | 49 | # Add drupal dependencies: 50 | ddev composer require drupal/devel drupal/devel_php drupal/admin_toolbar drupal/backup_migrate drupal/stage_file_proxy drupal/config_inspector drupal/examples --no-audit 51 | 52 | # Add DEV dependencies (but no modules due to their database relationship) 53 | ddev composer require --dev drupal/coder phpstan/phpstan-deprecation-rules kint-php/kint --no-audit 54 | 55 | # PHP Codesniffer Setup: 56 | ddev composer require --dev squizlabs/php_codesniffer --no-audit 57 | # Initialize development environment tools: 58 | ddev exec chmod +x vendor/bin/phpcs 59 | ddev exec chmod +x vendor/bin/phpcbf 60 | 61 | # Drush and Site initialisation: 62 | ddev drush si --account-name 'admin' --account-pass 'admin' --account-mail 'admin@admin.de' --site-mail 'site@mail.de' --db-url 'mysql://db:db@db/db' -y 63 | 64 | # Get VSCode Settings: 65 | cp -R .ddev/initiation-additions/.vscode/ . 66 | 67 | # Get phpstan.neon: 68 | cp .ddev/initiation-additions/phpstan.neon . 69 | 70 | # Get cspell.json: 71 | cp .ddev/initiation-additions/cspell.json . 72 | 73 | # Get the .prettierrc.json from core, if it exists: 74 | test -e web/core/.prettierrc.json && cp web/core/.prettierrc.json web 75 | 76 | # Get the cspell.json from core, if it exists: 77 | test -e web/core/cspell.json && cp web/core/cspell.json . 78 | 79 | # Set the permission for the default folder: 80 | chmod 0755 ./web/sites/default 81 | chmod 0644 ./web/sites/default/settings.php 82 | 83 | # Get settings.php, settings.local.php and services.local.yml: 84 | cp .ddev/initiation-additions/settings.php web/sites/default/settings.php 85 | cp .ddev/initiation-additions/settings.local.php web/sites/default/settings.local.php 86 | cp .ddev/initiation-additions/services.local.yml web/sites/default/services.local.yml 87 | 88 | # Get packages for eslint and JS code completion: 89 | echo 'Requiring npm dev packages... (This might take a bit)' 90 | cp web/core/package.json . 91 | ddev npm install --no-audit 92 | # Get jsconfig.json from initiation additions: 93 | cp .ddev/initiation-additions/jsconfig.json . 94 | 95 | # Add "patches" and "minimum-stability" section in composer.json: 96 | ddev composer config extra.composer-exit-on-patch-failure true 97 | ddev exec --raw composer config extra.patches.package-mantainer/package --json '{"description": "path/to/patch"}' 98 | ddev composer config extra.enable-patching true 99 | ddev composer config minimum-stability dev 100 | 101 | # Add asset-packagist: 102 | ddev exec --raw composer config repositories.asset-packagist --json '{"type": "composer","url": "https://asset-packagist.org"}' 103 | ddev exec --raw composer config extra.installer-types --json '["npm-asset", "bower-asset"]' 104 | ddev exec --raw composer config extra.installer-paths.web/libraries/{\$name\} --json '["type:drupal-library", "type:npm-asset", "type:bower-asset"]' 105 | 106 | # Activate Error Logging: 107 | ddev drush config-set system.logging error_level verbose -y 108 | 109 | # Created authenticated test user: 110 | ddev drush user:create max --mail='max@example.com' --password='max' -y 111 | 112 | # Create custom module folder: 113 | mkdir -p web/modules/custom 114 | # Create temp folder: 115 | mkdir -p ./tmp 116 | 117 | # Create private files directory: 118 | mkdir -p ./files/private 119 | 120 | # Export a DB-Dump to "data/sql", BEFORE enabling contrib modules, in cases, 121 | # where they break: 122 | mkdir -p ./data/sql 123 | ddev export-db "$DDEV_PROJECT" > ./data/sql/db-dump-before-contrib.sql.gz 124 | echo "Created full database dump under data/sql/db-dump-before-contrib.sql.gz" 125 | 126 | # Acitvate drupal development modules: 127 | ddev drush en admin_toolbar admin_toolbar_tools admin_toolbar_search stage_file_proxy devel devel_generate devel_php config_inspector -y 128 | 129 | # Activate kint as default devel variables dumper 130 | ddev drush config-set devel.settings devel_dumper kint -y 131 | 132 | # Disable css and js aggregation: 133 | ddev drush config-set system.performance css.preprocess 0 -y 134 | ddev drush config-set system.performance js.preprocess 0 -y 135 | 136 | # Give authenticated and anonymous users "access devel information" (dsm / kint): 137 | ddev drush role:perm:add anonymous 'access devel information' 138 | ddev drush role:perm:add authenticated 'access devel information' 139 | 140 | # Create the "normal" db dump: 141 | ddev export-db "$DDEV_PROJECT" > ./data/sql/db-complete-dump.sql.gz 142 | echo "Created full database dump under data/sql/db-complete-dump.sql.gz" 143 | 144 | # Clean the drupal core git repository: 145 | 146 | echo "Cleaning the Drupal Core Repository..." 147 | cd web/core 148 | git add --all 149 | git reset --hard 150 | git pull 151 | cd ../../ 152 | 153 | # Get PHPUnit.xml: 154 | cp phpunit-ddev.xml phpunit.xml 155 | # Delete old phpunit.xml: 156 | rm -f phpunit-ddev.xml 157 | 158 | # Give all Project informations: 159 | ddev describe 160 | 161 | # Notice about debugging inside attached VS-Code: 162 | echo -e $'\e\n[33mNOTE: To debug inside the attached VS-Code instance, run `ddev config global --xdebug-ide-location=container`\n\e[0m' 163 | 164 | echo -e $'\e\n[33mSome dev modules like examples, admin_toolbar or backup_migrate are not installed, as they have no official Drupal 11 support. But you can try tinkering with their respective `core_version_requirement` entry to make them work for Drupal 11.\n\e[0m' 165 | 166 | # Helper Messages 167 | echo "Use 'ddev code' to attach VSCode to your running Container." 168 | echo "Use 'ddev phpunit path/to/tests' to Test Classes using PHPUnit." 169 | echo "Use 'ddev phpunit-coverage path/to/cover' to create a test coverage of the given file-directory." 170 | echo "Use 'ddev phpcs path/to/sniff' to check your Code using Drupal Coding Standards." 171 | echo "Use 'ddev phpstan path/to/execute' to look for deprecated and 'dirty' code." 172 | echo "Use 'ddev eslint path/to/sniff (--fix)' for linting / auto-fixing javascript code based on Drupal Coding Standards." 173 | echo "Use 'ddev stylelint web/modules/custom/my_module' for linting css files based on Drupal Coding Standards." 174 | echo "Use 'ddev xdebug on' to turn on xdebug, then in VSCode go to 'Run and Debug', 'Listen for XDebug' and open your Project in the Browser." 175 | echo "Use 'ddev drowl-reset-db' to reset the database to its state after initial startup." 176 | echo "Use 'ddev import-db --target-db=db --src=db.sql.gz' to import a database file." 177 | 178 | printf "\nNote, that most of the linting services are also available in the attached VSCode Container as Extensions" 179 | printf "\nFor more informations on the cli tools, visit https://github.com/webksde/ddev-vscode-devcontainer-drupal-template\n" 180 | -------------------------------------------------------------------------------- /.ddev/commands/host/drowl-init-from-existing.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ## Description: Startup A Drupal DDEV Environment, using a custom composer file and db dump. 4 | ## Usage: drowl-init-from-existing 5 | ## Example: "drowl-init-from-existing" 6 | ## TODO: Create a --remote tag to initiate a project via remote ssh. 7 | 8 | echo -e $'\e\n[31mTHIS COMMAND IS CURRENTLY NOT WORKING PROPERLY, see https://github.com/webksde/ddev-vscode-devcontainer-drupal-template/issues/129 for more information.\n\e[0m' 9 | exit 10 | 11 | # exit when any command fails 12 | set -e 13 | # keep track of the last executed command 14 | trap 'last_command=$current_command; current_command=$BASH_COMMAND' DEBUG 15 | 16 | # Remove README.md: 17 | rm ./README.md 18 | 19 | # Remove all git files, to ensure nothing gets pushed: 20 | rm -r ./.git ./.gitignore ./.gitattributes -f 21 | 22 | # Create the config.yaml: 23 | ddev config --composer-version="stable" --php-version="8.2" --docroot="web" --create-docroot --webserver-type="apache-fpm" --project-type="drupal10" --disable-settings-management --auto 24 | 25 | bool=1 26 | while [ $bool -eq 1 ]; do 27 | read -p $'\n\e[33mThis command will NOT initialize a production ready copy of your Website! It will create a modified environment, focused on development and debugging.\n\nDO NOT PUSH TO PRODUCTION!\n\nContinue anyway (y/n)?\e[0m'$'\n' answer 28 | case ${answer:0:1} in 29 | y | Y | yes | Yes | YES) 30 | echo -e $'\e\n[32mInitiating...\n\e[0m' 31 | bool=0 32 | ;; 33 | n | N | no | No | NO) 34 | echo -e $'\e\n[31mAborting...\n\e[0m' 35 | exit 36 | ;; 37 | *) 38 | echo -e $'\e\n[33mI do not understand. Please repeat that.\n\e[0m' 39 | ;; 40 | esac 41 | done 42 | 43 | # If there are no flags do this: 44 | if [ $# -eq 0 ]; then 45 | define_stage_file_proxy=0 46 | read -p $'\e[36mPlease put your composer.json in the root directory of the project. Make sure any custom composer "scripts" and "scaffold" entries are removed beforehand (Enter to continue)!\e[0m' 47 | echo -e $'\e\n[32mGreat! Initialising your project with your composer file...\n\e[0m' 48 | # Use composer update -W instead of install here for existing projects to run the expected hooks: 49 | ddev composer update -W 50 | # Starting ddev: 51 | ddev start 52 | bool=1 53 | while [ $bool -eq 1 ]; do 54 | read -p $'\e\n[33mWould you like to have development tools enabled (y/n)?\e[0m'$'\n' answer 55 | case ${answer:0:1} in 56 | y | Y | yes | Yes | YES) 57 | echo -e $'\e\n[32mOk! requiring development tools...\n\e[0m' 58 | ddev composer require --dev cweagans/composer-patches szeidler/composer-patches-cli drupal/admin_toolbar drupal/backup_migrate drupal/examples drupal/stage_file_proxy drupal/devel drupal/devel_debug_log drupal/devel_php drupal/coder drupal/examples 59 | ddev composer require --dev drupal/core-dev:^10 --update-with-all-dependencies 60 | ddev composer require --dev drush/drush drupal/coder phpstan/phpstan-deprecation-rules kint-php/kint 61 | # PHP Codesniffer Setup: 62 | ddev composer require squizlabs/php_codesniffer 63 | # Initialize development environment tools: 64 | ddev exec chmod +x vendor/bin/phpcs 65 | ddev exec chmod +x vendor/bin/phpcbf 66 | # Get VSCode Settings: 67 | cp -R .ddev/initiation-additions/.vscode/ . 68 | # Get phpstan.neon: 69 | cp .ddev/initiation-additions/phpstan.neon . 70 | # Get cspell.json: 71 | cp .ddev/initiation-additions/cspell.json . 72 | # get PHPUnit.xml: 73 | cp .ddev/initiation-additions/phpunit.xml . 74 | # Set the permission for the default folder: 75 | if [ -d "./web/sites/default" ] && [ -f "./web/sites/default/settings.php" ]; then 76 | chmod 0755 ./web/sites/default 77 | chmod 0644 ./web/sites/default/settings.php 78 | fi 79 | # Get settings.php, settings.local.php and services.local.yml: 80 | mkdir -p ./web/sites/default 81 | cp .ddev/initiation-additions/settings.php web/sites/default/settings.php 82 | cp .ddev/initiation-additions/settings.local.php web/sites/default/settings.local.php 83 | cp .ddev/initiation-additions/services.local.yml web/sites/default/services.local.yml 84 | # Get the phpstan.neon: 85 | cp .ddev/initiation-additions/phpstan.neon . 86 | # Get packages for eslint and JS code completion: 87 | echo 'Requiring npm dev packages... (This might take a bit)' 88 | cp web/core/package.json . 89 | ddev npm install 90 | # Get jsconfig.json from initiation additions: 91 | cp .ddev/initiation-additions/jsconfig.json . 92 | # Create temp folder and custom module folder and private folder: 93 | mkdir -p ./files/private 94 | mkdir -p web/modules/custom 95 | mkdir -p ./tmp 96 | define_stage_file_proxy=1 97 | bool=0 98 | ;; 99 | n | N | no | No | NO) 100 | echo -e $'\e\n[32mAlright! Setting up a clean copy of your project!\n\e[0m' 101 | bool=0 102 | ;; 103 | *) 104 | echo -e $'\e\n[33mI do not understand. Please repeat that.\n\e[0m' 105 | ;; 106 | esac 107 | done 108 | 109 | #Import database: 110 | read -p $'\e\n[33mPlease type in the project root relative path to your Database dump (e.g. "./dump.mysql.gz", quotes are NOT required, even if the file name contains spaces). Supports several file formats, including: .sql, .sql.gz, .mysql, .mysql.gz, .tar, .tar.gz, and .zip:\e[0m '$'\n' -r src 111 | echo -e $'\e\n[32mAlright! Importing your database...\n\e[0m' 112 | ddev import-db --target-db=db --src="$src" 113 | # Drush and Site initialisation: 114 | ddev drush si --account-name 'admin' --account-pass 'admin' --account-mail 'admin@admin.de' --site-mail 'site@mail.de' --db-url 'mysql://db:db@db/db' -y 115 | # Require the "PHPMyAdmin" plugin: 116 | echo 'Requiring the "ddev-phpmyadmin" plugin...' 117 | ddev get ddev/ddev-phpmyadmin 118 | if [ $define_stage_file_proxy -eq 1 ]; then 119 | # Acitvate required dev-modules: 120 | ddev drush en admin_toolbar admin_toolbar_tools admin_toolbar_search examples stage_file_proxy devel devel_generate devel_debug_log devel_php backup_migrate examples -y 121 | # Give authenticated and anonymous users "access devel information" (dsm / kint): 122 | ddev drush role:perm:add anonymous 'access devel information' 123 | ddev drush role:perm:add authenticated 'access devel information' 124 | # Created authenticated test user: 125 | ddev drush user:create max --mail='max@example.com' --password='max' -y 126 | # Get stage file proxy website: 127 | read -p $'\e\n[36mPlease provide the origin website for the stage_file_proxy module (e.g. "https://www.example.com")\e[0m'$'\n' -r site 128 | echo -e $'\e\n[32mAlright! setting stage file proxy origin...\n\e[0m' 129 | # Set stage_file_proxy origin: 130 | ddev drush config-set stage_file_proxy.settings origin "$site" 131 | fi 132 | bool=1 133 | while [ $bool -eq 1 ]; do 134 | read -p $'\e[33mWould you like to create assets, files, log and scipts folders (y/n)?\e[0m '$'\n' answer 135 | case ${answer:0:1} in 136 | y | Y | yes | Yes | YES) 137 | echo -e $'\e\n[32mCreating the folders...\n\e[0m' 138 | mkdir -p ./assets ./files ./log ./scipts 139 | bool=0 140 | ;; 141 | n | N | no | No | NO) 142 | echo -e $'\e\n[32mAlright! Setting up a clean copy of your project!\n\e[0m' 143 | bool=0 144 | ;; 145 | *) 146 | echo -e $'\e\n[33mI do not understand. Please repeat that.\n\e[0m' 147 | ;; 148 | esac 149 | done 150 | # Acitvate required dev-modules: 151 | ddev describe 152 | fi 153 | 154 | # If there is an -r flag do this: 155 | while getopts r flag; do 156 | case "${flag}" in 157 | r) 158 | echo "TODO: This is not implemented yet!" 159 | ;; 160 | *) echo "Invalid option: -$flag" ;; 161 | esac 162 | done 163 | -------------------------------------------------------------------------------- /.ddev/commands/host/drowl-init.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ## Description: Startup A Drupal DDEV Environment, using DROWL Best Practices 4 | ## Usage: drowl-init 5 | ## Example: drowl-init, drowl-init -v 9, drowl-init -v 10 6 | ## Flags: [{"Name":"version","Shorthand":"v","Usage":"Set the Drupal Version (Drupal 9 and 10 supported)"}] 7 | 8 | # exit when any command fails 9 | set -e 10 | # keep track of the last executed command 11 | trap 'last_command=$current_command; current_command=$BASH_COMMAND' DEBUG 12 | 13 | DRUPAL_VERSION=11; 14 | PHP_VERSION=8.3 15 | 16 | if [[ $# = 1 ]]; then 17 | echo "Missing parameter given. Use 'ddev drowl-init -v 10/11' instead"; 18 | exit; 19 | fi 20 | 21 | if [[ $# = 2 && ( "$1" != "-v" && "$1" != "--version" )]]; then 22 | echo "Unkown flag '$1' given. Use 'ddev drowl-init -v 10/11' instead"; 23 | exit; 24 | fi 25 | 26 | if [[ $# = 2 && ( "$1" = "-v" || "$1" = "--version" ) && ( "$2" != "9" && "$2" != "10" && "$2" != "dev") ]]; then 27 | echo "Unkown parameter '$2' given. Use 'ddev drowl-init -v 10/11' instead"; 28 | exit; 29 | fi 30 | 31 | if [[ $# = 2 && ( "$1" = "-v" || "$1" = "--version" ) && "$2" = 9 ]]; then 32 | DRUPAL_VERSION=10; 33 | PHP_VERSION=8.3; 34 | fi 35 | 36 | echo -e $"\e\n[32mInitialising a Drupal ${DRUPAL_VERSION} environment! This will take about ~5 min...\n\e[0m" 37 | 38 | # Remove README.md: 39 | rm ./README.md 40 | 41 | # Remove git files: 42 | rm -r ./.git ./.gitignore ./.gitattributes -f 43 | 44 | # Create the config.yaml: 45 | ddev config --composer-version="stable" --php-version="${PHP_VERSION}" --docroot="web" --webserver-type="apache-fpm" --project-type="drupal" --disable-settings-management --auto 46 | 47 | # Create the composer create command: 48 | ddev composer create -y --stability RC "drupal/recommended-project:^${DRUPAL_VERSION}" 49 | 50 | # Update the config: 51 | ddev config --update 52 | 53 | # Require the "PHPMyAdmin" plugin: 54 | echo 'Requiring the "ddev-phpmyadmin" plugin...' 55 | ddev get ddev/ddev-phpmyadmin 56 | echo 'Requiring the "ddev-selenium-standalone-chrome" plugin...' 57 | ddev get ddev/ddev-selenium-standalone-chrome 58 | 59 | # Starting Drupal DDEV Containers 60 | ddev start 61 | 62 | # Allow specific composer packages: 63 | ddev composer config --no-plugins allow-plugins.cweagans/composer-patches true 64 | ddev composer config --no-plugins allow-plugins.oomphinc/composer-installers-extender true 65 | ddev composer config --no-plugins allow-plugins.szeidler/composer-patches-cli true 66 | ddev composer config --no-plugins allow-plugins.tbachert/spi true 67 | 68 | # Add general dependencies: 69 | ddev composer require cweagans/composer-patches szeidler/composer-patches-cli oomphinc/composer-installers-extender --no-audit 70 | 71 | # Add drupal dependencies: 72 | ddev composer require drupal/devel drupal/devel_php drupal/admin_toolbar drupal/backup_migrate drupal/stage_file_proxy drupal/config_inspector drupal/examples --no-audit 73 | 74 | # Add DEV dependencies (but no modules due to their database relationship) 75 | # Note, that "drupal/core-dev" contains dependencies like phpunit, phpstan, etc. 76 | ddev composer require --dev drupal/core-dev:^${DRUPAL_VERSION} --update-with-all-dependencies --no-audit 77 | ddev composer require --dev drush/drush drupal/coder phpstan/phpstan-deprecation-rules kint-php/kint --no-audit 78 | 79 | # PHP Codesniffer Setup: 80 | ddev composer require --dev squizlabs/php_codesniffer --no-audit 81 | # Initialize development environment tools: 82 | ddev exec chmod +x vendor/bin/phpcs 83 | ddev exec chmod +x vendor/bin/phpcbf 84 | 85 | # Drush and Site initialisation: 86 | ddev drush si --account-name 'admin' --account-pass 'admin' --account-mail 'admin@admin.de' --site-mail 'site@mail.de' --db-url 'mysql://db:db@db/db' -y 87 | 88 | # Get VSCode Settings: 89 | cp -R .ddev/initiation-additions/.vscode/ . 90 | 91 | # Get PHPUnit.xml: 92 | # @improve: It might make sense to get the phpunit.xml from core, if it exists: 93 | cp .ddev/initiation-additions/phpunit.xml . 94 | 95 | # Get phpstan.neon: 96 | cp .ddev/initiation-additions/phpstan.neon . 97 | 98 | # Get cspell.json: 99 | cp .ddev/initiation-additions/cspell.json . 100 | 101 | # Get the .prettierrc.json from core, if it exists: 102 | test -e web/core/.prettierrc.json && cp web/core/.prettierrc.json web 103 | 104 | # Get the cspell.json from core, if it exists: 105 | test -e web/core/cspell.json && cp web/core/cspell.json . 106 | 107 | # Set the permission for the default folder: 108 | chmod 0755 ./web/sites/default 109 | chmod 0644 ./web/sites/default/settings.php 110 | 111 | # Get settings.php, settings.local.php and services.local.yml: 112 | cp .ddev/initiation-additions/settings.php web/sites/default/settings.php 113 | cp .ddev/initiation-additions/settings.local.php web/sites/default/settings.local.php 114 | cp .ddev/initiation-additions/services.local.yml web/sites/default/services.local.yml 115 | 116 | # Get packages for eslint and JS code completion: 117 | echo 'Requiring npm dev packages... (This might take a bit)' 118 | cp web/core/package.json . 119 | ddev npm install --no-audit 120 | # Get jsconfig.json from initiation additions: 121 | cp .ddev/initiation-additions/jsconfig.json . 122 | 123 | # @todo Remove "raw" for all --json config calls (current workaround for https://github.com/ddev/ddev/issues/6628): 124 | # Add "patches" and "minimum-stability" section in composer.json: 125 | ddev composer config extra.composer-exit-on-patch-failure true 126 | ddev exec --raw composer config extra.patches.package-mantainer/package --json '{"description": "path/to/patch"}' 127 | ddev composer config extra.enable-patching true 128 | ddev composer config minimum-stability dev 129 | 130 | # Add asset-packagist: 131 | ddev exec --raw composer config repositories.asset-packagist --json '{"type": "composer","url": "https://asset-packagist.org"}' 132 | ddev exec --raw composer config extra.installer-types --json '["npm-asset", "bower-asset"]' 133 | ddev exec --raw composer config extra.installer-paths.web/libraries/{\$name\} --json '["type:drupal-library", "type:npm-asset", "type:bower-asset"]' 134 | 135 | # Activate Error Logging: 136 | ddev drush config-set system.logging error_level verbose -y 137 | 138 | # Created authenticated test user: 139 | ddev drush user:create max --mail='max@example.com' --password='max' -y 140 | 141 | # Create custom module folder: 142 | mkdir -p web/modules/custom 143 | # Create temp folder: 144 | mkdir -p ./tmp 145 | 146 | # Create private files directory: 147 | mkdir -p ./files/private 148 | 149 | # Export a DB-Dump to "data/sql", BEFORE enabling contrib modules, in cases, 150 | # where they break: 151 | mkdir -p ./data/sql 152 | ddev export-db "$DDEV_PROJECT" > ./data/sql/db-dump-before-contrib.sql.gz 153 | echo "Created full database dump under data/sql/db-dump-before-contrib.sql.gz" 154 | 155 | # Acitvate drupal development modules: 156 | ddev drush en admin_toolbar admin_toolbar_tools admin_toolbar_search stage_file_proxy devel devel_generate devel_php backup_migrate config_inspector examples -y 157 | 158 | # Activate kint as default devel variables dumper 159 | ddev drush config-set devel.settings devel_dumper kint -y 160 | 161 | # Disable css and js aggregation: 162 | ddev drush config-set system.performance css.preprocess 0 -y 163 | ddev drush config-set system.performance js.preprocess 0 -y 164 | 165 | # Give authenticated and anonymous users "access devel information" (dsm / kint): 166 | ddev drush role:perm:add anonymous 'access devel information' 167 | ddev drush role:perm:add authenticated 'access devel information' 168 | 169 | # Create the "normal" db dump: 170 | ddev export-db "$DDEV_PROJECT" > ./data/sql/db-complete-dump.sql.gz 171 | echo "Created full database dump under data/sql/db-complete-dump.sql.gz" 172 | 173 | # Give all Project informations: 174 | ddev describe 175 | 176 | # Notice about debugging inside attached VS-Code: 177 | echo -e $'\e\n[33mNOTE: To debug inside the attached VS-Code instance, run `ddev config global --xdebug-ide-location=container`\n\e[0m' 178 | 179 | # Helper Messages 180 | echo "Use 'ddev code' to attach VSCode to your running Container." 181 | echo "Use 'ddev phpunit path/to/tests' to Test Classes using PHPUnit." 182 | echo "Use 'ddev phpunit-coverage path/to/cover' to create a test coverage of the given file-directory." 183 | echo "Use 'ddev phpcs path/to/sniff' to check your Code using Drupal Coding Standards." 184 | echo "Use 'ddev phpstan path/to/execute' to look for deprecated and 'dirty' code." 185 | echo "Use 'ddev eslint path/to/sniff (--fix)' for linting / auto-fixing javascript code based on Drupal Coding Standards." 186 | echo "Use 'ddev stylelint web/modules/custom/my_module' for linting css files based on Drupal Coding Standards." 187 | echo "Use 'ddev xdebug on' to turn on xdebug, then in VSCode go to 'Run and Debug', 'Listen for XDebug' and open your Project in the Browser." 188 | echo "Use 'ddev drowl-reset-db' to reset the database to its state after initial startup." 189 | echo "Use 'ddev import-db --target-db=db --src=db.sql.gz' to import a database file." 190 | 191 | printf "\nNote, that most of the linting services are also available in the attached VSCode Container as Extensions" 192 | printf "\nFor more informations on the cli tools, visit https://github.com/webksde/ddev-vscode-devcontainer-drupal-template\n" 193 | -------------------------------------------------------------------------------- /.ddev/commands/host/drowl-reset-db.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ## HostWorkingDir: true 4 | ## Description: Resets the Drupal database to its original state after project initialisation. (or before conrtib modules get installed using `--before-contrib`) 5 | ## Usage: drowl-reset-db 6 | ## Example: "ddev drowl-reset-db" 7 | 8 | # Go down directories, until the current directory is the ddev project folder 9 | # (there is no DDEV_PROJECT_HOST_ABSOLUTE_PATH variable, so we need this 10 | # workaround): 11 | while [[ $PWD != '/' && ${PWD##*/} != "$DDEV_PROJECT" ]]; do cd ..; done 12 | # If no argument given, just simply reset the database to the status after 13 | # project initialisation: 14 | if [[ $# == 0 ]]; then 15 | ddev import-db --database="db" --file="./data/sql/db-complete-dump.sql.gz"; exit 0 16 | # If given the "--before-contrib", argument reset the database to a state before 17 | # contrib modules where installed: 18 | elif [[ $# == 1 && $* == '--before-contrib' ]]; then 19 | ddev import-db --database="db" --file="./data/sql/db-dump-before-contrib.sql.gz"; exit 0 20 | fi 21 | -------------------------------------------------------------------------------- /.ddev/commands/host/launch: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ## #ddev-generated: If you want to edit and own this file, remove this line. 4 | ## Description: Launch a browser with the current site 5 | ## Usage: launch [path] [-p|--phpmyadmin] [-m|--mailhog] 6 | ## Example: "ddev launch" or "ddev launch /admin/reports/status/php" or "ddev launch phpinfo.php", for PHPMyAdmin "ddev launch -p", MailHog "ddev launch -m" 7 | 8 | FULLURL=${DDEV_PRIMARY_URL} 9 | HTTPS="" 10 | if [ ${DDEV_PRIMARY_URL%://*} = "https" ]; then HTTPS=true; fi 11 | 12 | while :; do 13 | case ${1:-} in 14 | -h|-\?|--help) 15 | show_help 16 | exit 17 | ;; 18 | -p|--phpmyadmin) 19 | if [ "${HTTPS}" = "" ]; then 20 | FULLURL="${FULLURL%:[0-9]*}:${DDEV_PHPMYADMIN_PORT}" 21 | else 22 | FULLURL="${FULLURL%:[0-9]*}:${DDEV_PHPMYADMIN_HTTPS_PORT}" 23 | fi 24 | ;; 25 | -m|--mailhog) 26 | if [ "${HTTPS}" = "" ]; then 27 | FULLURL="${FULLURL%:[0-9]*}:${DDEV_MAILHOG_PORT}" 28 | else 29 | FULLURL="${FULLURL%:[0-9]*}:${DDEV_MAILHOG_HTTPS_PORT}" 30 | fi 31 | ;; 32 | 33 | --) # End of all options. 34 | shift 35 | break 36 | ;; 37 | -?*) 38 | printf 'WARN: Unknown option (ignored): %s\n' "$1" >&2 39 | ;; 40 | *) # Default case: No more options, so break out of the loop. 41 | break 42 | esac 43 | 44 | shift 45 | done 46 | 47 | if [ -n "${1:-}" ] ; then 48 | if [[ ${1::1} != "/" ]] ; then 49 | FULLURL="${FULLURL}/"; 50 | fi 51 | 52 | FULLURL="${FULLURL}${1}"; 53 | fi 54 | 55 | if [ ! -z ${DDEV_DEBUG:-} ]; then 56 | printf "FULLURL $FULLURL\n" && exit 0 57 | fi 58 | 59 | case $OSTYPE in 60 | linux-gnu) 61 | xdg-open ${FULLURL} 62 | ;; 63 | "darwin"*) 64 | open ${FULLURL} 65 | ;; 66 | "win*"* | "msys"*) 67 | start ${FULLURL} 68 | ;; 69 | esac 70 | -------------------------------------------------------------------------------- /.ddev/commands/host/solrtail.example: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ## #ddev-generated 4 | ## Description: Tail the main solr log 5 | ## Usage: solrtail 6 | ## Example: ddev solrtail 7 | 8 | # This can't work unless you have a solr service, 9 | # See https://ddev.readthedocs.io/en/stable/users/extend/additional-services/ 10 | 11 | ddev exec -s solr tail -40lf /opt/solr/server/logs/solr.log 12 | -------------------------------------------------------------------------------- /.ddev/commands/solr/README.txt: -------------------------------------------------------------------------------- 1 | #ddev-generated 2 | Scripts in this directory will be executed inside the solr 3 | container (if it exists, of course). This is just an example, 4 | but any named service can have a directory with commands. 5 | 6 | Note that /mnt/ddev_config must be mounted into the 3rd-party service 7 | with a stanza like this in the docker-compose.solr.yaml: 8 | 9 | volumes: 10 | - type: "bind" 11 | source: "." 12 | target: "/mnt/ddev_config" 13 | 14 | 15 | See https://ddev.readthedocs.io/en/stable/users/extend/custom-commands/#environment-variables-provided for a list of environment variables that can be used in the scripts. 16 | -------------------------------------------------------------------------------- /.ddev/commands/solr/solrtail.example: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ## #ddev-generated 4 | ## Description: Tail the main solr log 5 | ## Usage: solrtail 6 | ## Example: ddev solrtail 7 | 8 | # This example runs inside the solr container. 9 | # Note that this requires that /mnt/ddev_config be mounted 10 | # into the solr container and of course that you have a container 11 | # named solr. 12 | 13 | tail -f /opt/solr/server/logs/solr.log 14 | -------------------------------------------------------------------------------- /.ddev/commands/web/README.txt: -------------------------------------------------------------------------------- 1 | #ddev-generated 2 | Scripts in this directory will be executed inside the web container. 3 | 4 | See https://ddev.readthedocs.io/en/stable/users/extend/custom-commands/#environment-variables-provided for a list of environment variables that can be used in the scripts. 5 | -------------------------------------------------------------------------------- /.ddev/commands/web/db-targets/README.txt: -------------------------------------------------------------------------------- 1 | # This directory holds "targets/sources" aka host configurations. 2 | # Create files of any names (except README.txt) in this directory to provide access to remote systems via this form configuration: 3 | 4 | target=( 5 | # The SSH user used to connect to the remote webapp server. 6 | [sshUser]= 7 | # The SSH host of the remote webapp. Enclose IPv6 addresses in []. 8 | [sshHost]= 9 | # The SSH port 10 | [sshPort]=22 11 | # You can provide a path to an SSH private key here (local path from inside the web container). 12 | # If you leave it empty, other means of authentification will be used: 13 | # * after running `ddev auth ssh`, your SSH private keys from /.ssh/* will be available 14 | # * putting the key into .ddev/homeadditions/.ssh/id_rsa will make it available 15 | # * or you will be asked for the SSH password 16 | [sshPrivKey]= 17 | # The hostname that the webapp uses to reach the MySQL/MariaDB database (the connection will be tunneled through SSH to sshUser@sshHost) 18 | [mysqlHost]=mysql.myserver.com 19 | [mysqlPort]=3306 20 | [mysqlUser]= 21 | [mysqlPass]= 22 | [mysqlDatabase]= 23 | # Provide a RegEx against which each database table is checked. If it matches, its data won't be downloaded (structure is unaffected by this). 24 | # This is an example to ignore some common TYPO3 tables with cached or easily rebuildable data. 25 | [ignoredDbTablesPattern]="^(sys_log|.*_sessions|cf_.*|.*cache.*|sys_file_processedfile|sys_refindex|sys_lockedrecords|tx_realurl_urldata|index_debug|index_fulltext|index_grlist|index_phash|index_rel|index_section|index_stat_search|index_stat_word|index_words|tx_crawler_queue|tx_extensionmanager_domain_model_extension)$" 26 | ) 27 | 28 | # PS: 29 | # The files are interpreted by Bash so you can use bash logic to fill in values 30 | -------------------------------------------------------------------------------- /.ddev/commands/web/deploy-db: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ## Description: deploy MySQL/MariaDB to remote system from ./data/sql/(records|struct)/ directories 4 | ## Usage: deploy-db [options, call without params for help] ‹target/source› 5 | 6 | endC="\033[0m" 7 | black="\033[0;30m" 8 | blackb="\033[1;30m" 9 | white="\033[0;37m" 10 | whiteb="\033[1;37m" 11 | red="\033[0;31m" 12 | redb="\033[1;31m" 13 | green="\033[0;32m" 14 | greenb="\033[1;32m" 15 | yellow="\033[0;33m" 16 | yellowb="\033[1;33m" 17 | blue="\033[0;34m" 18 | blueb="\033[1;34m" 19 | purple="\033[0;35m" 20 | purpleb="\033[1;35m" 21 | lightblue="\033[0;36m" 22 | lightblueb="\033[1;36m" 23 | 24 | targetC=$green 25 | successC=$greenb 26 | errorC=$red 27 | 28 | function usage() { 29 | printf "Usage: ddev deploy-db [options] ‹target/source›\n" 30 | printf " %s %s\n" "‹target/source›" "Available targets/sources (from ./.ddev/commands/web/targets):" 31 | printf "\t%-15s · $targetC%s$endC\n" "" "ddev (the local ddev database)" 32 | find "$targetDir" -type f -not -name README.txt -print0 | 33 | while IFS= read -r -d '' _i; do 34 | printf "\t%-15s · $targetC%s$endC\n" "" "$(basename $_i)" 35 | done 36 | printf " options:\n" 37 | printf "\t%-15s %s\n" "-f|--force" "no question before data deletion" 38 | printf "\t%-15s %s\n" "-c|--creative" "use funny progress spinners" 39 | } 40 | 41 | function cursorBack() { 42 | echo -en "\033[$1D" 43 | } 44 | 45 | # global to keep its state 46 | iSpinner=0 47 | function spinner() { 48 | # make sure we use non-unicode character type locale 49 | # (that way it works for any locale as long as the font supports the characters) 50 | local LC_CTYPE=C 51 | 52 | local pid=$1 # Process Id of the previous running command 53 | 54 | if [ $isCreative == 0 ]; then 55 | spin="-\|/" 56 | local charwidth=1 57 | else 58 | declare -a spins 59 | local charwidth=3 60 | spins+=(" ▁▂▃▄▅▆▇█▉▊▋▌▍▎▏ ▏▎▍▌▋▊▉█▇▆▅▄▃▂▁") 61 | spins+=(" ▔▔▀▀██▐▐▕▕  ▕▕▐▐██▀▀▔▔") 62 | spins+=(" ▁▂▃▄▅▆▇███▀▔") 63 | spins+=('◐◓◑◒') 64 | spins+=('⠁⠂⠄⡀⢀⠠⠐⠈') 65 | spins+=('⣾⣽⣻⢿⡿⣟⣯⣷') 66 | spins+=('┤┘┴└├┌┬┐') 67 | spins+=('▖▘▝▗') 68 | spins+=('◢◣◤◥') 69 | spins+=('←↖↑↗→↘↓↙') 70 | spins+=('◰◳◲◱') 71 | spins+=('◴◷◶◵') 72 | spins+=(" ▏▎▍▌▋▊▉█▉▊▋▌▍▎▏") 73 | spins+=(" ▁▂▃▄▅▆▇█▇▆▅▄▃▂▁") 74 | spin=${spins[$(($RANDOM % ${#spins[@]}))]} 75 | fi 76 | 77 | tput civis # cursor invisible 78 | while kill -0 $pid 2>/dev/null; do 79 | iSpinner=$(((iSpinner + $charwidth) % ${#spin})) 80 | printf "$purpleb%s$endC" "${spin:$iSpinner:$charwidth}" 81 | 82 | cursorBack 1 83 | sleep .1 84 | done 85 | tput cnorm 86 | wait $pid # capture exit code 87 | return $? 88 | } 89 | 90 | function shutdown() { 91 | if [ $isDumpDdev == 0 ]; then 92 | # this would allow short running mysqldumps to finish before we shut off the line 93 | sleep 1 94 | printf "\nClosing tunnel …" 95 | # we ignore the actual result because it might already be closed 96 | pkill -TERM -f "^ssh -f" 97 | cursorBack 1 98 | printf "${successC}✓${endC}\n" 99 | fi 100 | printf "\n" 101 | tput cnorm # reset cursor 102 | } 103 | 104 | function parseArgs() { 105 | # -allow a command to fail with !’s side effect on errexit 106 | # -use return value from ${PIPESTATUS[0]}, because ! hosed $? 107 | ! getopt --test >/dev/null 108 | if [[ ${PIPESTATUS[0]} -ne 4 ]]; then 109 | echo $errorC'`getopt --test` failed in this environment.'$endC 110 | exit 1 111 | fi 112 | 113 | OPTIONS="fc" 114 | LONGOPTS="force,creative" 115 | 116 | # -regarding ! and PIPESTATUS see above 117 | # -temporarily store output to be able to check for errors 118 | # -activate quoting/enhanced mode (e.g. by writing out “--options”) 119 | # -pass arguments only via -- "$@" to separate them correctly 120 | ! PARSED=$(getopt --options=$OPTIONS --longoptions=$LONGOPTS --name "$0" -- "$@") 121 | if [[ ${PIPESTATUS[0]} -ne 0 ]]; then 122 | # e.g. return value is 1 123 | # then getopt has complained about wrong arguments to stdout 124 | usage 125 | exit 2 126 | fi 127 | # read getopt’s output this way to handle the quoting right: 128 | eval set -- "$PARSED" 129 | 130 | while true; do 131 | case "$1" in 132 | -f | --force) 133 | isForce=1 134 | shift 135 | ;; 136 | -c | --creative) 137 | isCreative=1 138 | shift 139 | ;; 140 | --) 141 | shift 142 | break 143 | ;; 144 | *) 145 | targetName="$1" 146 | usage 147 | exit 3 148 | ;; 149 | esac 150 | done 151 | 152 | # handle non-option arguments 153 | if [[ $# -ne 1 ]]; then 154 | usage 155 | exit 4 156 | fi 157 | targetName="$1" 158 | 159 | if [ "$targetName" == "ddev" ]; then 160 | isDumpDdev=1 161 | else 162 | # read target config 163 | if ! . "$targetDir"/"$targetName" 2>/dev/null; then 164 | printf "${errorC}Target/source ‹$targetC%s$errorC› not found.$endC\n" "$targetName" 165 | usage 166 | exit 3 167 | fi 168 | fi 169 | } 170 | 171 | function openTunnel() { 172 | if [ $isDumpDdev == 1 ]; then 173 | target=( 174 | [mysqlHost]=db 175 | [mysqlPort]=3306 176 | [mysqlUser]=db 177 | [mysqlPass]=db 178 | [mysqlDatabase]=db 179 | # TODO: make configurable 180 | [ignoredDbTablesPattern]="^(sys_log|.*_sessions|cf_.*|.*cache.*|sys_file_processedfile|sys_refindex|sys_lockedrecords|tx_realurl_urldata|index_debug|index_fulltext|index_grlist|index_phash|index_rel|index_section|index_stat_search|index_stat_word|index_words|tx_crawler_queue|tx_extensionmanager_domain_model_extension)$" 181 | ) 182 | 183 | mysqlConnectString="--host=${target[mysqlHost]} --protocol=TCP --port=${target[mysqlPort]} --user=\"${target[mysqlUser]}\" --password=\"${target[mysqlPass]}\"" 184 | else 185 | printf "Opening tunnel …" 186 | 187 | if [ -z "${target[sshPrivKey]}" ]; then 188 | sshIdentitiyArg= 189 | else 190 | sshIdentitiyArg="-i \"/var/www/html/${target[sshPrivKey]}\"" 191 | fi 192 | localMysqlPort=33060 193 | sshCommand="ssh -f -N -o LogLevel=ERROR -p ${target[sshPort]} $sshIdentitiyArg ${target[sshUser]}@${target[sshHost]} -L 127.0.0.1:$localMysqlPort:${target[mysqlHost]}:${target[mysqlPort]}" 194 | if eval $sshCommand; then 195 | cursorBack 1 196 | printf "${successC}✓${endC}\n" 197 | else 198 | cursorBack 1 199 | printf "${errorC}✓${endC}\n" 200 | exit 1 201 | fi 202 | 203 | mysqlConnectString="--host=127.0.0.1 --protocol=TCP --port=$localMysqlPort --user=\"${target[mysqlUser]}\" --password=\"${target[mysqlPass]}\"" 204 | fi 205 | trap shutdown EXIT 206 | 207 | mysqlNoDbCommand="mysql $mysqlConnectString --default-character-set=utf8mb4" 208 | mysqlCommand="mysql $mysqlConnectString --default-character-set=utf8mb4 \"${target[mysqlDatabase]}\"" 209 | mysqldumpCommand="mysqldump $mysqlConnectString --default-character-set=utf8mb4 --insert-ignore --skip-comments --quote-names \"${target[mysqlDatabase]}\"" 210 | } 211 | 212 | # saner programming env: these switches turn some bugs into errors 213 | set -o errexit -o pipefail -o noclobber -o nounset 214 | 215 | # init 216 | targetDir=$(dirname "$0")/db-targets 217 | structDir="/var/www/html/data/sql/struct" 218 | dataDir="/var/www/html/data/sql/records" 219 | 220 | # arguments 221 | isForce=0 222 | isDumpDdev=0 223 | isCreative=0 224 | targetName= 225 | typeset -A target 226 | 227 | parseArgs "$@" 228 | 229 | openTunnel 230 | #mysql --host=localhost --protocol=TCP --port=33060 --user="typo3" --password="cPxcWzFbXDSSxOC8" --default-character-set=utf8mb4 ${target[mysqlDatabase]} 231 | 232 | #eval $mysqlCommand 233 | 234 | #printf "Creating database if not there yet\n" 235 | #createDbCommand="$mysqlNoDbCommand <<< 'CREATE DATABASE IF NOT EXISTS ${target[mysqlDatabase]}'" 236 | #echo $createDbCommand 237 | #eval $createDbCommand 238 | 239 | findCommand="find \"$structDir\" \"$dataDir\" -name '*.sql'" 240 | 241 | nFiles=$(eval $findCommand | wc -l) 242 | 243 | printf "${white}Deploying %d sql files …${endC}\n" "$nFiles" 244 | 245 | declare -i _i=0 246 | eval "$findCommand -print0" | 247 | while IFS= read -r -d '' _file; do 248 | _i+=1 249 | printf "$white%${#nFiles}d/%d$endC" $_i $nFiles 250 | 251 | printf " %-80s " "$(eval "sed -e 's/\/var\/www\/html\///g' <<< $_file")" 252 | eval "$mysqlCommand < \"$_file\"&" 253 | if ! spinner $!; then 254 | echo $? 255 | printf "${errorC}✓${endC}\n" 256 | printf "Error\n" 257 | exit 1 258 | fi 259 | printf "${successC}✓${endC} (%s)\n" "$(du --apparent-size --human-readable $_file | cut -f1)" 260 | 261 | done 262 | 263 | printf "\nFinished. Deployed SQL (%s)\n" "$(du --apparent-size --human-readable $dataDir | cut -f1)" 264 | -------------------------------------------------------------------------------- /.ddev/commands/web/dump-db: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ## Description: dump MySQL/MariaDB on remote system table by table into ./data/sql/(records|struct)/ directories 4 | ## Usage: dump-db [options, call without params for help] ‹target/source› 5 | 6 | endC="\033[0m" 7 | black="\033[0;30m" 8 | blackb="\033[1;30m" 9 | white="\033[0;37m" 10 | whiteb="\033[1;37m" 11 | red="\033[0;31m" 12 | redb="\033[1;31m" 13 | green="\033[0;32m" 14 | greenb="\033[1;32m" 15 | yellow="\033[0;33m" 16 | yellowb="\033[1;33m" 17 | blue="\033[0;34m" 18 | blueb="\033[1;34m" 19 | purple="\033[0;35m" 20 | purpleb="\033[1;35m" 21 | lightblue="\033[0;36m" 22 | lightblueb="\033[1;36m" 23 | 24 | targetC=$green 25 | successC=$greenb 26 | errorC=$red 27 | 28 | function usage() { 29 | printf "Usage: ddev dump-db [options] ‹target/source›\n" 30 | printf " %s %s\n" "‹target/source›" "Available targets/sources (from ./.ddev/commands/web/targets):" 31 | printf "\t%-15s · $targetC%s$endC\n" "" "ddev (the local ddev database)" 32 | find "$targetDir" -type f -not -name README.txt -print0 | 33 | while IFS= read -r -d '' _i; do 34 | printf "\t%-15s · $targetC%s$endC\n" "" "$(basename $_i)" 35 | done 36 | printf " options:\n" 37 | printf "\t%-15s %s\n" "-f|--force" "no question before data deletion" 38 | printf "\t%-15s %s\n" "-c|--creative" "use funny progress spinners" 39 | } 40 | 41 | function cursorBack() { 42 | echo -en "\033[$1D" 43 | } 44 | 45 | # global to keep its state 46 | iSpinner=0 47 | function spinner() { 48 | # make sure we use non-unicode character type locale 49 | # (that way it works for any locale as long as the font supports the characters) 50 | local LC_CTYPE=C 51 | 52 | local pid=$1 # Process Id of the previous running command 53 | 54 | if [ $isCreative == 0 ]; then 55 | spin="-\|/" 56 | local charwidth=1 57 | else 58 | declare -a spins 59 | local charwidth=3 60 | spins+=(" ▁▂▃▄▅▆▇█▉▊▋▌▍▎▏ ▏▎▍▌▋▊▉█▇▆▅▄▃▂▁") 61 | spins+=(" ▔▔▀▀██▐▐▕▕  ▕▕▐▐██▀▀▔▔") 62 | spins+=(" ▁▂▃▄▅▆▇███▀▔") 63 | spins+=('◐◓◑◒') 64 | spins+=('⠁⠂⠄⡀⢀⠠⠐⠈') 65 | spins+=('⣾⣽⣻⢿⡿⣟⣯⣷') 66 | spins+=('┤┘┴└├┌┬┐') 67 | spins+=('▖▘▝▗') 68 | spins+=('◢◣◤◥') 69 | spins+=('←↖↑↗→↘↓↙') 70 | spins+=('◰◳◲◱') 71 | spins+=('◴◷◶◵') 72 | spins+=(" ▏▎▍▌▋▊▉█▉▊▋▌▍▎▏") 73 | spins+=(" ▁▂▃▄▅▆▇█▇▆▅▄▃▂▁") 74 | spin=${spins[$(($RANDOM % ${#spins[@]}))]} 75 | fi 76 | 77 | tput civis # cursor invisible 78 | while kill -0 $pid 2>/dev/null; do 79 | iSpinner=$(((iSpinner + $charwidth) % ${#spin})) 80 | printf "$purpleb%s$endC" "${spin:$iSpinner:$charwidth}" 81 | 82 | cursorBack 1 83 | sleep .1 84 | done 85 | tput cnorm 86 | wait $pid # capture exit code 87 | return $? 88 | } 89 | 90 | function shutdown() { 91 | if [ $isDumpDdev == 0 ]; then 92 | # this would allow short running mysqldumps to finish before we shut off the line 93 | sleep 1 94 | printf "\nClosing tunnel …" 95 | # we ignore the actual result because it might already be closed 96 | pkill -TERM -f "^ssh -f" 97 | cursorBack 1 98 | printf "${successC}✓${endC}\n" 99 | fi 100 | printf "\n" 101 | tput cnorm # reset cursor 102 | } 103 | 104 | function parseArgs() { 105 | # -allow a command to fail with !’s side effect on errexit 106 | # -use return value from ${PIPESTATUS[0]}, because ! hosed $? 107 | ! getopt --test >/dev/null 108 | if [[ ${PIPESTATUS[0]} -ne 4 ]]; then 109 | echo $errorC'`getopt --test` failed in this environment.'$endC 110 | exit 1 111 | fi 112 | 113 | OPTIONS="fc" 114 | LONGOPTS="force,creative" 115 | 116 | # -regarding ! and PIPESTATUS see above 117 | # -temporarily store output to be able to check for errors 118 | # -activate quoting/enhanced mode (e.g. by writing out “--options”) 119 | # -pass arguments only via -- "$@" to separate them correctly 120 | ! PARSED=$(getopt --options=$OPTIONS --longoptions=$LONGOPTS --name "$0" -- "$@") 121 | if [[ ${PIPESTATUS[0]} -ne 0 ]]; then 122 | # e.g. return value is 1 123 | # then getopt has complained about wrong arguments to stdout 124 | usage 125 | exit 2 126 | fi 127 | # read getopt’s output this way to handle the quoting right: 128 | eval set -- "$PARSED" 129 | 130 | while true; do 131 | case "$1" in 132 | -f | --force) 133 | isForce=1 134 | shift 135 | ;; 136 | -c | --creative) 137 | isCreative=1 138 | shift 139 | ;; 140 | --) 141 | shift 142 | break 143 | ;; 144 | *) 145 | targetName="$1" 146 | usage 147 | exit 3 148 | ;; 149 | esac 150 | done 151 | 152 | # handle non-option arguments 153 | if [[ $# -ne 1 ]]; then 154 | usage 155 | exit 4 156 | fi 157 | targetName="$1" 158 | 159 | if [ "$targetName" == "ddev" ]; then 160 | isDumpDdev=1 161 | else 162 | # read target config 163 | if ! . "$targetDir"/"$targetName" 2>/dev/null; then 164 | printf "${errorC}Target/source ‹$targetC%s$errorC› not found.$endC\n" "$targetName" 165 | usage 166 | exit 3 167 | fi 168 | fi 169 | } 170 | 171 | function deleteData() { 172 | # delete existing data 173 | if [ $isForce == 0 ]; then 174 | while true; do 175 | printf "This will delete all existing files in ‹./data/sql/records› and ‹./data/sql/struct›!\n" 176 | read -p "Are you sure? [y/n] " yn 177 | case $yn in 178 | [Yy]*) break ;; 179 | [Nn]*) exit 130 ;; 180 | *) echo "${errorC}Please answer y or n.$endC" ;; 181 | esac 182 | done 183 | fi 184 | 185 | printf "\nDeleting existing files in ‹./data/sql/records› and ‹./data/sql/struct› …" 186 | rm -rf "$structDir" &>/dev/null 187 | rm -rf "$dataDir" &>/dev/null 188 | mkdir -p $structDir 189 | mkdir -p $dataDir 190 | cursorBack 1 191 | printf "${successC}✓${endC}\n\n" 192 | } 193 | 194 | function openTunnel() { 195 | if [ $isDumpDdev == 1 ]; then 196 | target=( 197 | [mysqlHost]=db 198 | [mysqlPort]=3306 199 | [mysqlUser]=db 200 | [mysqlPass]=db 201 | [mysqlDatabase]=db 202 | # TODO: make configurable 203 | [ignoredDbTablesPattern]="^(sys_log|.*_sessions|cf_.*|.*cache.*|sys_file_processedfile|sys_refindex|sys_lockedrecords|tx_realurl_urldata|index_debug|index_fulltext|index_grlist|index_phash|index_rel|index_section|index_stat_search|index_stat_word|index_words|tx_crawler_queue|tx_extensionmanager_domain_model_extension)$" 204 | ) 205 | 206 | mysqlConnectString="--host=${target[mysqlHost]} --protocol=TCP --port=${target[mysqlPort]} --user=\"${target[mysqlUser]}\" --password=\"${target[mysqlPass]}\"" 207 | else 208 | printf "Opening tunnel (provide a password or use ‹ddev auth ssh› to provide a private key) … " 209 | 210 | if [ -z "${target[sshPrivKey]}" ]; then 211 | sshIdentitiyArg= 212 | else 213 | sshIdentitiyArg="-i \"/var/www/html/${target[sshPrivKey]}\"" 214 | fi 215 | localMysqlPort=33060 216 | sshCommand="ssh -f -N -o LogLevel=ERROR -p ${target[sshPort]} $sshIdentitiyArg ${target[sshUser]}@${target[sshHost]} -L 127.0.0.1:$localMysqlPort:${target[mysqlHost]}:${target[mysqlPort]}" 217 | if eval $sshCommand; then 218 | cursorBack 2 219 | printf "${successC}✓${endC}\n" 220 | else 221 | cursorBack 2 222 | printf "${errorC}🞩${endC} - if you are trying to connect with a key, did you insert it to ddev (‹ddev auth ssh›)? \n" 223 | exit 1 224 | fi 225 | 226 | mysqlConnectString="--host=127.0.0.1 --protocol=TCP --port=$localMysqlPort --user=\"${target[mysqlUser]}\" --password=\"${target[mysqlPass]}\"" 227 | fi 228 | trap shutdown EXIT 229 | 230 | mysqlCommand="mysql $mysqlConnectString --default-character-set=utf8mb4 \"${target[mysqlDatabase]}\"" 231 | mysqldumpCommand="mysqldump $mysqlConnectString --default-character-set=utf8mb4 --insert-ignore --skip-comments --quote-names \"${target[mysqlDatabase]}\"" 232 | } 233 | 234 | function gatherTables() { 235 | tablesCommand="$mysqlCommand --skip-column-names --batch -e \"SHOW TABLES;\"" 236 | 237 | printf "Gathering tables …" 238 | tables="$(eval $tablesCommand)" 239 | if [ $? -ne 0 ]; then 240 | cursorBack 1 241 | printf "${errorC}🞩${endC}\n" 242 | echo "Could not gather tables" 243 | exit 1 244 | fi 245 | cursorBack 1 246 | printf "${successC}✓${endC}\n" 247 | } 248 | 249 | function dumpStruct() { 250 | printf " %50s structure " "$T" 251 | _structFile="$structDir/$T.sql" 252 | _dumpTableStructCommand="$mysqldumpCommand --no-data $T --result-file=\"$_structFile\"" 253 | eval "$_dumpTableStructCommand&" 254 | if ! spinner $!; then 255 | printf "${errorC}🞩${endC}\n" 256 | printf "Unsuccessful struct dump\n" 257 | exit 1 258 | fi 259 | printf "${successC}✓${endC} " 260 | } 261 | 262 | function dumpData() { 263 | printf " data " 264 | _dataFile="$dataDir/$T.sql" 265 | _dumpTableDataCommand="$mysqldumpCommand --no-create-info --skip-complete-insert --skip-extended-insert $T --result-file=\"$_dataFile\"" 266 | eval "$_dumpTableDataCommand&" 267 | if ! spinner $!; then 268 | echo $? 269 | printf "${errorC}🞩${endC}\n" 270 | printf "Unsuccessful data dump\n" 271 | exit 1 272 | fi 273 | printf "${successC}✓${endC} (%s)\n" "$(du --apparent-size --human-readable $_dataFile | cut -f1)" 274 | } 275 | 276 | # saner programming env: these switches turn some bugs into errors 277 | set -o errexit -o pipefail -o noclobber -o nounset 278 | 279 | # init 280 | targetDir=$(dirname "$0")/db-targets 281 | structDir="/var/www/html/data/sql/struct" 282 | dataDir="/var/www/html/data/sql/records" 283 | 284 | # arguments 285 | isForce=0 286 | isDumpDdev=0 287 | isCreative=0 288 | targetName= 289 | typeset -A target 290 | 291 | parseArgs "$@" 292 | 293 | deleteData 294 | 295 | openTunnel 296 | 297 | gatherTables 298 | 299 | nTables=$(echo $tables | wc -w) 300 | printf "${white}Dumping %d tables …${endC}\n" "$nTables" 301 | 302 | declare -i _i=0 303 | for T in $tables; do 304 | _i+=1 305 | printf "$white%${#nTables}d/%d$endC" $_i $nTables 306 | 307 | dumpStruct 308 | 309 | # skip data dump? 310 | if [ ! -z "${target[ignoredDbTablesPattern]}" ]; then 311 | if [[ "$T" =~ ${target[ignoredDbTablesPattern]} ]]; then 312 | printf " data ignored (matches ignoredDbTablesPattern)\n" 313 | continue 314 | fi 315 | fi 316 | 317 | dumpData 318 | done 319 | 320 | printf "\nFinished. Dumped all data to ‹./data/sql/records› and ‹./data/sql/struct› (%s)\n" "$(du --apparent-size --human-readable $dataDir | cut -f1)" 321 | printf "To import into ddev, use \n\t‹cat data/sql/struct/* data/sql/records/* | ddev mysql --default-character-set=utf8mb4›\n" 322 | -------------------------------------------------------------------------------- /.ddev/commands/web/eslint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ## HostWorkingDir: true 4 | ## Description: Use eslint on a folder or file for linting javascript code based on Drupal Coding Standards. Alternatively you can also try to autofix the problems, using the "--fix" suffix. 5 | ## Usage: eslint [path], eslint --fix [path] 6 | ## Example: "ddev eslint /var/www/html/web/modules/custom/my_module/js/my-js-file.js" 7 | 8 | # If no argument given, lint current dir: 9 | if [[ $# == 0 ]]; then 10 | npx eslint -c /var/www/html/web/core/.eslintrc.json --no-error-on-unmatched-pattern --ext=.js,.yml "$PWD"; exit 0 11 | # If only argument is "--fix", fix current dir: 12 | elif [[ $# == 1 && $* == '--fix' ]]; then 13 | npx eslint --fix -c /var/www/html/web/core/.eslintrc.json --no-error-on-unmatched-pattern --ext=.js,.yml "$PWD"; exit 0 14 | # else do whatever you typed in (e.g. path only or path with --fix): 15 | else 16 | npx eslint -c /var/www/html/web/core/.eslintrc.json --no-error-on-unmatched-pattern --ext=.js,.yml "$*"; exit 0 17 | fi 18 | -------------------------------------------------------------------------------- /.ddev/commands/web/phpcbf.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ## HostWorkingDir: true 4 | ## Description: Use phpcbf on a Folder for fixing Code using Drupal and DrupalPractice Coding standards 5 | ## Usage: phpcbf [path] 6 | ## Example: "ddev phpcbf web/modules/contrib/devel" 7 | 8 | if [ $# == 0 ] 9 | then 10 | phpcbf -p --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,phtml --standard=Drupal,DrupalPractice $PWD 11 | else 12 | phpcbf -p --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,phtml --standard=Drupal,DrupalPractice $* 13 | fi 14 | 15 | 16 | -------------------------------------------------------------------------------- /.ddev/commands/web/phpcs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ## HostWorkingDir: true 4 | ## Description: Use phpcs on a Folder for checking Drupal and DrupalPractice Coding standards 5 | ## Usage: phpcs [path] 6 | ## Example: "ddev phpcs web/modules/contrib/devel" 7 | 8 | if [ $# == 0 ] 9 | then 10 | phpcs -p --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,phtml --standard=Drupal,DrupalPractice $PWD 11 | else 12 | phpcs -p --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,phtml --standard=Drupal,DrupalPractice $* 13 | fi 14 | 15 | -------------------------------------------------------------------------------- /.ddev/commands/web/phpstan.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ## HostWorkingDir: true 4 | ## Description: Use phpstan on a Folder for checking deprecated and dirty code. 5 | ## Usage: phpstan [path] 6 | ## Example: "ddev phpstan web/modules/contrib/devel" 7 | 8 | if [ $# == 0 ] 9 | then 10 | phpstan analyse -c /var/www/html/phpstan.neon $PWD 11 | else 12 | phpstan analyse -c /var/www/html/phpstan.neon $* 13 | fi 14 | -------------------------------------------------------------------------------- /.ddev/commands/web/phpunit-coverage.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ## HostWorkingDir: true 4 | ## Description: Use phpunit with xdebug in coverage mode to show test coverage of a folder (e.g. a Drupal module folder). 5 | ## Usage: phpunit-coverage [path] 6 | ## Example: "ddev phpunit path/to/tests" 7 | 8 | if [ $# == 0 ] 9 | then 10 | enable_xdebug 11 | phpunit -c /var/www/html/phpunit.xml --coverage-html=./coverage $PWD 12 | else 13 | enable_xdebug 14 | phpunit -c /var/www/html/phpunit.xml --coverage-html=./coverage $* 15 | fi 16 | -------------------------------------------------------------------------------- /.ddev/commands/web/phpunit.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ## HostWorkingDir: true 4 | ## Description: Use phpUnit to Debug a Folder 5 | ## Usage: phpunit [path] 6 | ## Example: "ddev phpunit path/to/tests" 7 | 8 | if [ $# == 0 ] 9 | then 10 | phpunit -c /var/www/html/phpunit.xml $PWD 11 | else 12 | phpunit -c /var/www/html/phpunit.xml $* 13 | fi 14 | -------------------------------------------------------------------------------- /.ddev/commands/web/stylelint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ## HostWorkingDir: true 4 | ## Description: Use stylelint on a Folder for checking Drupal CSS coding standards. 5 | ## Usage: stylelint [path] 6 | ## Example: "ddev stylelint web/modules/custom/my_module" 7 | 8 | if [ $# == 0 ] 9 | then 10 | npx stylelint --config /var/www/html/web/core/.stylelintrc.json $PWD/**/*.css 11 | else 12 | npx stylelint --config /var/www/html/web/core/.stylelintrc.json $*/**/*.css 13 | fi 14 | -------------------------------------------------------------------------------- /.ddev/commands/web/xdebug: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ## #ddev-generated 4 | ## Description: Enable or disable xdebug 5 | ## Usage: xdebug on|off|enable|disable|true|false|status 6 | ## Example: "ddev xdebug" (default is "on"), "ddev xdebug off", "ddev xdebug on", "ddev xdebug status" 7 | 8 | if [ $# -eq 0 ] ; then 9 | enable_xdebug 10 | exit 11 | fi 12 | 13 | xdebug_version=$(php --version | awk '/Xdebug v/ {print $3}') 14 | 15 | case $1 in 16 | on|true|enable) 17 | enable_xdebug 18 | ;; 19 | off|false|disable) 20 | disable_xdebug 21 | ;; 22 | status) 23 | case ${xdebug_version} in 24 | v3*) 25 | status=$(php -r 'echo ini_get("xdebug.mode");' 2>/dev/null) 26 | if [[ "${status}" =~ .*"debug".* ]]; then 27 | result="xdebug enabled" 28 | else 29 | result="xdebug disabled" 30 | fi 31 | ;; 32 | v2*) 33 | status=$(php -r 'echo ini_get("xdebug.remote_enable");') 34 | if [ "${status}" = "1" ]; then 35 | result="xdebug enabled" 36 | else 37 | result="xdebug disabled" 38 | fi 39 | ;; 40 | *) 41 | result="xdebug disabled" 42 | ;; 43 | esac 44 | 45 | echo $result 46 | ;; 47 | *) 48 | echo "Invalid argument: $1" 49 | ;; 50 | esac 51 | -------------------------------------------------------------------------------- /.ddev/config.local.yaml: -------------------------------------------------------------------------------- 1 | #Use this Yaml for your own custom ddev settings. 2 | #NOTE: It will override existing configurations of the config.yaml 3 | 4 | #Example: 5 | #router_http_port: 8080 6 | -------------------------------------------------------------------------------- /.ddev/config.yaml: -------------------------------------------------------------------------------- 1 | type: drupal 2 | # Version constraint is required for new "drupal" type, BUT using this constraint, will make our "drowl-init command unavailable": 3 | # ddev_version_constraint: v1.23.0-alpha1 4 | docroot: web 5 | php_version: "8.3" 6 | webserver_type: apache-fpm 7 | xdebug_enabled: false 8 | additional_hostnames: [] 9 | additional_fqdns: [] 10 | database: 11 | type: mariadb 12 | version: "11.4" 13 | use_dns_when_possible: true 14 | timezone: Europe/Berlin 15 | composer_version: stable 16 | disable_settings_management: true 17 | web_environment: [] 18 | nodejs_version: "20" 19 | corepack_enable: false 20 | 21 | # Key features of DDEV's config.yaml: 22 | 23 | # name: # Name of the project, automatically provides 24 | # http://projectname.ddev.site and https://projectname.ddev.site 25 | 26 | # type: # backdrop, craftcms, django4, drupal, drupal6, drupal7, laravel, magento, magento2, php, python, shopware6, silverstripe, typo3, wordpress 27 | # See https://ddev.readthedocs.io/en/stable/users/quickstart/ for more 28 | # information on the different project types 29 | # "drupal" covers recent Drupal 8+ 30 | 31 | # docroot: # Relative path to the directory containing index.php. 32 | 33 | # php_version: "8.2" # PHP version to use, "5.6", "7.0", "7.1", "7.2", "7.3", "7.4", "8.0", "8.1", "8.2", "8.3" 34 | 35 | # You can explicitly specify the webimage but this 36 | # is not recommended, as the images are often closely tied to DDEV's' behavior, 37 | # so this can break upgrades. 38 | 39 | # webimage: # nginx/php docker image. 40 | 41 | # database: 42 | # type: # mysql, mariadb, postgres 43 | # version: # database version, like "10.11" or "8.0" 44 | # MariaDB versions can be 5.5-10.8 and 10.11, MySQL versions can be 5.5-8.0 45 | # PostgreSQL versions can be 9-16. 46 | 47 | # router_http_port: # Port to be used for http (defaults to global configuration, usually 80) 48 | # router_https_port: # Port for https (defaults to global configuration, usually 443) 49 | 50 | # xdebug_enabled: false # Set to true to enable Xdebug and "ddev start" or "ddev restart" 51 | # Note that for most people the commands 52 | # "ddev xdebug" to enable Xdebug and "ddev xdebug off" to disable it work better, 53 | # as leaving Xdebug enabled all the time is a big performance hit. 54 | 55 | # xhprof_enabled: false # Set to true to enable Xhprof and "ddev start" or "ddev restart" 56 | # Note that for most people the commands 57 | # "ddev xhprof" to enable Xhprof and "ddev xhprof off" to disable it work better, 58 | # as leaving Xhprof enabled all the time is a big performance hit. 59 | 60 | # webserver_type: nginx-fpm, apache-fpm, or nginx-gunicorn 61 | 62 | # timezone: Europe/Berlin 63 | # This is the timezone used in the containers and by PHP; 64 | # it can be set to any valid timezone, 65 | # see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones 66 | # For example Europe/Dublin or MST7MDT 67 | 68 | # composer_root: 69 | # Relative path to the Composer root directory from the project root. This is 70 | # the directory which contains the composer.json and where all Composer related 71 | # commands are executed. 72 | 73 | # composer_version: "2" 74 | # You can set it to "" or "2" (default) for Composer v2 or "1" for Composer v1 75 | # to use the latest major version available at the time your container is built. 76 | # It is also possible to use each other Composer version channel. This includes: 77 | # - 2.2 (latest Composer LTS version) 78 | # - stable 79 | # - preview 80 | # - snapshot 81 | # Alternatively, an explicit Composer version may be specified, for example "2.2.18". 82 | # To reinstall Composer after the image was built, run "ddev debug refresh". 83 | 84 | # nodejs_version: "20" 85 | # change from the default system Node.js version to any other version. 86 | # Numeric version numbers can be complete (i.e. 18.15.0) or 87 | # incomplete (18, 17.2, 16). 'lts' and 'latest' can be used as well along with 88 | # other named releases. 89 | # see https://www.npmjs.com/package/n#specifying-nodejs-versions 90 | # Note that you can continue using 'ddev nvm' or nvm inside the web container 91 | # to change the project's installed node version if you need to. 92 | 93 | # corepack_enable: false 94 | # Change to 'true' to 'corepack enable' and gain access to latest versions of yarn/pnpm 95 | 96 | # additional_hostnames: 97 | # - somename 98 | # - someothername 99 | # would provide http and https URLs for "somename.ddev.site" 100 | # and "someothername.ddev.site". 101 | 102 | # additional_fqdns: 103 | # - example.com 104 | # - sub1.example.com 105 | # would provide http and https URLs for "example.com" and "sub1.example.com" 106 | # Please take care with this because it can cause great confusion. 107 | 108 | # upload_dirs: "custom/upload/dir" 109 | # 110 | # upload_dirs: 111 | # - custom/upload/dir 112 | # - ../private 113 | # 114 | # would set the destination paths for ddev import-files to /custom/upload/dir 115 | # When Mutagen is enabled this path is bind-mounted so that all the files 116 | # in the upload_dirs don't have to be synced into Mutagen. 117 | 118 | # disable_upload_dirs_warning: false 119 | # If true, turns off the normal warning that says 120 | # "You have Mutagen enabled and your 'php' project type doesn't have upload_dirs set" 121 | 122 | # ddev_version_constraint: "" 123 | # Example: 124 | # ddev_version_constraint: ">= 1.22.4" 125 | # This will enforce that the running ddev version is within this constraint. 126 | # See https://github.com/Masterminds/semver#checking-version-constraints for 127 | # supported constraint formats 128 | 129 | # working_dir: 130 | # web: /var/www/html 131 | # db: /home 132 | # would set the default working directory for the web and db services. 133 | # These values specify the destination directory for ddev ssh and the 134 | # directory in which commands passed into ddev exec are run. 135 | 136 | # omit_containers: [db, ddev-ssh-agent] 137 | # Currently only these containers are supported. Some containers can also be 138 | # omitted globally in the ~/.ddev/global_config.yaml. Note that if you omit 139 | # the "db" container, several standard features of DDEV that access the 140 | # database container will be unusable. In the global configuration it is also 141 | # possible to omit ddev-router, but not here. 142 | 143 | # performance_mode: "global" 144 | # DDEV offers performance optimization strategies to improve the filesystem 145 | # performance depending on your host system. Should be configured globally. 146 | # 147 | # If set, will override the global config. Possible values are: 148 | # - "global": uses the value from the global config. 149 | # - "none": disables performance optimization for this project. 150 | # - "mutagen": enables Mutagen for this project. 151 | # - "nfs": enables NFS for this project. 152 | # 153 | # See https://ddev.readthedocs.io/en/stable/users/install/performance/#nfs 154 | # See https://ddev.readthedocs.io/en/stable/users/install/performance/#mutagen 155 | 156 | # fail_on_hook_fail: False 157 | # Decide whether 'ddev start' should be interrupted by a failing hook 158 | 159 | # host_https_port: "59002" 160 | # The host port binding for https can be explicitly specified. It is 161 | # dynamic unless otherwise specified. 162 | # This is not used by most people, most people use the *router* instead 163 | # of the localhost port. 164 | 165 | # host_webserver_port: "59001" 166 | # The host port binding for the ddev-webserver can be explicitly specified. It is 167 | # dynamic unless otherwise specified. 168 | # This is not used by most people, most people use the *router* instead 169 | # of the localhost port. 170 | 171 | # host_db_port: "59002" 172 | # The host port binding for the ddev-dbserver can be explicitly specified. It is dynamic 173 | # unless explicitly specified. 174 | 175 | # mailpit_http_port: "8025" 176 | # mailpit_https_port: "8026" 177 | # The Mailpit ports can be changed from the default 8025 and 8026 178 | 179 | # host_mailpit_port: "8025" 180 | # The mailpit port is not normally bound on the host at all, instead being routed 181 | # through ddev-router, but it can be bound directly to localhost if specified here. 182 | 183 | # webimage_extra_packages: [php7.4-tidy, php-bcmath] 184 | # Extra Debian packages that are needed in the webimage can be added here 185 | 186 | # dbimage_extra_packages: [telnet,netcat] 187 | # Extra Debian packages that are needed in the dbimage can be added here 188 | 189 | # use_dns_when_possible: true 190 | # If the host has internet access and the domain configured can 191 | # successfully be looked up, DNS will be used for hostname resolution 192 | # instead of editing /etc/hosts 193 | # Defaults to true 194 | 195 | # project_tld: ddev.site 196 | # The top-level domain used for project URLs 197 | # The default "ddev.site" allows DNS lookup via a wildcard 198 | # If you prefer you can change this to "ddev.local" to preserve 199 | # pre-v1.9 behavior. 200 | 201 | # ngrok_args: --basic-auth username:pass1234 202 | # Provide extra flags to the "ngrok http" command, see 203 | # https://ngrok.com/docs/ngrok-agent/config or run "ngrok http -h" 204 | 205 | # disable_settings_management: false 206 | # If true, DDEV will not create CMS-specific settings files like 207 | # Drupal's settings.php/settings.ddev.php or TYPO3's AdditionalConfiguration.php 208 | # In this case the user must provide all such settings. 209 | 210 | # You can inject environment variables into the web container with: 211 | # web_environment: 212 | # - SOMEENV=somevalue 213 | # - SOMEOTHERENV=someothervalue 214 | 215 | # no_project_mount: false 216 | # (Experimental) If true, DDEV will not mount the project into the web container; 217 | # the user is responsible for mounting it manually or via a script. 218 | # This is to enable experimentation with alternate file mounting strategies. 219 | # For advanced users only! 220 | 221 | # bind_all_interfaces: false 222 | # If true, host ports will be bound on all network interfaces, 223 | # not the localhost interface only. This means that ports 224 | # will be available on the local network if the host firewall 225 | # allows it. 226 | 227 | # default_container_timeout: 120 228 | # The default time that DDEV waits for all containers to become ready can be increased from 229 | # the default 120. This helps in importing huge databases, for example. 230 | 231 | #web_extra_exposed_ports: 232 | #- name: nodejs 233 | # container_port: 3000 234 | # http_port: 2999 235 | # https_port: 3000 236 | #- name: something 237 | # container_port: 4000 238 | # https_port: 4000 239 | # http_port: 3999 240 | # Allows a set of extra ports to be exposed via ddev-router 241 | # Fill in all three fields even if you don’t intend to use the https_port! 242 | # If you don’t add https_port, then it defaults to 0 and ddev-router will fail to start. 243 | # 244 | # The port behavior on the ddev-webserver must be arranged separately, for example 245 | # using web_extra_daemons. 246 | # For example, with a web app on port 3000 inside the container, this config would 247 | # expose that web app on https://.ddev.site:9999 and http://.ddev.site:9998 248 | # web_extra_exposed_ports: 249 | # - name: myapp 250 | # container_port: 3000 251 | # http_port: 9998 252 | # https_port: 9999 253 | 254 | #web_extra_daemons: 255 | #- name: "http-1" 256 | # command: "/var/www/html/node_modules/.bin/http-server -p 3000" 257 | # directory: /var/www/html 258 | #- name: "http-2" 259 | # command: "/var/www/html/node_modules/.bin/http-server /var/www/html/sub -p 3000" 260 | # directory: /var/www/html 261 | 262 | # override_config: false 263 | # By default, config.*.yaml files are *merged* into the configuration 264 | # But this means that some things can't be overridden 265 | # For example, if you have 'use_dns_when_possible: true'' you can't override it with a merge 266 | # and you can't erase existing hooks or all environment variables. 267 | # However, with "override_config: true" in a particular config.*.yaml file, 268 | # 'use_dns_when_possible: false' can override the existing values, and 269 | # hooks: 270 | # post-start: [] 271 | # or 272 | # web_environment: [] 273 | # or 274 | # additional_hostnames: [] 275 | # can have their intended affect. 'override_config' affects only behavior of the 276 | # config.*.yaml file it exists in. 277 | 278 | # Many DDEV commands can be extended to run tasks before or after the 279 | # DDEV command is executed, for example "post-start", "post-import-db", 280 | # "pre-composer", "post-composer" 281 | # See https://ddev.readthedocs.io/en/stable/users/extend/custom-commands/ for more 282 | # information on the commands that can be extended and the tasks you can define 283 | # for them. Example: 284 | #hooks: 285 | -------------------------------------------------------------------------------- /.ddev/db-build/Dockerfile.example: -------------------------------------------------------------------------------- 1 | 2 | #ddev-generated 3 | # You can copy this Dockerfile.example to Dockerfile to add configuration 4 | # or packages or anything else to your dbimage 5 | RUN echo "Built on $(date)" > /build-date.txt 6 | -------------------------------------------------------------------------------- /.ddev/homeadditions/README.txt: -------------------------------------------------------------------------------- 1 | #ddev-generated 2 | Files in .ddev/homeadditions will be copied into the web container's home directory. 3 | 4 | An example bash_aliases.example is provided here. To make this file active you can either 5 | 6 | cp bash_aliases.example .bash_aliases 7 | or ln -s bash_aliases.example .bash_aliases 8 | -------------------------------------------------------------------------------- /.ddev/homeadditions/bash_aliases.example: -------------------------------------------------------------------------------- 1 | # #ddev-generated 2 | # To make this file active you can either 3 | # cp bash_aliases.example .bash_aliases 4 | # or ln -s bash_aliases.example .bash_aliases 5 | 6 | alias ll="ls -lhA" 7 | -------------------------------------------------------------------------------- /.ddev/initiation-additions/.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": [ 3 | /*--------------------------------------------------PHP Specific Extensions--------------------------------------------------*/ 4 | "xdebug.php-debug", 5 | "neilbrayfield.php-docblocker", 6 | "cvergne.vscode-php-getters-setters-cv", 7 | "bmewburn.vscode-intelephense-client", 8 | "mehedidracula.php-namespace-resolver", 9 | "ValeryanM.vscode-phpsab", 10 | /*--------------------------------------------------Javascript Specific Extensions--------------------------------------------------*/ 11 | "dbaeumer.vscode-eslint", 12 | /*--------------------------------------------------Drupal Specific Extensions--------------------------------------------------*/ 13 | "mblode.twig-language-2", 14 | "nadim-vscode.twig-code-snippets", 15 | /*--------------------------------------------------Other Extensions--------------------------------------------------*/ 16 | "mrmlnc.vscode-apache", 17 | "DEVSENSE.composer-php-vscode", 18 | "eamodio.gitlens", 19 | "dmitrydorofeev.empty-indent", 20 | "jgclark.vscode-todo-highlight", 21 | "esbenp.prettier-vscode", 22 | "streetsidesoftware.code-spell-checker", 23 | "stylelint.vscode-stylelint", 24 | ] 25 | } 26 | -------------------------------------------------------------------------------- /.ddev/initiation-additions/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // See https://code.visualstudio.com/docs/editor/debugging#_launch-configurations 3 | // for the documentation about the launch.json format 4 | "version": "0.2.0", 5 | "configurations": [ 6 | { 7 | "name": "Listen for Xdebug", 8 | "type": "php", 9 | "request": "launch", 10 | "hostname": "127.0.0.1", 11 | "port": 9003, 12 | "pathMappings": { 13 | "/var/www/html": "${workspaceFolder}" 14 | }, 15 | "preLaunchTask": "DDEV: Enable Xdebug", 16 | "postDebugTask": "DDEV: Disable Xdebug" 17 | }, 18 | { 19 | "name": "Debug Javascript", 20 | "type": "chrome", 21 | "request": "launch", 22 | // @todo We should make this url dynamic, based on the ddev project name: 23 | "url": "https://standard-vscode-drupal.ddev.site/", 24 | "webRoot": "/var/www/html/web" 25 | } 26 | ] 27 | } 28 | -------------------------------------------------------------------------------- /.ddev/initiation-additions/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "emmet.showAbbreviationSuggestions": false, 3 | "emmet.showExpandedAbbreviation": "never", 4 | "editor.wordSeparators": "`~!@#%^&*()-=+[{]}\\|;:'\",.<>/?", 5 | "php-docblocker.gap": true, 6 | "php-docblocker.useShortNames": true, 7 | "php-docblocker.returnVoid": false, 8 | "editor.quickSuggestions": { 9 | "comments": false 10 | }, 11 | "javascript.validate.enable": true, 12 | "javascript.format.enable": true, 13 | "eslint.format.enable": true, 14 | "eslint.enable": true, 15 | "prettier.configPath": "web/core/.prettierrc.json", 16 | "[javascript]": { 17 | "editor.defaultFormatter":"dbaeumer.vscode-eslint" 18 | }, 19 | "editor.codeActionsOnSave": { 20 | "source.fixAll.eslint": false 21 | }, 22 | "eslint.workingDirectories": [ 23 | "./web" 24 | ], 25 | "php.suggest.basic": false, //disable basic php suggests for better Intelephense Suggestions 26 | "terminal.integrated.defaultProfile.linux": "bash", 27 | "emptyIndent.removeIndent": true, //Automatically remove indentation in empty lines on save 28 | "emptyIndent.highlightIndent": false, //Highlight indent on empty lines 29 | "emptyIndent.highlightColor": "rgba(246,36,89,0.6)", //Highlight indent color 30 | "emptyIndent.exclude": [ 31 | ".md" 32 | ], //Excluded file types 33 | "todohighlight.isEnable": true, 34 | "todohighlight.isCaseSensitive": true, 35 | "todohighlight.keywords": [ 36 | { 37 | "text": "@todo", 38 | "color": "grey", 39 | "backgroundColor": "rgba(255, 252, 127)", 40 | "border": "none", 41 | "isWholeLine": false 42 | }, 43 | { 44 | "text": "TODO LATER", 45 | "color": "white", 46 | "backgroundColor": "rgba(189, 195, 199)", 47 | "border": "none", 48 | "overviewRulerColor": "grey", 49 | "isWholeLine": false 50 | }, 51 | ], 52 | "todohighlight.include": [ 53 | "**/*.js", 54 | "**/*.jsx", 55 | "**/*.ts", 56 | "**/*.tsx", 57 | "**/*.html", 58 | "**/*.css", 59 | "**/*.scss", 60 | "**/*.php", 61 | "**/*.txt", 62 | "**/*.mdown", 63 | "**/*.md", 64 | "**/*.txt", 65 | "**/*.inc", 66 | "**/*.theme", 67 | "**/*.install", 68 | "**/*.module", 69 | "**/*.profile", 70 | "**/*.php", 71 | "**/*.phtml", 72 | "**/*.twig", 73 | "**/*.tpl", 74 | ], 75 | "intelephense.files.exclude": [ //more specific excludes so Tests should be recognized 76 | "**/.git/**", 77 | "**/.svn/**", 78 | "**/.hg/**", 79 | "**/CVS/**", 80 | "**/.DS_Store/**", 81 | "**/node_modules/**", 82 | "**/bower_components/**", 83 | "**/vendor/**/{Test,test,Tests,tests}/**/*Test.php" 84 | ], 85 | "intelephense.environment.shortOpenTag": true, 86 | "intelephense.telemetry.enabled": false, 87 | "phpsab.standard": "Drupal,DrupalPractice", 88 | "phpsab.snifferArguments": ["--extensions=inc,theme,install,module,profile,php,phtml"], 89 | "phpsab.fixerArguments": ["--extensions=inc,theme,install,module,profile,php,phtml"], 90 | "[php]": { 91 | "editor.defaultFormatter": "valeryanm.vscode-phpsab" 92 | }, 93 | "intelephense.environment.includePaths": [ 94 | "web/core/includes" 95 | ], 96 | "intelephense.files.associations": [ 97 | "*.inc", 98 | "*.theme", 99 | "*.install", 100 | "*.module", 101 | "*.profile", 102 | "*.php", 103 | "*.phtml" 104 | ], 105 | "intelephense.phpdoc.returnVoid": false, 106 | "intelephense.format.braces": "k&r", 107 | "phpstan.configFile": "phpstan.neon", 108 | "phpstan.enabled": true, 109 | "breadcrumbs.enabled": true, 110 | "diffEditor.ignoreTrimWhitespace": false, 111 | "editor.tabSize": 2, 112 | "editor.insertSpaces": true, 113 | "editor.formatOnSave": false, 114 | "editor.renderWhitespace": "boundary", 115 | "editor.wordWrapColumn": 80, 116 | "editor.wordWrap": "off", 117 | "editor.detectIndentation": false, 118 | "html.suggest.html5": true, 119 | "css.validate": true, 120 | "editor.formatOnPaste": false, 121 | "cSpell.workspaceRootPath": "./web/core", 122 | "editor.rulers": [ 123 | 80 124 | ], 125 | "files.associations": { 126 | "*.inc": "php", 127 | "*.module": "php", 128 | "*.install": "php", 129 | "*.theme": "php", 130 | "*.tpl.php": "php", 131 | "*.test": "php", 132 | "*.php": "php", 133 | "*.svg": "xml", 134 | "*.yml": "yaml", 135 | "*.html": "twig", 136 | "*.twig": "twig", 137 | "*.tpl": "smarty" 138 | }, 139 | "files.trimTrailingWhitespace": false, 140 | "files.insertFinalNewline": true, 141 | "html.format.enable": true, 142 | "html.format.wrapLineLength": 80, 143 | "emmet.includeLanguages": { 144 | "twig": "html" 145 | }, 146 | "emmet.syntaxProfiles": { 147 | "twig": "html" 148 | }, 149 | "twig-language-2.indentStyle": "space", 150 | "html.validate.scripts": false, 151 | "html.validate.styles": false, 152 | "[scss]": { 153 | "editor.defaultFormatter":"esbenp.prettier-vscode" 154 | }, 155 | "[css]": { 156 | "editor.defaultFormatter":"stylelint.vscode-stylelint" 157 | }, 158 | "stylelint.enable":true, 159 | "stylelint.configFile": "./web/core/.stylelintrc.json", 160 | "workbench.colorCustomizations": { 161 | "activityBar.activeBackground": "#0897ef", 162 | "activityBar.background": "#0897ef", 163 | "activityBar.foreground": "#e7e7e7", 164 | "activityBar.inactiveForeground": "#e7e7e799", 165 | "activityBarBadge.background": "#fdc1e6", 166 | "activityBarBadge.foreground": "#15202b", 167 | "commandCenter.border": "#e7e7e799", 168 | "sash.hoverBorder": "#0897ef", 169 | "statusBar.background": "#0678be", 170 | "statusBar.foreground": "#e7e7e7", 171 | "statusBarItem.hoverBackground": "#0897ef", 172 | "statusBarItem.remoteBackground": "#0678be", 173 | "statusBarItem.remoteForeground": "#e7e7e7", 174 | "titleBar.activeBackground": "#0678be", 175 | "titleBar.activeForeground": "#e7e7e7", 176 | "titleBar.inactiveBackground": "#0678be99", 177 | "titleBar.inactiveForeground": "#e7e7e799" 178 | }, 179 | } 180 | -------------------------------------------------------------------------------- /.ddev/initiation-additions/.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | // See https://go.microsoft.com/fwlink/?LinkId=733558 3 | // for the documentation about the tasks.json format 4 | "version": "2.0.0", 5 | "tasks": [ 6 | { 7 | "label": "DDEV: Enable Xdebug", 8 | "type": "shell", 9 | "command": "enable_xdebug" 10 | }, 11 | { 12 | "label": "DDEV: Disable Xdebug", 13 | "type": "shell", 14 | "command": "disable_xdebug" 15 | } 16 | ] 17 | } 18 | -------------------------------------------------------------------------------- /.ddev/initiation-additions/cspell.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.1", 3 | "language": "en-US", 4 | "allowCompoundWords": false, 5 | "globRoot": ".", 6 | "ignorePaths": [ 7 | ".ddev", 8 | ".editorconfig", 9 | ".vscode", 10 | "composer.json", 11 | "composer.lock", 12 | "cspell.json", 13 | "data", 14 | "files", 15 | "node_modules", 16 | "package-lock.json", 17 | "package.json", 18 | "phpstan.neon", 19 | "tmp", 20 | "vendor", 21 | "web/.csslintrc", 22 | "web/.eslintignore", 23 | "web/.eslintrc.json", 24 | "web/.ht.router.php", 25 | "web/.htaccess", 26 | "web/INSTALL.txt", 27 | "web/README.md", 28 | "web/autoload.php", 29 | "web/example.gitignore", 30 | "web/index.php", 31 | "web/profiles", 32 | "web/robots.txt", 33 | "web/sites", 34 | "web/update.php", 35 | "web/web.config", 36 | "web/core", 37 | "web/themes/contrib", 38 | "web/modules/contrib" 39 | ], 40 | "ignoreRegExpList": [ 41 | "^msgstr .*", 42 | "!!binary .*", 43 | "%[0-9][0-9A-F]", 44 | "\\Wi18n", 45 | "\\x{[0-9A-F]{4,5}}" 46 | ], 47 | "dictionaries": [ 48 | "drupal", 49 | "companies", 50 | "fonts", 51 | "html", 52 | "php", 53 | "softwareTerms" 54 | ], 55 | "dictionaryDefinitions": [ 56 | { "name": "drupal", "path": "./web/core/misc/cspell/dictionary.txt" } 57 | ], 58 | "flagWords": ["grey", "hte"], 59 | "overrides": [ 60 | { 61 | "filename": "**/{*.engine,*.inc,*.install,*.module,*.profile,*.theme}", 62 | "languageId": "php" 63 | }, 64 | { 65 | "filename": "**/scripts/{*.php.txt, *.sh}", 66 | "languageId": "php" 67 | } 68 | ] 69 | } 70 | -------------------------------------------------------------------------------- /.ddev/initiation-additions/jsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "CommonJS", 4 | "target": "ES6" 5 | }, 6 | "include": [ 7 | "web/core/misc" 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /.ddev/initiation-additions/phpstan.neon: -------------------------------------------------------------------------------- 1 | includes: 2 | - vendor/mglaman/phpstan-drupal/phpstan-baseline.neon 3 | - phar://phpstan.phar/conf/bleedingEdge.neon 4 | 5 | parameters: 6 | level: 1 7 | 8 | fileExtensions: 9 | - inc 10 | - php 11 | - module 12 | - install 13 | - theme 14 | - tpl.php 15 | - test 16 | 17 | ignoreErrors: 18 | # new static() is a best practice in Drupal, so we cannot fix that. 19 | - "#^Unsafe usage of new static#" 20 | 21 | # These options were originally meant for the PHPStan VSCode extension, because 22 | # it would constantly analyse everything, but the extension is too fragile and 23 | # removed now: 24 | # excludePaths: 25 | # # only scan our modules folder: 26 | # analyse: 27 | # - vendor 28 | # - web/core 29 | # - web/sites 30 | # - web/themes/contrib 31 | # - web/modules/contrib 32 | # analyseAndScan: 33 | # - .ddev 34 | # - .vscode 35 | # - data 36 | # - node_modules 37 | -------------------------------------------------------------------------------- /.ddev/initiation-additions/phpunit.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 20 | 21 | 25 | 26 | 27 | 28 | 30 | 31 | 33 | 34 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | ./tests/TestSuites/UnitTestSuite.php 49 | 50 | 51 | ./tests/TestSuites/KernelTestSuite.php 52 | 53 | 54 | ./tests/TestSuites/FunctionalTestSuite.php 55 | 56 | 57 | ./tests/TestSuites/FunctionalJavascriptTestSuite.php 58 | 59 | 60 | ./tests/TestSuites/BuildTestSuite.php 61 | 62 | 63 | 64 | 65 | 66 | ./web/core/includes 67 | ./web/core/lib 68 | ./web/core/modules 69 | ./web/modules 70 | ./web/sites 71 | 72 | 73 | ./web/core/modules/*/src/Tests 74 | ./web/core/modules/*/tests 75 | ./web/modules/*/src/Tests 76 | ./web/modules/*/tests 77 | ./web/modules/*/*/src/Tests 78 | ./web/modules/*/*/tests 79 | 80 | 81 | 82 | -------------------------------------------------------------------------------- /.ddev/initiation-additions/services.local.yml: -------------------------------------------------------------------------------- 1 | # Local development services. 2 | # 3 | # To activate this feature, follow the instructions at the top of the 4 | # 'example.settings.local.php' file, which sits next to this file. 5 | parameters: 6 | http.response.debug_cacheability_headers: false 7 | twig.config: 8 | debug: true 9 | auto_reload: true 10 | cache: false 11 | services: 12 | cache.backend.null: 13 | class: Drupal\Core\Cache\NullBackendFactory 14 | -------------------------------------------------------------------------------- /.ddev/initiation-additions/settings.local.php: -------------------------------------------------------------------------------- 1 | 'databasename', 81 | * 'username' => 'sqlusername', 82 | * 'password' => 'sqlpassword', 83 | * 'host' => 'localhost', 84 | * 'port' => '3306', 85 | * 'driver' => 'mysql', 86 | * 'prefix' => '', 87 | * 'collation' => 'utf8mb4_general_ci', 88 | * ]; 89 | * @endcode 90 | */ 91 | $databases = []; 92 | 93 | /** 94 | * Customizing database settings. 95 | * 96 | * Many of the values of the $databases array can be customized for your 97 | * particular database system. Refer to the sample in the section above as a 98 | * starting point. 99 | * 100 | * The "driver" property indicates what Drupal database driver the 101 | * connection should use. This is usually the same as the name of the 102 | * database type, such as mysql or sqlite, but not always. The other 103 | * properties will vary depending on the driver. For SQLite, you must 104 | * specify a database file name in a directory that is writable by the 105 | * webserver. For most other drivers, you must specify a 106 | * username, password, host, and database name. 107 | * 108 | * Drupal core implements drivers for mysql, pgsql, and sqlite. Other drivers 109 | * can be provided by contributed or custom modules. To use a contributed or 110 | * custom driver, the "namespace" property must be set to the namespace of the 111 | * driver. The code in this namespace must be autoloadable prior to connecting 112 | * to the database, and therefore, prior to when module root namespaces are 113 | * added to the autoloader. To add the driver's namespace to the autoloader, 114 | * set the "autoload" property to the PSR-4 base directory of the driver's 115 | * namespace. This is optional for projects managed with Composer if the 116 | * driver's namespace is in Composer's autoloader. 117 | * 118 | * For each database, you may optionally specify multiple "target" databases. 119 | * A target database allows Drupal to try to send certain queries to a 120 | * different database if it can but fall back to the default connection if not. 121 | * That is useful for primary/replica replication, as Drupal may try to connect 122 | * to a replica server when appropriate and if one is not available will simply 123 | * fall back to the single primary server (The terms primary/replica are 124 | * traditionally referred to as master/slave in database server documentation). 125 | * 126 | * The general format for the $databases array is as follows: 127 | * @code 128 | * $databases['default']['default'] = $info_array; 129 | * $databases['default']['replica'][] = $info_array; 130 | * $databases['default']['replica'][] = $info_array; 131 | * $databases['extra']['default'] = $info_array; 132 | * @endcode 133 | * 134 | * In the above example, $info_array is an array of settings described above. 135 | * The first line sets a "default" database that has one primary database 136 | * (the second level default). The second and third lines create an array 137 | * of potential replica databases. Drupal will select one at random for a given 138 | * request as needed. The fourth line creates a new database with a name of 139 | * "extra". 140 | * 141 | * You can optionally set prefixes for some or all database table names 142 | * by using the 'prefix' setting. If a prefix is specified, the table 143 | * name will be prepended with its value. Be sure to use valid database 144 | * characters only, usually alphanumeric and underscore. If no prefixes 145 | * are desired, leave it as an empty string ''. 146 | * 147 | * To have all database names prefixed, set 'prefix' as a string: 148 | * @code 149 | * 'prefix' => 'main_', 150 | * @endcode 151 | * 152 | * Per-table prefixes are deprecated as of Drupal 8.2, and will be removed in 153 | * Drupal 9.0. After that, only a single prefix for all tables will be 154 | * supported. 155 | * 156 | * To provide prefixes for specific tables, set 'prefix' as an array. 157 | * The array's keys are the table names and the values are the prefixes. 158 | * The 'default' element is mandatory and holds the prefix for any tables 159 | * not specified elsewhere in the array. Example: 160 | * @code 161 | * 'prefix' => [ 162 | * 'default' => 'main_', 163 | * 'users' => 'shared_', 164 | * 'sessions' => 'shared_', 165 | * 'role' => 'shared_', 166 | * 'authmap' => 'shared_', 167 | * ], 168 | * @endcode 169 | * You can also use a reference to a schema/database as a prefix. This may be 170 | * useful if your Drupal installation exists in a schema that is not the default 171 | * or you want to access several databases from the same code base at the same 172 | * time. 173 | * Example: 174 | * @code 175 | * 'prefix' => [ 176 | * 'default' => 'main.', 177 | * 'users' => 'shared.', 178 | * 'sessions' => 'shared.', 179 | * 'role' => 'shared.', 180 | * 'authmap' => 'shared.', 181 | * ]; 182 | * @endcode 183 | * NOTE: MySQL and SQLite's definition of a schema is a database. 184 | * 185 | * Advanced users can add or override initial commands to execute when 186 | * connecting to the database server, as well as PDO connection settings. For 187 | * example, to enable MySQL SELECT queries to exceed the max_join_size system 188 | * variable, and to reduce the database connection timeout to 5 seconds: 189 | * @code 190 | * $databases['default']['default'] = [ 191 | * 'init_commands' => [ 192 | * 'big_selects' => 'SET SQL_BIG_SELECTS=1', 193 | * ], 194 | * 'pdo' => [ 195 | * PDO::ATTR_TIMEOUT => 5, 196 | * ], 197 | * ]; 198 | * @endcode 199 | * 200 | * WARNING: The above defaults are designed for database portability. Changing 201 | * them may cause unexpected behavior, including potential data loss. See 202 | * https://www.drupal.org/developing/api/database/configuration for more 203 | * information on these defaults and the potential issues. 204 | * 205 | * More details can be found in the constructor methods for each driver: 206 | * - \Drupal\Core\Database\Driver\mysql\Connection::__construct() 207 | * - \Drupal\Core\Database\Driver\pgsql\Connection::__construct() 208 | * - \Drupal\Core\Database\Driver\sqlite\Connection::__construct() 209 | * 210 | * Sample Database configuration format for PostgreSQL (pgsql): 211 | * @code 212 | * $databases['default']['default'] = [ 213 | * 'driver' => 'pgsql', 214 | * 'database' => 'databasename', 215 | * 'username' => 'sqlusername', 216 | * 'password' => 'sqlpassword', 217 | * 'host' => 'localhost', 218 | * 'prefix' => '', 219 | * ]; 220 | * @endcode 221 | * 222 | * Sample Database configuration format for SQLite (sqlite): 223 | * @code 224 | * $databases['default']['default'] = [ 225 | * 'driver' => 'sqlite', 226 | * 'database' => '/path/to/databasefilename', 227 | * ]; 228 | * @endcode 229 | * 230 | * Sample Database configuration format for a driver in a contributed module: 231 | * @code 232 | * $databases['default']['default'] = [ 233 | * 'driver' => 'my_driver', 234 | * 'namespace' => 'Drupal\my_module\Driver\Database\my_driver', 235 | * 'autoload' => 'modules/my_module/src/Driver/Database/my_driver/', 236 | * 'database' => 'databasename', 237 | * 'username' => 'sqlusername', 238 | * 'password' => 'sqlpassword', 239 | * 'host' => 'localhost', 240 | * 'prefix' => '', 241 | * ]; 242 | * @endcode 243 | */ 244 | 245 | /** 246 | * Location of the site configuration files. 247 | * 248 | * The $settings['config_sync_directory'] specifies the location of file system 249 | * directory used for syncing configuration data. On install, the directory is 250 | * created. This is used for configuration imports. 251 | * 252 | * The default location for this directory is inside a randomly-named 253 | * directory in the public files path. The setting below allows you to set 254 | * its location. 255 | */ 256 | # $settings['config_sync_directory'] = '/directory/outside/webroot'; 257 | 258 | /** 259 | * Settings: 260 | * 261 | * $settings contains environment-specific configuration, such as the files 262 | * directory and reverse proxy address, and temporary configuration, such as 263 | * security overrides. 264 | * 265 | * @see \Drupal\Core\Site\Settings::get() 266 | */ 267 | 268 | /** 269 | * Salt for one-time login links, cancel links, form tokens, etc. 270 | * 271 | * This variable will be set to a random value by the installer. All one-time 272 | * login links will be invalidated if the value is changed. Note that if your 273 | * site is deployed on a cluster of web servers, you must ensure that this 274 | * variable has the same value on each server. 275 | * 276 | * For enhanced security, you may set this variable to the contents of a file 277 | * outside your document root; you should also ensure that this file is not 278 | * stored with backups of your database. 279 | * 280 | * Example: 281 | * @code 282 | * $settings['hash_salt'] = file_get_contents('/home/example/salt.txt'); 283 | * @endcode 284 | */ 285 | $settings['hash_salt'] = 'nM1gJVSJRiBLbL6PiQwSkXCU14RFvAnHG9lCzrQ33JoJyG8UVvhy3U-J199wufHVhMDb7pDPag'; 286 | 287 | /** 288 | * Deployment identifier. 289 | * 290 | * Drupal's dependency injection container will be automatically invalidated and 291 | * rebuilt when the Drupal core version changes. When updating contributed or 292 | * custom code that changes the container, changing this identifier will also 293 | * allow the container to be invalidated as soon as code is deployed. 294 | */ 295 | # $settings['deployment_identifier'] = \Drupal::VERSION; 296 | 297 | /** 298 | * Access control for update.php script. 299 | * 300 | * If you are updating your Drupal installation using the update.php script but 301 | * are not logged in using either an account with the "Administer software 302 | * updates" permission or the site maintenance account (the account that was 303 | * created during installation), you will need to modify the access check 304 | * statement below. Change the FALSE to a TRUE to disable the access check. 305 | * After finishing the upgrade, be sure to open this file again and change the 306 | * TRUE back to a FALSE! 307 | */ 308 | $settings['update_free_access'] = FALSE; 309 | 310 | /** 311 | * Fallback to HTTP for Update Manager and for fetching security advisories. 312 | * 313 | * If your site fails to connect to updates.drupal.org over HTTPS (either when 314 | * fetching data on available updates, or when fetching the feed of critical 315 | * security announcements), you may uncomment this setting and set it to TRUE to 316 | * allow an insecure fallback to HTTP. Note that doing so will open your site up 317 | * to a potential man-in-the-middle attack. You should instead attempt to 318 | * resolve the issues before enabling this option. 319 | * @see https://www.drupal.org/docs/system-requirements/php-requirements#openssl 320 | * @see https://en.wikipedia.org/wiki/Man-in-the-middle_attack 321 | * @see \Drupal\update\UpdateFetcher 322 | * @see \Drupal\system\SecurityAdvisories\SecurityAdvisoriesFetcher 323 | */ 324 | # $settings['update_fetch_with_http_fallback'] = TRUE; 325 | 326 | /** 327 | * External access proxy settings: 328 | * 329 | * If your site must access the Internet via a web proxy then you can enter the 330 | * proxy settings here. Set the full URL of the proxy, including the port, in 331 | * variables: 332 | * - $settings['http_client_config']['proxy']['http']: The proxy URL for HTTP 333 | * requests. 334 | * - $settings['http_client_config']['proxy']['https']: The proxy URL for HTTPS 335 | * requests. 336 | * You can pass in the user name and password for basic authentication in the 337 | * URLs in these settings. 338 | * 339 | * You can also define an array of host names that can be accessed directly, 340 | * bypassing the proxy, in $settings['http_client_config']['proxy']['no']. 341 | */ 342 | # $settings['http_client_config']['proxy']['http'] = 'http://proxy_user:proxy_pass@example.com:8080'; 343 | # $settings['http_client_config']['proxy']['https'] = 'http://proxy_user:proxy_pass@example.com:8080'; 344 | # $settings['http_client_config']['proxy']['no'] = ['127.0.0.1', 'localhost']; 345 | 346 | /** 347 | * Reverse Proxy Configuration: 348 | * 349 | * Reverse proxy servers are often used to enhance the performance 350 | * of heavily visited sites and may also provide other site caching, 351 | * security, or encryption benefits. In an environment where Drupal 352 | * is behind a reverse proxy, the real IP address of the client should 353 | * be determined such that the correct client IP address is available 354 | * to Drupal's logging, statistics, and access management systems. In 355 | * the most simple scenario, the proxy server will add an 356 | * X-Forwarded-For header to the request that contains the client IP 357 | * address. However, HTTP headers are vulnerable to spoofing, where a 358 | * malicious client could bypass restrictions by setting the 359 | * X-Forwarded-For header directly. Therefore, Drupal's proxy 360 | * configuration requires the IP addresses of all remote proxies to be 361 | * specified in $settings['reverse_proxy_addresses'] to work correctly. 362 | * 363 | * Enable this setting to get Drupal to determine the client IP from the 364 | * X-Forwarded-For header. If you are unsure about this setting, do not have a 365 | * reverse proxy, or Drupal operates in a shared hosting environment, this 366 | * setting should remain commented out. 367 | * 368 | * In order for this setting to be used you must specify every possible 369 | * reverse proxy IP address in $settings['reverse_proxy_addresses']. 370 | * If a complete list of reverse proxies is not available in your 371 | * environment (for example, if you use a CDN) you may set the 372 | * $_SERVER['REMOTE_ADDR'] variable directly in settings.php. 373 | * Be aware, however, that it is likely that this would allow IP 374 | * address spoofing unless more advanced precautions are taken. 375 | */ 376 | # $settings['reverse_proxy'] = TRUE; 377 | 378 | /** 379 | * Specify every reverse proxy IP address in your environment. 380 | * This setting is required if $settings['reverse_proxy'] is TRUE. 381 | */ 382 | # $settings['reverse_proxy_addresses'] = ['a.b.c.d', ...]; 383 | 384 | /** 385 | * Reverse proxy trusted headers. 386 | * 387 | * Sets which headers to trust from your reverse proxy. 388 | * 389 | * Common values are: 390 | * - \Symfony\Component\HttpFoundation\Request::HEADER_X_FORWARDED_FOR 391 | * - \Symfony\Component\HttpFoundation\Request::HEADER_X_FORWARDED_HOST 392 | * - \Symfony\Component\HttpFoundation\Request::HEADER_X_FORWARDED_PORT 393 | * - \Symfony\Component\HttpFoundation\Request::HEADER_X_FORWARDED_PROTO 394 | * - \Symfony\Component\HttpFoundation\Request::HEADER_FORWARDED 395 | * 396 | * Note the default value of 397 | * @code 398 | * \Symfony\Component\HttpFoundation\Request::HEADER_X_FORWARDED_FOR | \Symfony\Component\HttpFoundation\Request::HEADER_X_FORWARDED_HOST | \Symfony\Component\HttpFoundation\Request::HEADER_X_FORWARDED_PORT | \Symfony\Component\HttpFoundation\Request::HEADER_X_FORWARDED_PROTO | \Symfony\Component\HttpFoundation\Request::HEADER_FORWARDED 399 | * @endcode 400 | * is not secure by default. The value should be set to only the specific 401 | * headers the reverse proxy uses. For example: 402 | * @code 403 | * \Symfony\Component\HttpFoundation\Request::HEADER_X_FORWARDED_FOR | \Symfony\Component\HttpFoundation\Request::HEADER_X_FORWARDED_HOST | \Symfony\Component\HttpFoundation\Request::HEADER_X_FORWARDED_PORT | \Symfony\Component\HttpFoundation\Request::HEADER_X_FORWARDED_PROTO 404 | * @endcode 405 | * This would trust the following headers: 406 | * - X_FORWARDED_FOR 407 | * - X_FORWARDED_HOST 408 | * - X_FORWARDED_PROTO 409 | * - X_FORWARDED_PORT 410 | * 411 | * @see \Symfony\Component\HttpFoundation\Request::HEADER_X_FORWARDED_FOR 412 | * @see \Symfony\Component\HttpFoundation\Request::HEADER_X_FORWARDED_HOST 413 | * @see \Symfony\Component\HttpFoundation\Request::HEADER_X_FORWARDED_PORT 414 | * @see \Symfony\Component\HttpFoundation\Request::HEADER_X_FORWARDED_PROTO 415 | * @see \Symfony\Component\HttpFoundation\Request::HEADER_FORWARDED 416 | * @see \Symfony\Component\HttpFoundation\Request::setTrustedProxies 417 | */ 418 | # $settings['reverse_proxy_trusted_headers'] = \Symfony\Component\HttpFoundation\Request::HEADER_X_FORWARDED_FOR | \Symfony\Component\HttpFoundation\Request::HEADER_X_FORWARDED_HOST | \Symfony\Component\HttpFoundation\Request::HEADER_X_FORWARDED_PORT | \Symfony\Component\HttpFoundation\Request::HEADER_X_FORWARDED_PROTO | \Symfony\Component\HttpFoundation\Request::HEADER_FORWARDED; 419 | 420 | 421 | /** 422 | * Page caching: 423 | * 424 | * By default, Drupal sends a "Vary: Cookie" HTTP header for anonymous page 425 | * views. This tells a HTTP proxy that it may return a page from its local 426 | * cache without contacting the web server, if the user sends the same Cookie 427 | * header as the user who originally requested the cached page. Without "Vary: 428 | * Cookie", authenticated users would also be served the anonymous page from 429 | * the cache. If the site has mostly anonymous users except a few known 430 | * editors/administrators, the Vary header can be omitted. This allows for 431 | * better caching in HTTP proxies (including reverse proxies), i.e. even if 432 | * clients send different cookies, they still get content served from the cache. 433 | * However, authenticated users should access the site directly (i.e. not use an 434 | * HTTP proxy, and bypass the reverse proxy if one is used) in order to avoid 435 | * getting cached pages from the proxy. 436 | */ 437 | # $settings['omit_vary_cookie'] = TRUE; 438 | 439 | 440 | /** 441 | * Cache TTL for client error (4xx) responses. 442 | * 443 | * Items cached per-URL tend to result in a large number of cache items, and 444 | * this can be problematic on 404 pages which by their nature are unbounded. A 445 | * fixed TTL can be set for these items, defaulting to one hour, so that cache 446 | * backends which do not support LRU can purge older entries. To disable caching 447 | * of client error responses set the value to 0. Currently applies only to 448 | * page_cache module. 449 | */ 450 | # $settings['cache_ttl_4xx'] = 3600; 451 | 452 | /** 453 | * Expiration of cached forms. 454 | * 455 | * Drupal's Form API stores details of forms in a cache and these entries are 456 | * kept for at least 6 hours by default. Expired entries are cleared by cron. 457 | * 458 | * @see \Drupal\Core\Form\FormCache::setCache() 459 | */ 460 | # $settings['form_cache_expiration'] = 21600; 461 | 462 | /** 463 | * Class Loader. 464 | * 465 | * If the APCu extension is detected, the classloader will be optimized to use 466 | * it. Set to FALSE to disable this. 467 | * 468 | * @see https://getcomposer.org/doc/articles/autoloader-optimization.md 469 | */ 470 | # $settings['class_loader_auto_detect'] = FALSE; 471 | 472 | /** 473 | * Authorized file system operations: 474 | * 475 | * The Update Manager module included with Drupal provides a mechanism for 476 | * site administrators to securely install missing updates for the site 477 | * directly through the web user interface. On securely-configured servers, 478 | * the Update manager will require the administrator to provide SSH or FTP 479 | * credentials before allowing the installation to proceed; this allows the 480 | * site to update the new files as the user who owns all the Drupal files, 481 | * instead of as the user the webserver is running as. On servers where the 482 | * webserver user is itself the owner of the Drupal files, the administrator 483 | * will not be prompted for SSH or FTP credentials (note that these server 484 | * setups are common on shared hosting, but are inherently insecure). 485 | * 486 | * Some sites might wish to disable the above functionality, and only update 487 | * the code directly via SSH or FTP themselves. This setting completely 488 | * disables all functionality related to these authorized file operations. 489 | * 490 | * @see https://www.drupal.org/node/244924 491 | * 492 | * Remove the leading hash signs to disable. 493 | */ 494 | # $settings['allow_authorize_operations'] = FALSE; 495 | 496 | /** 497 | * Default mode for directories and files written by Drupal. 498 | * 499 | * Value should be in PHP Octal Notation, with leading zero. 500 | */ 501 | # $settings['file_chmod_directory'] = 0775; 502 | # $settings['file_chmod_file'] = 0664; 503 | 504 | /** 505 | * Public file base URL: 506 | * 507 | * An alternative base URL to be used for serving public files. This must 508 | * include any leading directory path. 509 | * 510 | * A different value from the domain used by Drupal to be used for accessing 511 | * public files. This can be used for a simple CDN integration, or to improve 512 | * security by serving user-uploaded files from a different domain or subdomain 513 | * pointing to the same server. Do not include a trailing slash. 514 | */ 515 | # $settings['file_public_base_url'] = 'http://downloads.example.com/files'; 516 | 517 | /** 518 | * Public file path: 519 | * 520 | * A local file system path where public files will be stored. This directory 521 | * must exist and be writable by Drupal. This directory must be relative to 522 | * the Drupal installation directory and be accessible over the web. 523 | */ 524 | # $settings['file_public_path'] = 'sites/default/files'; 525 | 526 | /** 527 | * Private file path: 528 | * 529 | * A local file system path where private files will be stored. This directory 530 | * must be absolute, outside of the Drupal installation directory and not 531 | * accessible over the web. 532 | * 533 | * Note: Caches need to be cleared when this value is changed to make the 534 | * private:// stream wrapper available to the system. 535 | * 536 | * See https://www.drupal.org/documentation/modules/file for more information 537 | * about securing private files. 538 | */ 539 | # $settings['file_private_path'] = ''; 540 | 541 | /** 542 | * Temporary file path: 543 | * 544 | * A local file system path where temporary files will be stored. This directory 545 | * must be absolute, outside of the Drupal installation directory and not 546 | * accessible over the web. 547 | * 548 | * If this is not set, the default for the operating system will be used. 549 | * 550 | * @see \Drupal\Component\FileSystem\FileSystem::getOsTemporaryDirectory() 551 | */ 552 | # $settings['file_temp_path'] = '/tmp'; 553 | 554 | /** 555 | * Session write interval: 556 | * 557 | * Set the minimum interval between each session write to database. 558 | * For performance reasons it defaults to 180. 559 | */ 560 | # $settings['session_write_interval'] = 180; 561 | 562 | /** 563 | * String overrides: 564 | * 565 | * To override specific strings on your site with or without enabling the Locale 566 | * module, add an entry to this list. This functionality allows you to change 567 | * a small number of your site's default English language interface strings. 568 | * 569 | * Remove the leading hash signs to enable. 570 | * 571 | * The "en" part of the variable name, is dynamic and can be any langcode of 572 | * any added language. (eg locale_custom_strings_de for german). 573 | */ 574 | # $settings['locale_custom_strings_en'][''] = [ 575 | # 'forum' => 'Discussion board', 576 | # '@count min' => '@count minutes', 577 | # ]; 578 | 579 | /** 580 | * A custom theme for the offline page: 581 | * 582 | * This applies when the site is explicitly set to maintenance mode through the 583 | * administration page or when the database is inactive due to an error. 584 | * The template file should also be copied into the theme. It is located inside 585 | * 'core/modules/system/templates/maintenance-page.html.twig'. 586 | * 587 | * Note: This setting does not apply to installation and update pages. 588 | */ 589 | # $settings['maintenance_theme'] = 'bartik'; 590 | 591 | /** 592 | * PHP settings: 593 | * 594 | * To see what PHP settings are possible, including whether they can be set at 595 | * runtime (by using ini_set()), read the PHP documentation: 596 | * http://php.net/manual/ini.list.php 597 | * See \Drupal\Core\DrupalKernel::bootEnvironment() for required runtime 598 | * settings and the .htaccess file for non-runtime settings. 599 | * Settings defined there should not be duplicated here so as to avoid conflict 600 | * issues. 601 | */ 602 | 603 | /** 604 | * If you encounter a situation where users post a large amount of text, and 605 | * the result is stripped out upon viewing but can still be edited, Drupal's 606 | * output filter may not have sufficient memory to process it. If you 607 | * experience this issue, you may wish to uncomment the following two lines 608 | * and increase the limits of these variables. For more information, see 609 | * http://php.net/manual/pcre.configuration.php. 610 | */ 611 | # ini_set('pcre.backtrack_limit', 200000); 612 | # ini_set('pcre.recursion_limit', 200000); 613 | 614 | /** 615 | * Add Permissions-Policy header to disable Google FLoC. 616 | * 617 | * By default, Drupal sends the 'Permissions-Policy: interest-cohort=()' header 618 | * to disable Google's Federated Learning of Cohorts feature, introduced in 619 | * Chrome 89. 620 | * 621 | * See https://en.wikipedia.org/wiki/Federated_Learning_of_Cohorts for more 622 | * information about FLoC. 623 | * 624 | * If you don't wish to disable FLoC in Chrome, you can set this value 625 | * to FALSE. 626 | */ 627 | # $settings['block_interest_cohort'] = TRUE; 628 | 629 | /** 630 | * Configuration overrides. 631 | * 632 | * To globally override specific configuration values for this site, 633 | * set them here. You usually don't need to use this feature. This is 634 | * useful in a configuration file for a vhost or directory, rather than 635 | * the default settings.php. 636 | * 637 | * Note that any values you provide in these variable overrides will not be 638 | * viewable from the Drupal administration interface. The administration 639 | * interface displays the values stored in configuration so that you can stage 640 | * changes to other environments that don't have the overrides. 641 | * 642 | * There are particular configuration values that are risky to override. For 643 | * example, overriding the list of installed modules in 'core.extension' is not 644 | * supported as module install or uninstall has not occurred. Other examples 645 | * include field storage configuration, because it has effects on database 646 | * structure, and 'core.menu.static_menu_link_overrides' since this is cached in 647 | * a way that is not config override aware. Also, note that changing 648 | * configuration values in settings.php will not fire any of the configuration 649 | * change events. 650 | */ 651 | # $config['system.site']['name'] = 'My Drupal site'; 652 | # $config['user.settings']['anonymous'] = 'Visitor'; 653 | 654 | /** 655 | * Fast 404 pages: 656 | * 657 | * Drupal can generate fully themed 404 pages. However, some of these responses 658 | * are for images or other resource files that are not displayed to the user. 659 | * This can waste bandwidth, and also generate server load. 660 | * 661 | * The options below return a simple, fast 404 page for URLs matching a 662 | * specific pattern: 663 | * - $config['system.performance']['fast_404']['exclude_paths']: A regular 664 | * expression to match paths to exclude, such as images generated by image 665 | * styles, or dynamically-resized images. The default pattern provided below 666 | * also excludes the private file system. If you need to add more paths, you 667 | * can add '|path' to the expression. 668 | * - $config['system.performance']['fast_404']['paths']: A regular expression to 669 | * match paths that should return a simple 404 page, rather than the fully 670 | * themed 404 page. If you don't have any aliases ending in htm or html you 671 | * can add '|s?html?' to the expression. 672 | * - $config['system.performance']['fast_404']['html']: The html to return for 673 | * simple 404 pages. 674 | * 675 | * Remove the leading hash signs if you would like to alter this functionality. 676 | */ 677 | # $config['system.performance']['fast_404']['exclude_paths'] = '/\/(?:styles)|(?:system\/files)\//'; 678 | # $config['system.performance']['fast_404']['paths'] = '/\.(?:txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; 679 | # $config['system.performance']['fast_404']['html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; 680 | 681 | /** 682 | * Load services definition file. 683 | */ 684 | $settings['container_yamls'][] = $app_root . '/' . $site_path . '/services.yml'; 685 | 686 | /** 687 | * Override the default service container class. 688 | * 689 | * This is useful for example to trace the service container for performance 690 | * tracking purposes, for testing a service container with an error condition or 691 | * to test a service container that throws an exception. 692 | */ 693 | # $settings['container_base_class'] = '\Drupal\Core\DependencyInjection\Container'; 694 | 695 | /** 696 | * Override the default yaml parser class. 697 | * 698 | * Provide a fully qualified class name here if you would like to provide an 699 | * alternate implementation YAML parser. The class must implement the 700 | * \Drupal\Component\Serialization\SerializationInterface interface. 701 | */ 702 | # $settings['yaml_parser_class'] = NULL; 703 | 704 | /** 705 | * Trusted host configuration. 706 | * 707 | * Drupal core can use the Symfony trusted host mechanism to prevent HTTP Host 708 | * header spoofing. 709 | * 710 | * To enable the trusted host mechanism, you enable your allowable hosts 711 | * in $settings['trusted_host_patterns']. This should be an array of regular 712 | * expression patterns, without delimiters, representing the hosts you would 713 | * like to allow. 714 | * 715 | * For example: 716 | * @code 717 | * $settings['trusted_host_patterns'] = [ 718 | * '^www\.example\.com$', 719 | * ]; 720 | * @endcode 721 | * will allow the site to only run from www.example.com. 722 | * 723 | * If you are running multisite, or if you are running your site from 724 | * different domain names (eg, you don't redirect http://www.example.com to 725 | * http://example.com), you should specify all of the host patterns that are 726 | * allowed by your site. 727 | * 728 | * For example: 729 | * @code 730 | * $settings['trusted_host_patterns'] = [ 731 | * '^example\.com$', 732 | * '^.+\.example\.com$', 733 | * '^example\.org$', 734 | * '^.+\.example\.org$', 735 | * ]; 736 | * @endcode 737 | * will allow the site to run off of all variants of example.com and 738 | * example.org, with all subdomains included. 739 | */ 740 | 741 | /** 742 | * The default list of directories that will be ignored by Drupal's file API. 743 | * 744 | * By default ignore node_modules and bower_components folders to avoid issues 745 | * with common frontend tools and recursive scanning of directories looking for 746 | * extensions. 747 | * 748 | * @see \Drupal\Core\File\FileSystemInterface::scanDirectory() 749 | * @see \Drupal\Core\Extension\ExtensionDiscovery::scanDirectory() 750 | */ 751 | $settings['file_scan_ignore_directories'] = [ 752 | 'node_modules', 753 | 'bower_components', 754 | ]; 755 | 756 | /** 757 | * The default number of entities to update in a batch process. 758 | * 759 | * This is used by update and post-update functions that need to go through and 760 | * change all the entities on a site, so it is useful to increase this number 761 | * if your hosting configuration (i.e. RAM allocation, CPU speed) allows for a 762 | * larger number of entities to be processed in a single batch run. 763 | */ 764 | $settings['entity_update_batch_size'] = 50; 765 | 766 | /** 767 | * Entity update backup. 768 | * 769 | * This is used to inform the entity storage handler that the backup tables as 770 | * well as the original entity type and field storage definitions should be 771 | * retained after a successful entity update process. 772 | */ 773 | $settings['entity_update_backup'] = TRUE; 774 | 775 | /** 776 | * Node migration type. 777 | * 778 | * This is used to force the migration system to use the classic node migrations 779 | * instead of the default complete node migrations. The migration system will 780 | * use the classic node migration only if there are existing migrate_map tables 781 | * for the classic node migrations and they contain data. These tables may not 782 | * exist if you are developing custom migrations and do not want to use the 783 | * complete node migrations. Set this to TRUE to force the use of the classic 784 | * node migrations. 785 | */ 786 | $settings['migrate_node_migrate_type_classic'] = FALSE; 787 | 788 | /** 789 | * Load local development override configuration, if available. 790 | * 791 | * Create a settings.local.php file to override variables on secondary (staging, 792 | * development, etc.) installations of this site. 793 | * 794 | * Typical uses of settings.local.php include: 795 | * - Disabling caching. 796 | * - Disabling JavaScript/CSS compression. 797 | * - Rerouting outgoing emails. 798 | * 799 | * Keep this code block at the end of this file to take full effect. 800 | */ 801 | # 802 | # if (file_exists($app_root . '/' . $site_path . '/settings.local.php')) { 803 | # include $app_root . '/' . $site_path . '/settings.local.php'; 804 | # } 805 | $databases['default']['default'] = [ 806 | 'database' => 'db', 807 | 'username' => 'db', 808 | 'password' => 'db', 809 | 'prefix' => '', 810 | 'host' => 'db', 811 | 'port' => '', 812 | 'namespace' => 'Drupal\\Core\\Database\\Driver\\mysql', 813 | 'driver' => 'mysql', 814 | ]; 815 | 816 | # Comment in, if in need of a migration db: 817 | 818 | // $databases['migrate']['default'] = [ 819 | // 'database' => 'migrate', 820 | // 'username' => 'db', 821 | // 'password' => 'db', 822 | // 'prefix' => '', 823 | // 'host' => 'ddev-my-project-migration-db', 824 | // 'port' => '3306', 825 | // 'driver' => 'mysql', 826 | // ]; 827 | 828 | // ----------------------------- Directories: ------------------------------ 829 | // Public directory path: 830 | $settings['file_public_path'] = 'sites/default/files'; 831 | 832 | // Private directory path: 833 | $settings['file_private_path'] = '../files/private'; 834 | 835 | // Temp directory path: 836 | $settings["file_temp_path"] = "../tmp"; 837 | 838 | // Sync directory path: 839 | $settings['config_sync_directory'] = '../files/sync'; 840 | 841 | // ----------------------------- Environment indicator ------------------------ 842 | if(!empty($_SERVER['HTTP_HOST'])){ 843 | // Only use on webserver, not bash: 844 | if(strpos($_SERVER['HTTP_HOST'], 'dev')){ 845 | // DEV: 846 | $settings['simple_environment_indicator'] = '#FF3300 @DEV #FFF'; 847 | } elseif (strpos($_SERVER['HTTP_HOST'], 'staging.') !== FALSE || strpos($_SERVER['HTTP_HOST'], 'preview.') !== FALSE){ 848 | // STAGING / PREVIEW: 849 | $config['environment_indicator.indicator']['bg_color'] = '#FFCC00'; 850 | $config['environment_indicator.indicator']['fg_color'] = '#000'; 851 | $config['environment_indicator.indicator']['name'] = '@PREVIEW'; 852 | 853 | } elseif (strpos($_SERVER['HTTP_HOST'], 'demo.') !== FALSE){ 854 | // DEMO: 855 | $config['environment_indicator.indicator']['bg_color'] = '#ff00a5'; 856 | $config['environment_indicator.indicator']['fg_color'] = '#FFF'; 857 | $config['environment_indicator.indicator']['name'] = '@DEMO'; 858 | } elseif (strpos($_SERVER['HTTP_HOST'], 'vorlage.') !== FALSE){ 859 | // VORLAGE: 860 | $config['environment_indicator.indicator']['bg_color'] = '#83B53E'; 861 | $config['environment_indicator.indicator']['fg_color'] = '#FFF'; 862 | $config['environment_indicator.indicator']['name'] = '@VORLAGE'; 863 | } else { 864 | // LIVE 865 | $config['environment_indicator.indicator']['bg_color'] = '#327EBD'; 866 | $config['environment_indicator.indicator']['fg_color'] = '#FFF'; 867 | $config['environment_indicator.indicator']['name'] = '@LIVE'; 868 | } 869 | } 870 | 871 | /** 872 | * Load local development override configuration, if available. 873 | * 874 | * Create a settings.local.php file to override variables on secondary (staging, 875 | * development, etc.) installations of this site. 876 | * 877 | * Typical uses of settings.local.php include: 878 | * - Disabling caching. 879 | * - Disabling JavaScript/CSS compression. 880 | * - Rerouting outgoing emails. 881 | * 882 | * Keep this code block at the end of this file to take full effect. 883 | */ 884 | 885 | if (file_exists($app_root . '/' . $site_path . '/settings.local.php')) { 886 | include $app_root . '/' . $site_path . '/settings.local.php'; 887 | } 888 | -------------------------------------------------------------------------------- /.ddev/mysql/maxTimeOut.cnf: -------------------------------------------------------------------------------- 1 | [mysqld] 2 | wait_timeout = 31536000 3 | net_read_timeout = 9999 4 | net_write_timeout = 9999 5 | interactive_timeout = 9999 6 | connect_timeout = 9999 7 | max_allowed_packet = 512M 8 | innodb_lock_wait_timeout = 9999 9 | -------------------------------------------------------------------------------- /.ddev/nginx_full/README.nginx_full.txt: -------------------------------------------------------------------------------- 1 | #ddev-generated 2 | The .ddev/nginx_full directory contains a generated nginx-site.conf file 3 | for the specific project type chosen in .ddev/config.yaml. 4 | which handles most projects on ddev, including those with multiple 5 | hostnames, etc. 6 | 7 | However, if you have very specific needs for configuration, you can edit 8 | the nginx-site.conf file and remove the #ddev-generated line in it and change 9 | as you see fit. Use `ddev start` to restart. 10 | 11 | You can also add more configurations, for example with separate configurations 12 | for each site, as demonstrated by the second_docroot.conf.example, which shows 13 | how to have nginx serve completely different configurations for a named site 14 | that is different from the default. 15 | -------------------------------------------------------------------------------- /.ddev/nginx_full/nginx-site.conf: -------------------------------------------------------------------------------- 1 | # ddev drupal9 config 2 | 3 | #ddev-generated 4 | # If you want to take over this file and customize it, remove the line above 5 | # and ddev will respect it and won't overwrite the file. 6 | # See https://ddev.readthedocs.io/en/stable/users/extend/customization-extendibility/#providing-custom-nginx-configuration 7 | 8 | server { 9 | listen 80 default_server; 10 | listen 443 ssl default_server; 11 | 12 | root /var/www/html/web; 13 | 14 | ssl_certificate /etc/ssl/certs/master.crt; 15 | ssl_certificate_key /etc/ssl/certs/master.key; 16 | 17 | include /etc/nginx/monitoring.conf; 18 | 19 | index index.php index.htm index.html; 20 | 21 | # Disable sendfile as per https://docs.vagrantup.com/v2/synced-folders/virtualbox.html 22 | sendfile off; 23 | error_log /dev/stdout info; 24 | access_log /var/log/nginx/access.log; 25 | 26 | location / { 27 | absolute_redirect off; 28 | try_files $uri $uri/ /index.php?$query_string; # For Drupal >= 7 29 | } 30 | 31 | location @rewrite { 32 | # For D7 and above: 33 | # Clean URLs are handled in drupal_environment_initialize(). 34 | rewrite ^ /index.php; 35 | } 36 | 37 | # Handle image styles for Drupal 7+ 38 | location ~ ^/sites/.*/files/styles/ { 39 | try_files $uri @rewrite; 40 | } 41 | 42 | # pass the PHP scripts to FastCGI server listening on socket 43 | location ~ '\.php$|^/update.php' { 44 | fastcgi_split_path_info ^(.+\.php)(/.+)$; 45 | fastcgi_pass unix:/run/php-fpm.sock; 46 | fastcgi_buffers 16 16k; 47 | fastcgi_buffer_size 32k; 48 | fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 49 | fastcgi_param SCRIPT_NAME $fastcgi_script_name; 50 | fastcgi_index index.php; 51 | include fastcgi_params; 52 | fastcgi_intercept_errors off; 53 | # fastcgi_read_timeout should match max_execution_time in php.ini 54 | fastcgi_read_timeout 10m; 55 | fastcgi_param SERVER_NAME $host; 56 | fastcgi_param HTTPS $fcgi_https; 57 | } 58 | 59 | # Expire rules for static content 60 | 61 | # Prevent clients from accessing hidden files (starting with a dot) 62 | # This is particularly important if you store .htpasswd files in the site hierarchy 63 | # Access to `/.well-known/` is allowed. 64 | # https://www.mnot.net/blog/2010/04/07/well-known 65 | # https://tools.ietf.org/html/rfc5785 66 | location ~* /\.(?!well-known\/) { 67 | deny all; 68 | } 69 | 70 | # Prevent clients from accessing to backup/config/source files 71 | location ~* (?:\.(?:bak|conf|dist|fla|in[ci]|log|psd|sh|sql|sw[op])|~)$ { 72 | deny all; 73 | } 74 | 75 | ## Regular private file serving (i.e. handled by Drupal). 76 | location ^~ /system/files/ { 77 | ## For not signaling a 404 in the error log whenever the 78 | ## system/files directory is accessed add the line below. 79 | ## Note that the 404 is the intended behavior. 80 | log_not_found off; 81 | access_log off; 82 | expires 30d; 83 | try_files $uri @rewrite; 84 | } 85 | 86 | # Media: images, icons, video, audio, HTC 87 | location ~* \.(png|jpg|jpeg|gif|ico|svg)$ { 88 | try_files $uri @rewrite; 89 | expires max; 90 | log_not_found off; 91 | } 92 | 93 | # js and css always loaded 94 | location ~* \.(js|css)$ { 95 | try_files $uri @rewrite; 96 | expires -1; 97 | log_not_found off; 98 | } 99 | 100 | include /etc/nginx/common.d/*.conf; 101 | include /mnt/ddev_config/nginx/*.conf; 102 | } 103 | -------------------------------------------------------------------------------- /.ddev/nginx_full/seconddocroot.conf.example: -------------------------------------------------------------------------------- 1 | # Example configuration for a second docroot 2 | 3 | #ddev-generated 4 | # If you want to take over this file and customize it, rename it to .conf, 5 | # and remove the ddev-generated line above 6 | 7 | server { 8 | # Set the docroot to where it belongs in the codebase 9 | root /var/www/html/seconddocroot; 10 | # Set the server_name so this config can be selected 11 | # You'll need additional_hostnames["seconddocroot"] in config.yaml for this to work 12 | server_name seconddocroot.ddev.site; 13 | 14 | listen 80; 15 | listen 443 ssl; 16 | 17 | ssl_certificate /etc/ssl/certs/master.crt; 18 | ssl_certificate_key /etc/ssl/certs/master.key; 19 | 20 | include /etc/nginx/monitoring.conf; 21 | 22 | index index.php index.htm index.html; 23 | 24 | # Disable sendfile as per https://docs.vagrantup.com/v2/synced-folders/virtualbox.html 25 | sendfile off; 26 | error_log /dev/stdout info; 27 | access_log /var/log/nginx/access.log; 28 | 29 | location / { 30 | absolute_redirect off; 31 | try_files $uri $uri/ /index.php?$query_string; 32 | } 33 | 34 | location @rewrite { 35 | # For D7 and above: 36 | # Clean URLs are handled in drupal_environment_initialize(). 37 | rewrite ^ /index.php; 38 | } 39 | 40 | # pass the PHP scripts to FastCGI server listening on socket 41 | location ~ \.php$ { 42 | try_files $uri =404; 43 | fastcgi_split_path_info ^(.+\.php)(/.+)$; 44 | fastcgi_pass unix:/run/php-fpm.sock; 45 | fastcgi_buffers 16 16k; 46 | fastcgi_buffer_size 32k; 47 | fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 48 | fastcgi_param SCRIPT_NAME $fastcgi_script_name; 49 | fastcgi_index index.php; 50 | include fastcgi_params; 51 | fastcgi_intercept_errors off; 52 | # fastcgi_read_timeout should match max_execution_time in php.ini 53 | fastcgi_read_timeout 10m; 54 | fastcgi_param SERVER_NAME $host; 55 | fastcgi_param HTTPS $fcgi_https; 56 | } 57 | 58 | # Expire rules for static content 59 | # Media: images, icons, video, audio, HTC 60 | location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|ogg|ogv|webm|htc)$ { 61 | expires 1M; 62 | access_log off; 63 | add_header Cache-Control "public"; 64 | } 65 | 66 | # Prevent clients from accessing hidden files (starting with a dot) 67 | # This is particularly important if you store .htpasswd files in the site hierarchy 68 | # Access to `/.well-known/` is allowed. 69 | # https://www.mnot.net/blog/2010/04/07/well-known 70 | # https://tools.ietf.org/html/rfc5785 71 | location ~* /\.(?!well-known\/) { 72 | deny all; 73 | } 74 | 75 | # Prevent clients from accessing to backup/config/source files 76 | location ~* (?:\.(?:bak|conf|dist|fla|in[ci]|log|psd|sh|sql|sw[op])|~)$ { 77 | deny all; 78 | } 79 | 80 | include /etc/nginx/common.d/*.conf; 81 | include /mnt/ddev_config/nginx/*.conf; 82 | } 83 | -------------------------------------------------------------------------------- /.ddev/php/apc_cache.ini: -------------------------------------------------------------------------------- 1 | [PHP] 2 | # This is used, to prevent composer class autoloader to load file paths statically, see https://github.com/drud/ddev/issues/3840 3 | apc.enabled = 0 4 | -------------------------------------------------------------------------------- /.ddev/php/timeOut.ini: -------------------------------------------------------------------------------- 1 | [PHP] 2 | mysql.connect_timeout = 9999 3 | mysql.allow_persistent = 1 4 | default_socket_timeout = 9999 5 | max_execution_time = 9999 6 | max_input_time = 9999 7 | -------------------------------------------------------------------------------- /.ddev/php/xdebug.ini: -------------------------------------------------------------------------------- 1 | [XDEBUG] 2 | xdebug.mode = debug,coverage 3 | xdebug.var_display_max_children = 128 4 | xdebug.var_display_max_data = 512 5 | xdebug.var_display_max_depth = 3 6 | -------------------------------------------------------------------------------- /.ddev/providers/README.txt: -------------------------------------------------------------------------------- 1 | Providers README 2 | ================ 3 | 4 | ## Introduction to Hosting Provider Integration 5 | 6 | As of DDEV-Local v1.17, the hosting provider integration has been completely rewritten and reorganized, and integrations for Platform.sh and Acquia hosting have been added to the previous integration for Pantheon.io. 7 | 8 | The best part of this is you can change them and adapt them in any way you need to, they're all short scripted recipes. There are several example recipes created in the .ddev/providers directory of every project or see them in the code at https://github.com/drud/ddev/tree/master/cmd/ddev/cmd/dotddev_assets/providers. 9 | 10 | ddev provides the `pull` command with whatever recipes you have configured. For example, `ddev pull acquia` if you have created `.ddev/providers/acquia.yaml`. 11 | 12 | ddev also provides the `push` command to push database and files to upstream. This is very dangerous to your upstream site and should only be used with extreme caution. It's recommended not even to implement the push stanzas in your yaml file, but if it fits your workflow, use it well. 13 | 14 | Each provider recipe is a yaml file that can be named any way you want to name it. The examples are mostly named after the hosting providers, but they could be named "upstream.yaml" or "live.yaml", so you could `ddev pull upstream` or `ddev pull live`. If you wanted different upstream environments to pull from, you could name one "prod" and one "dev" and `ddev pull prod` and `ddev pull dev`. 15 | 16 | Several example recipes are at https://github.com/drud/ddev/tree/master/cmd/ddev/cmd/dotddev_assets/providers and in this directory. 17 | 18 | Each provider recipe is a file named `.yaml` and consists of several mostly-optional stanzas: 19 | 20 | * `environment_variables`: Environment variables will be created in the web container for each of these during pull or push operations. They're used to provide context (project id, environment name, etc.) for each of the other stanzas. 21 | * `db_pull_command`: A script that determines how ddev should pull a database. It's job is to create a gzipped database dump in /var/www/html/.ddev/.downloads/db.sql.gz. 22 | * `files_pull_command`: A script that determines how ddev can get user-generated files from upstream. Its job is to copy the files from upstream to /var/www/html/.ddev/.downloads/files. 23 | * `db_push_command`: A script that determines how ddev should push a database. It's job is to take a gzipped database dump from /var/www/html/.ddev/.downloads/db.sql.gz and load it on the hosting provider. 24 | * `files_pull_command`: A script that determines how ddev push user-generated files to upstream. Its job is to copy the files from the project's user-files directory ($DDEV_FILES_DIR) to the correct place on the upstream provider. 25 | 26 | The environment variables provided to custom commands (see https://ddev.readthedocs.io/en/stable/users/extend/custom-commands/#environment-variables-provided) are also available for use in these recipes. 27 | 28 | ### Provider Debugging 29 | 30 | You can uncomment the `set -x` in each stanza to see more of what's going on. It really helps. 31 | 32 | Although the various commands could be executed on the host or in other containers if configured that way, most commands are executed in the web container. So the best thing to do is to `ddev ssh` and manually execute each command you want to use. When you have it right, use it in the yaml file. 33 | -------------------------------------------------------------------------------- /.ddev/providers/acquia.yaml.example: -------------------------------------------------------------------------------- 1 | #ddev-generated 2 | # Example Acquia provider configuration. 3 | 4 | # To use this configuration, 5 | 6 | # 1. Get your Acquia API token from your Account Settings->API Tokens. 7 | # 2. Make sure your ssh key is authorized on your Acquia account at Account Settings->SSH Keys 8 | # 3. `ddev auth ssh` (this typically needs only be done once per ddev session, not every pull.) 9 | # 4. Add / update the web_environment section in ~/.ddev/global_config.yaml with the API keys: 10 | # ```yaml 11 | # web_environment: 12 | # - ACQUIA_API_KEY=xxxxxxxx 13 | # - ACQUIA_API_SECRET=xxxxx 14 | # ``` 15 | # 5. Copy .ddev/providers/acquia.yaml.example to .ddev/providers/acquia.yaml. 16 | # 6. Update the project_id corresponding to the environment you want to work with. 17 | # - If have acli install, you can use the following command: `acli remote:aliases:list` 18 | # - Or, on the Acquia Cloud Platform navigate to the environments page, click on the header and look for the "SSH URL" line. Eg. `project1.dev@cool-projects.acquia-sites.com` would have a project ID of `project1.dev` 19 | # 7. Your project must include drush; `ddev composer require drush/drush` if it isn't there already. 20 | # 8. `ddev restart` 21 | # 9. Use `ddev pull acquia` to pull the project database and files. 22 | # 10. Optionally use `ddev push acquia` to push local files and database to Aquia. Note that `ddev push` is a command that can potentially damage your production site, so this is not recommended. 23 | 24 | # Debugging: Use `ddev exec acli command` and `ddev exec acli auth:login` 25 | # Make sure you remembered to `ddev auth ssh` 26 | 27 | environment_variables: 28 | project_id: yourproject.dev 29 | 30 | auth_command: 31 | command: | 32 | set -eu -o pipefail 33 | if [ -z "${ACQUIA_API_KEY:-}" ] || [ -z "${ACQUIA_API_SECRET:-}" ]; then echo "Please make sure you have set ACQUIA_API_KEY and ACQUIA_API_SECRET in ~/.ddev/global_config.yaml" && exit 1; fi 34 | if ! command -v drush >/dev/null ; then echo "Please make sure your project contains drush, ddev composer require drush/drush" && exit 1; fi 35 | ssh-add -l >/dev/null || ( echo "Please 'ddev auth ssh' before running this command." && exit 1 ) 36 | acli auth:login -n --key="${ACQUIA_API_KEY}" --secret="${ACQUIA_API_SECRET}" 37 | acli remote:aliases:download -n >/dev/null 38 | 39 | db_pull_command: 40 | command: | 41 | # set -x # You can enable bash debugging output by uncommenting 42 | set -eu -o pipefail 43 | ls /var/www/html/.ddev >/dev/null # This just refreshes stale NFS if possible 44 | pushd /var/www/html/.ddev/.downloads >/dev/null 45 | drush @${project_id} sql-dump -n --alias-path=~/.drush --extra-dump=--no-tablespaces --gzip >db.sql.gz 46 | 47 | files_pull_command: 48 | command: | 49 | # set -x # You can enable bash debugging output by uncommenting 50 | set -eu -o pipefail 51 | ls /var/www/html/.ddev >/dev/null # This just refreshes stale NFS if possible 52 | pushd /var/www/html/.ddev/.downloads >/dev/null; 53 | drush -r docroot rsync --exclude-paths='styles:css:js' --alias-path=~/.drush -q -y @${project_id}:%files ./files 54 | 55 | # push is a dangerous command. If not absolutely needed it's better to delete these lines. 56 | db_push_command: 57 | command: | 58 | # set -x # You can enable bash debugging output by uncommenting 59 | set -eu -o pipefail 60 | ls /var/www/html/.ddev >/dev/null # This just refreshes stale NFS if possible 61 | pushd /var/www/html/.ddev/.downloads >/dev/null; 62 | acli remote:drush -n ${project_id} -- sql-drop -y 63 | gzip -dc db.sql.gz | acli remote:drush -n ${project_id} -- sql-cli 64 | acli remote:drush -n ${project_id} -- cr 65 | 66 | # push is a dangerous command. If not absolutely needed it's better to delete these lines. 67 | files_push_command: 68 | command: | 69 | # set -x # You can enable bash debugging output by uncommenting 70 | set -eu -o pipefail 71 | ls ${DDEV_FILES_DIR} >/dev/null # This just refreshes stale NFS if possible 72 | drush rsync -y --alias-path=~/.drush @self:%files @${project_id}:%files 73 | -------------------------------------------------------------------------------- /.ddev/providers/localfile.yaml.example: -------------------------------------------------------------------------------- 1 | #ddev-generated 2 | # Example local file provider configuration. 3 | 4 | # This will pull a database and files from an existing location, for example, 5 | # from a Dropbox location on disk 6 | 7 | # To use this configuration, 8 | # 1. You need a database dump and/or user-generated files tarball. 9 | # 2. Copy localfile.yaml.example to localfile.yaml. 10 | # 3. Change the copy commands as needed. 11 | # 4. Use `ddev pull localfile` to pull the project database and files. 12 | 13 | # In this example, db_pull_command is not used 14 | 15 | # Here db_import_command imports directly from the source location 16 | # instead of looking in .ddev/.downloads/files 17 | db_import_command: 18 | command: | 19 | set -eu -o pipefail 20 | echo $PATH 21 | ddev --version 22 | set -x 23 | gzip -dc ~/Dropbox/db.sql.gz | ddev mysql db 24 | service: host 25 | 26 | # In this example, files_pull_command is not used 27 | 28 | # files_import_command is an example of a custom importer 29 | # that directly untars the files into their appropriate destination 30 | files_import_command: 31 | command: | 32 | set -eu -o pipefail 33 | echo $PATH 34 | ddev --version 35 | set -x 36 | mkdir -p web/sites/default/files 37 | tar -zxf ~/Dropbox/files.tar.gz -C web/sites/default/files 38 | service: host 39 | -------------------------------------------------------------------------------- /.ddev/providers/pantheon.yaml.example: -------------------------------------------------------------------------------- 1 | #ddev-generated 2 | # Example Pantheon.io provider configuration. 3 | # This example is Drupal/drush oriented, 4 | # but can be adapted for other CMSs supported by Pantheon 5 | 6 | # To use this configuration: 7 | # 8 | # 1. Get your Pantheon.io machine token: 9 | # a. Login to your Pantheon Dashboard, and [Generate a Machine Token](https://pantheon.io/docs/machine-tokens/) for ddev to use. 10 | # b. Add the API token to the `web_environment` section in your global ddev configuration at ~/.ddev/global_config.yaml 11 | # 12 | # ``` 13 | # web_environment: 14 | # - TERMINUS_MACHINE_TOKEN=abcdeyourtoken 15 | # ``` 16 | # 17 | # 2. Choose a Pantheon site and environment you want to use with ddev. You can usually use the site name, but in some environments you may need the site uuid, which is the long 3rd component of your site dashboard URL. So if the site dashboard is at , the site ID is 009a2cda-2c22-4eee-8f9d-96f017321555. 18 | # 19 | # 3. On the pantheon dashboard, make sure that at least one backup has been created. (When you need to refresh what you pull, do a new backup.) 20 | # 21 | # 4. For `ddev push pantheon` sure your public ssh key is configured in Pantheon (Account->SSH Keys) 22 | # 23 | # 5. Check out project codebase from Pantheon. Enable the "Git Connection Mode" and use `git clone` to check out the code locally. 24 | # 25 | # 6. Configure the local checkout for ddev using `ddev config` 26 | # 27 | # 7. Verify that drush is installed in your project, `ddev composer require drush/drush` 28 | # 29 | # 8. In your project's .ddev/providers directory, copy pantheon.yaml.example to pantheon.yaml and edit the "project" under `environment_variables` (change it from `yourproject.dev`). If you want to use a different environment than "dev", change `dev` to the name of the environment. 30 | # 31 | # 9. If using Colima, may need to set an explicit nameserver in `~/.colima/default/colima.yaml` like `1.1.1.1`. If this configuration is changed, may also need to restart Colima. 32 | # 33 | # 10. `ddev restart` 34 | # 35 | # 11. Run `ddev pull pantheon`. The ddev environment will download the Pantheon database and files using terminus and will import the database and files into the ddev environment. You should now be able to access the project locally. 36 | # 37 | # 12. Optionally use `ddev push pantheon` to push local files and database to Pantheon. Note that `ddev push` is a command that can potentially damage your production site, so this is not recommended. 38 | # 39 | 40 | # Debugging: Use `ddev exec terminus auth:whoami` to see what terminus knows about 41 | # `ddev exec terminus site:list` will show available sites 42 | 43 | environment_variables: 44 | project: yourproject.dev 45 | 46 | auth_command: 47 | command: | 48 | set -eu -o pipefail 49 | if ! command -v drush >/dev/null ; then echo "Please make sure your project contains drush, ddev composer require drush/drush" && exit 1; fi 50 | if [ -z "${TERMINUS_MACHINE_TOKEN:-}" ]; then echo "Please make sure you have set TERMINUS_MACHINE_TOKEN in ~/.ddev/global_config.yaml" && exit 1; fi 51 | terminus auth:login --machine-token="${TERMINUS_MACHINE_TOKEN}" || ( echo "terminus auth login failed, check your TERMINUS_MACHINE_TOKEN" && exit 1 ) 52 | terminus aliases 2>/dev/null 53 | 54 | db_pull_command: 55 | command: | 56 | set -x # You can enable bash debugging output by uncommenting 57 | set -eu -o pipefail 58 | ls /var/www/html/.ddev >/dev/null # This just refreshes stale NFS if possible 59 | pushd /var/www/html/.ddev/.downloads >/dev/null 60 | terminus backup:get ${project} --element=db --to=db.sql.gz 61 | 62 | files_pull_command: 63 | command: | 64 | set -x # You can enable bash debugging output by uncommenting 65 | set -eu -o pipefail 66 | ls /var/www/html/.ddev >/dev/null # This just refreshes stale NFS if possible 67 | pushd /var/www/html/.ddev/.downloads >/dev/null; 68 | terminus backup:get ${project} --element=files --to=files.tgz 69 | mkdir -p files && tar --strip-components=1 -C files -zxf files.tgz 70 | 71 | # push is a dangerous command. If not absolutely needed it's better to delete these lines. 72 | db_push_command: 73 | command: | 74 | set -x # You can enable bash debugging output by uncommenting 75 | ssh-add -l >/dev/null || ( echo "Please 'ddev auth ssh' before running this command." && exit 1 ) 76 | set -eu -o pipefail 77 | ls /var/www/html/.ddev >/dev/null # This just refreshes stale NFS if possible 78 | pushd /var/www/html/.ddev/.downloads >/dev/null; 79 | terminus remote:drush ${project} -- sql-drop -y 80 | gzip -dc db.sql.gz | terminus remote:drush ${project} -- sql-cli 81 | 82 | # push is a dangerous command. If not absolutely needed it's better to delete these lines. 83 | files_push_command: 84 | command: | 85 | set -x # You can enable bash debugging output by uncommenting 86 | ssh-add -l >/dev/null || ( echo "Please 'ddev auth ssh' before running this command." && exit 1 ) 87 | set -eu -o pipefail 88 | ls ${DDEV_FILES_DIR} >/dev/null # This just refreshes stale NFS if possible 89 | drush rsync -y @self:%files @${project}:%files 90 | -------------------------------------------------------------------------------- /.ddev/providers/platform.yaml.example: -------------------------------------------------------------------------------- 1 | #ddev-generated 2 | # Example Platform.sh provider configuration. 3 | 4 | # To use this configuration, 5 | 6 | # 1. Check out the site from platform.sh and then configure it with `ddev config`. You'll want to use `ddev start` and make sure the basic functionality is working. 7 | # 2. Obtain and configure an API token. 8 | # a. Login to the Platform.sh Dashboard and go to Account->API Tokens to create an API token for ddev to use. 9 | # b. Add the API token to the `web_environment` section in your global ddev configuration at ~/.ddev/global_config.yaml: 10 | # ```yaml 11 | # web_environment: 12 | # - PLATFORMSH_CLI_TOKEN=abcdeyourtoken 13 | # ``` 14 | # 3. `ddev restart` 15 | # 4. Obtain your project id with `ddev exec platform`. The platform tool should show you all the information about your account and project. 16 | # 5. In your project's .ddev/providers directory, copy platform.yaml.example to platform.yaml and edit the `project_id` and `environment_name`. 17 | # 6. Run `ddev pull platform`. After you agree to the prompt, the current upstream database and files will be downloaded. 18 | # 7. Optionally use `ddev push platform` to push local files and database to platform.sh. Note that `ddev push` is a command that can potentially damage your production site, so this is not recommended. 19 | 20 | # Debugging: Use `ddev exec platform` to see what platform.sh knows about 21 | # your configuration and whether it's working correctly. 22 | 23 | environment_variables: 24 | project_id: yourproject 25 | environment: master 26 | 27 | auth_command: 28 | command: | 29 | set -eu -o pipefail 30 | if [ -z "${PLATFORMSH_CLI_TOKEN:-}" ]; then echo "Please make sure you have set PLATFORMSH_CLI_TOKEN in ~/.ddev/global_config.yaml" && exit 1; fi 31 | 32 | db_pull_command: 33 | command: | 34 | # set -x # You can enable bash debugging output by uncommenting 35 | set -eu -o pipefail 36 | ls /var/www/html/.ddev >/dev/null # This just refreshes stale NFS if possible 37 | platform db:dump --yes --gzip --file=/var/www/html/.ddev/.downloads/db.sql.gz --project="${project_id}" --environment="${environment}" 38 | 39 | files_pull_command: 40 | command: | 41 | # set -x # You can enable bash debugging output by uncommenting 42 | set -eu -o pipefail 43 | ls /var/www/html/.ddev >/dev/null # This just refreshes stale NFS if possible 44 | platform mount:download --yes --quiet --project="${project_id}" --environment="${environment}" --mount=web/sites/default/files --target=/var/www/html/.ddev/.downloads/files 45 | 46 | 47 | # push is a dangerous command. If not absolutely needed it's better to delete these lines. 48 | db_push_command: 49 | command: | 50 | # set -x # You can enable bash debugging output by uncommenting 51 | set -eu -o pipefail 52 | ls /var/www/html/.ddev >/dev/null # This just refreshes stale NFS if possible 53 | pushd /var/www/html/.ddev/.downloads >/dev/null; 54 | gzip -dc db.sql.gz | platform db:sql --project="${project_id}" --environment="${environment}" 55 | 56 | # push is a dangerous command. If not absolutely needed it's better to delete these lines. 57 | files_push_command: 58 | command: | 59 | # set -x # You can enable bash debugging output by uncommenting 60 | set -eu -o pipefail 61 | ls "${DDEV_FILES_DIR}" >/dev/null # This just refreshes stale NFS if possible 62 | platform mount:upload --yes --quiet --project="${project_id}" --environment="${environment}" --source="${DDEV_FILES_DIR}" --mount=web/sites/default/files 63 | -------------------------------------------------------------------------------- /.ddev/providers/rsync.yaml.example: -------------------------------------------------------------------------------- 1 | #ddev-generated 2 | # Example rsync provider configuration. 3 | 4 | # This will pull a database and files from a network location, for example, 5 | # server or other jumphost. It operates inside the web container and uses 6 | # ssh, so you need to `ddev auth ssh` first. 7 | 8 | # To use this configuration, 9 | # 10 | # 1. You need a database dump and/or user-generated files tarball that you 11 | # have access to somewhere on the internet 12 | # 2. Copy rsync.yaml.example to rsync.yaml (or name it as you see fit) 13 | # 3. `ddev auth ssh` (only needs to be done once per ddev session or reboot) 14 | # 4. Use `ddev pull rsync` to pull the project database and files. 15 | # 5. `ddev push rsync` can push the project database and files 16 | 17 | # Note that while this is done in the web container (because rsync will always be there) 18 | # it could also be done on the host, and then you wouldn't need the 19 | # `ddev auth ssh` 20 | 21 | environment_variables: 22 | dburl: you@yourhost.example.com:tmp/db.sql.gz 23 | filesurl: you@yourhost.example.com:tmp/files.tar.gz 24 | 25 | auth_command: 26 | command: | 27 | set -eu -o pipefail 28 | ssh-add -l >/dev/null || ( echo "Please 'ddev auth ssh' before running this command." && exit 1 ) 29 | 30 | db_pull_command: 31 | command: | 32 | # set -x # You can enable bash debugging output by uncommenting 33 | set -eu -o pipefail 34 | rsync -az "${dburl}" /var/www/html/.ddev/.downloads/db.sql.gz 35 | service: web 36 | 37 | files_pull_command: 38 | command: | 39 | # set -x # You can enable bash debugging output by uncommenting 40 | set -eu -o pipefail 41 | ls /var/www/html/.ddev >/dev/null # This just refreshes stale NFS if possible 42 | pushd /var/www/html/.ddev/.downloads >/dev/null 43 | rm -f files.tar.gz 44 | rsync -avz "${filesurl}" . 45 | tar -xzf files.tar.gz -C files/ 46 | service: web 47 | 48 | # Pushing a database or files to upstream can be dangerous and not recommended. 49 | # This example is not very dangerous because it's not actually deploying the 50 | # files. But if the db were deployed on production it would overwrite 51 | # the current db or files there. 52 | db_push_command: 53 | command: | 54 | # set -x # You can enable bash debugging output by uncommenting 55 | set -eu -o pipefail 56 | ls /var/www/html/.ddev >/dev/null # This just refreshes stale NFS if possible 57 | mysqldump db | gzip >/var/www/html/.ddev/.downloads/db_push.sql.gz 58 | rsync -avz /var/www/html/.ddev/.downloads/db_push.sql.gz "${dburl}" 59 | 60 | files_push_command: 61 | command: | 62 | # set -x # You can enable bash debugging output by uncommenting 63 | set -eu -o pipefail 64 | rsync -az "${DDEV_FILES_DIR}/" "${filesurl}/" 65 | -------------------------------------------------------------------------------- /.ddev/web-build/Dockerfile.example: -------------------------------------------------------------------------------- 1 | 2 | #ddev-generated 3 | # You can copy this Dockerfile.example to Dockerfile to add configuration 4 | # or packages or anything else to your webimage 5 | # These additions will be appended last to ddev's own Dockerfile 6 | RUN npm install --global forever 7 | RUN echo "Built on $(date)" > /build-date.txt 8 | -------------------------------------------------------------------------------- /.ddev/xhprof/xhprof_prepend.php: -------------------------------------------------------------------------------- 1 | save_run($xhprof_data, $appNamespace); 38 | 39 | // Uncomment to append profile link to the page (and remove the ddev generated first line) 40 | // append_profile_link($run_id, $appNamespace); 41 | } 42 | 43 | // If invoked, this will append a profile link to the output HTML 44 | // This works on some CMSs, like Drupal 7. It does not work on Drupal8/9 45 | // and can have unwanted side-effects on TYPO3 46 | function append_profile_link($run_id, $appNamespace) 47 | { 48 | $base_link = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://$_SERVER[HTTP_HOST]/xhprof/"; 49 | 50 | $profiler_url = sprintf('%sindex.php?run=%s&source=%s', $base_link, $run_id, $appNamespace); 51 | echo ''; 52 | } 53 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore vendor and web 2 | /vendor/ 3 | /web/ 4 | 5 | # Ignore Drupal directories 6 | /web/modules/custom/ 7 | /web/themes/contrib/ 8 | /web/profiles/contrib/ 9 | /web/libraries/ 10 | /web/sites/simpletest/ 11 | 12 | # Ignore Drupal files 13 | /web/modules/README.txt 14 | /web/profiles/README.txt 15 | /web/sites/example.settings.local.php 16 | /web/sites/example.sites.php 17 | /web/sites/README.txt 18 | /web/themes/README.txt 19 | /web/example.gitignore 20 | /web/INSTALL.txt 21 | /web/LICENSE.txt 22 | /web/README.txt 23 | 24 | 25 | # Ignore configuration files that may contain sensitive information 26 | /web/sites/*/*settings*.php 27 | /web/sites/*/*services*.yml 28 | 29 | # Ignore paths that may contain user-generated content 30 | /web/sites/*/files 31 | /web/sites/*/public 32 | /web/sites/*/private 33 | /web/sites/*/files-public 34 | /web/sites/*/files-private 35 | 36 | # Ignore paths that may contain temporary files 37 | /web/sites/*/translations 38 | /web/sites/*/tmp 39 | /web/sites/*/cache 40 | 41 | # Ignore .env files as they are personal 42 | /.env 43 | 44 | # Ignore other configurations 45 | /.editorconfig 46 | /.gitattributes 47 | 48 | 49 | # Ignore IDE specific files 50 | /.history/ 51 | /.idea/ 52 | *.iml 53 | *.code-workspace 54 | 55 | # Ignore all log files 56 | *.log 57 | 58 | # Ignore node modules 59 | node_modules 60 | 61 | # Ignore css maps 62 | *.css.map 63 | 64 | # Ignore local db-dumps 65 | *.sql 66 | *.sql* 67 | 68 | # Ignore Packages 69 | *.7z 70 | *.dmg 71 | *.gz 72 | *.bz2 73 | *.iso 74 | *.jar 75 | *.rar 76 | *.tar 77 | *.zip 78 | *.tgz 79 | 80 | #ignore ddev composer files and generated .gitignore 81 | .ddev/.ddev-docker-compose-base.yaml 82 | .ddev/.ddev-docker-compose-full.yaml 83 | .ddev/.gitignore 84 | 85 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # DDEV Drupal Template With Attached VSCode 2 | The tools inside this repository will create a modified Drupal environment, focused on development and debugging. 3 | 4 | **DO NOT USE IN PRODUCTION - This is a local development tool!** 5 | ## Quick-Start 6 | **Spin up a ready-to-code Drupal 10/11 CMS DDEV based development container with preconfigured Drupal Best-Practice Dev-Modules and Visual Studio Code Settings/Extensions in three commands!** 🚀 7 | 8 | May take ~5 min - only needed once, at initialization. 9 | 10 | Quickly startup a **standard** dev environment using Drupal 11, meant to be used for testing and working on contrib modules / issues: 11 | ~~~ 12 | git clone https://github.com/webksde/ddev-vscode-devcontainer-drupal-template.git standard-vscode-drupal && cd standard-vscode-drupal && ddev drowl-init 13 | ~~~ 14 | or startup a **core** dev environment using gitified Drupal 11.x-dev, meant to be used for working on core issues: 15 | ~~~ 16 | git clone https://github.com/webksde/ddev-vscode-devcontainer-drupal-template.git core-vscode-drupal && cd core-vscode-drupal && ddev drowl-init-dev 17 | ~~~ 18 | Tips: 19 | - The name of the project ("standard-vscode-drupal" / "core-vscode-drupal") can be replaced with any project name of your liking. 20 | - **Note**, that: 21 | - Project names need to be **valid**. Valid project names are: "no-spaces-but-hyphens", "UpperAndLower", "should.work.with.dots". 22 | - The ddev containers will be generated based of your chosen name (e.g. "ddev-standard-vscode-drupal-web" when choosing "standard-vscode-drupal" as the project name). 23 | --- 24 | 25 | ## Features 26 | 27 | Provides a plug and play 🔌 DDEV (Docker) based development environment with attached VSCode 28 | - VS-Code Extensions 29 | - [Intelephense](https://marketplace.visualstudio.com/items?itemName=bmewburn.vscode-intelephense-client) 30 | - [PHP Debug (Using XDebug)](https://marketplace.visualstudio.com/items?itemName=xdebug.php-debug) 31 | - [PHP Getters & Setters](https://marketplace.visualstudio.com/items?itemName=cvergne.vscode-php-getters-setters-cv) 32 | - [PHP Namespace Resolver](https://marketplace.visualstudio.com/items?itemName=MehediDracula.php-namespace-resolver) 33 | - [PHP DocBlocker](https://marketplace.visualstudio.com/items?itemName=neilbrayfield.php-docblocker) 34 | - [PHPStan](https://marketplace.visualstudio.com/items?itemName=SanderRonde.phpstan-vscode) 35 | - [PHP Sniffer & Beautifier](https://marketplace.visualstudio.com/items?itemName=ValeryanM.vscode-phpsab) 36 | - [ESLint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint) 37 | - [Prettier](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode) 38 | - [CSpell](https://marketplace.visualstudio.com/items?itemName=streetsidesoftware.code-spell-checker) 39 | - [Twig Language 2](https://marketplace.visualstudio.com/items?itemName=mblode.twig-language-2) 40 | - [GitLens](https://marketplace.visualstudio.com/items?itemName=eamodio.gitlens) 41 | - [TODO Highlight](https://marketplace.visualstudio.com/items?itemName=wayou.vscode-todo-highlight) 42 | - [Apache Conf](https://marketplace.visualstudio.com/items?itemName=mrmlnc.vscode-apache) 43 | - [Composer](https://marketplace.visualstudio.com/items?itemName=DEVSENSE.composer-php-vscode) 44 | - [Peacock](https://marketplace.visualstudio.com/items?itemName=johnpapa.vscode-peacock) 45 | 46 | - VS-Code Launch configuration 47 | - Listen for XDebug 48 | 49 | - CLI-Tooling 50 | - [PHPUnit](https://phpunit.de/) 51 | - [PHPUnit Code-Coverage](https://phpunit.de/manual/6.5/en/code-coverage-analysis.html) 52 | - [PHPCS](https://github.com/squizlabs/PHP_CodeSniffer) 53 | - [PHPStan](https://phpstan.org/) 54 | - [XDebug](https://xdebug.org/) 55 | - [DDEV Tooling](https://ddev.readthedocs.io/en/stable/users/cli-usage/) 56 | - [ESLint](https://eslint.org/) 57 | 58 | - Drupal Development Modules 59 | - [Coder](https://www.drupal.org/project/coder) 60 | - [Devel](https://www.drupal.org/project/devel) 61 | - [Devel PHP](https://www.drupal.org/project/devel_php) 62 | - [Admin Toolbar](https://www.drupal.org/project/admin_toolbar) 63 | - [Backup Migrate](https://www.drupal.org/project/backup_migrate) 64 | - [Stage File Proxy](https://www.drupal.org/project/stage_file_proxy) 65 | - [Config Inspector](https://www.drupal.org/project/config_inspector) 66 | - [Examples](https://www.drupal.org/project/examples) 67 | - [Web Profiler](https://www.drupal.org/project/webprofiler) 68 | 69 | Beautifully packaged for easy project and environment switching. 70 | 71 | *Feel free to fork for other Frameworks or improve for lovely Drupal!* ❤️ 72 | 73 | --- 74 | 75 | ## Prerequisites 76 | 1. Up to date Version of DDEV, Docker, Chrome/Firefox 77 | 2. VSCode installed on your machine locally 78 | 3. The [Remote Development Extension for VSCode (extension name: ms-vscode-remote.vscode-remote-extensionpack)](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.vscode-remote-extensionpack) 79 | 4. (Optional) To debug inside the attached VS-Code instance, run `ddev config global --xdebug-ide-location=container` 80 | 1. Unfortunately, this option is only available globally, so you need to adjust your xdebug ide location, when working with other ddev instances, where VSCode is not attached to the web container (e.g., when running the IDE in wsl instead of a container run `ddev config global --xdebug-ide-location=wsl2`). 81 | 82 | --- 83 | 84 | ## How to use 85 | 1. Create a project folder and switch into it: `mkdir project-folder && cd project-folder` 86 | 2. Clone the repository into the just created folder: `git clone git@github.com:webksde/ddev-vscode-devcontainer-drupal-template.git .` 87 | 3. Use `ddev drowl-init` to directly start up the environment using Drupal 10 with VSCode / Drupal Best Practice Tools 88 | 4. You are ready to go! Use `ddev describe` to check the status & URLs of your Project and `ddev code` to run your prepared VSCode IDE! 89 | 1. Note, when inside the attached VSCode go to "Extensions" and type in "@recommended" to reveal all the necessary Extensions. Installing them is recommended! 90 | 91 | ## Typical Use-Cases: 92 | - Local Drupal development / testing / evaluation instance from scratch or existing with ready-to-go IDE 93 | - Module / Theme development or evaluation 94 | - Contrib module issue forks / merge requests / patch creation (Git clone / commit / push / ...) 95 | - Simple & quick Drupal 10 Sandbox for offline / local 96 | 97 | --- 98 | 99 | ## Documentation 100 | ### Tooling 101 | - Use `ddev code` to attach VSCode to your running Container. 102 | - Use `ddev phpunit path/to/tests` to Test Classes using PHPUnit. 103 | - Use `ddev phpunit-coverage path/to/cover` to create a test coverage of the given file-directory. 104 | - Use `ddev phpcs path/to/sniff` to check your Code using Drupal Coding Standards. 105 | - Use `ddev phpstan path/to/execute` to look for deprecated and 'dirty' code. 106 | - Use `ddev eslint path/to/sniff (--fix)` for linting / auto-fixing javascript code based on Drupal Coding Standards. 107 | - Use `ddev stylelint web/modules/custom/my_module` for linting css files based on Drupal Coding Standards. 108 | - Use `ddev xdebug on` to turn on xdebug, then in VSCode go to 'Run and Debug', 'Listen for XDebug' and open your Project in the Browser. 109 | - Use `ddev import-db --target-db=db --src=db.sql.gz` to import a database file. 110 | - Use `ddev drowl-reset-db` to reset the database to its state after initial startup. 111 | - Use `ddev dump-db ddev` to dump your main database tablewise. 112 | - Use `ddev deploy-db ddev` to import your tablewise dump. 113 | - Note: You can additionally add remote SSH projects under .ddev/commands/web/db-targets 114 | 115 | ### Delete the environment: 116 | 1. `ddev delete -y` deletes the container and unlists the project. 117 | 2. Delete the project folder 118 | 119 | ### Further ddev Tools and add-ons 120 | - https://github.com/drud/awesome-ddev 121 | - https://github.com/drud/ddev-contrib 122 | --- 123 | 124 | ## FAQ / Troubleshooting: 125 | ### *How do I install ddev?* 126 | 127 | - Install docker-ce inside Ubuntu / WSL: https://docs.docker.com/engine/install/ubuntu/#install-using-the-repository 128 | - Add DDEV to apt and install it: https://ddev.readthedocs.io/en/stable/users/install/ddev-installation/#debianubuntu 129 | - Run ddev -v, to see if it is installed correctly. 130 | 131 | ### *How do I update dddev?* 132 | 133 | You can always update ddev using `sudo apt update && sudo apt upgrade` inside your Ubuntu / WSL istance. 134 | 135 | ### *I can not execute the custom "ddev drowl-init" command* 136 | 137 | - Make sure you have the newest ddev and docker version and try restarting docker first. If the problem still persists, make sure you do not have two ddev projects with the same name! 138 | If there are no duplicate ddev projects, there might have been a ddev project with the same name in the past, which was not properly deleted using `ddev delete`. Check your Docker Container instances and delete the old Docker Cluster. 139 | - Project names need to be valid. Valid project names are: "no-spaces-but-hyphens", "UpperAndLower", "should.work.with.dots". Underscores are NOT allowed! 140 | - If all of this doesn't work, try running ddev start first, to see if that already throws any errors. Afterwards delete the project again using ddev delete, remove it and reininitate it again. 141 | 142 | ### *I can not reach any url from within the ddev container* 143 | 144 | - This is probably related to some internal dns problems. [This](https://stackoverflow.com/questions/78853210/not-able-to-resolve-any-hostnames-inside-docker-container-using-wsl-2-docker-ce/78853229#78853229) might help. 145 | ## Other 146 | **Special thanks to [Joachim](https://github.com/joachim-n) for creating https://github.com/joachim-n/drupal-core-development-project/, which helped us to make this project valid for work on drupal core issues.** 147 | --------------------------------------------------------------------------------