From c8f7d063d15b8758e81a02b56a310eebf0fb5d7b Mon Sep 17 00:00:00 2001
From: Oliver Davies <oliver@oliverdavies.uk>
Date: Tue, 8 Dec 2020 16:49:55 +0000
Subject: [PATCH] Update Composer in DDEV

---
 .ddev/config.yaml | 30 ++++++++++++++++++++----------
 1 file changed, 20 insertions(+), 10 deletions(-)

diff --git a/.ddev/config.yaml b/.ddev/config.yaml
index 606869d..ed2dfaa 100644
--- a/.ddev/config.yaml
+++ b/.ddev/config.yaml
@@ -8,24 +8,27 @@ router_https_port: "443"
 xdebug_enabled: false
 additional_hostnames: []
 additional_fqdns: []
+mariadb_version: "10.2"
+mysql_version: ""
 provider: default
 hooks:
-  post-start:
-  - exec: "[[ ! -f .flag-built ]] && composer install || exit 0"
-  - exec-host: "[[ ! -f .flag-built ]] && ddev theme development || exit 0"
   post-import-db:
   - exec: drush sql-sanitize -y --sanitize-password=password
   - exec: drush cr
   - exec: drush updb
+  post-start:
+  - exec: '[[ ! -f .flag-built ]] && composer install || exit 0'
+  - exec-host: '[[ ! -f .flag-built ]] && ddev theme development || exit 0'
 working_dir:
   web: /var/www/html
 use_dns_when_possible: true
+composer_version: "2"
 
 
-# This config.yaml was created with ddev version v1.15.3
-# webimage: drud/ddev-webserver:v1.15.3
-# dbimage: drud/ddev-dbserver-mariadb-10.2:v1.15.1
-# dbaimage: phpmyadmin/phpmyadmin:5
+# This config.yaml was created with ddev version v1.16.1
+# webimage: drud/ddev-webserver:v1.16.1
+# dbimage: drud/ddev-dbserver-mariadb-10.2:v1.16.0
+# dbaimage: phpmyadmin:5
 # However we do not recommend explicitly wiring these images into the
 # config.yaml as they may break future versions of ddev.
 # You can update this config.yaml using 'ddev config'.
@@ -39,7 +42,7 @@ use_dns_when_possible: true
 
 # docroot: <relative_path> # Relative path to the directory containing index.php.
 
-# php_version: "7.3"  # PHP version to use, "5.6", "7.0", "7.1", "7.2", "7.3", "7.4"
+# php_version: "7.3"  # PHP version to use, "5.6", "7.0", "7.1", "7.2", "7.3", "7.4" "8.0"
 
 # You can explicitly specify the webimage, dbimage, dbaimage lines but this
 # is not recommended, as the images are often closely tied to ddev's' behavior,
@@ -60,10 +63,10 @@ use_dns_when_possible: true
 
 # xdebug_enabled: false  # Set to true to enable xdebug and "ddev start" or "ddev restart"
 # Note that for most people the commands
-# "ddev exec enable_xdebug" and "ddev exec disable_xdebug" work better,
+# "ddev xdebug" to enable xdebug and "ddev xdebug off" to disable it work better,
 # as leaving xdebug enabled all the time is a big performance hit.
 
-# webserver_type: nginx-fpm  # Can be set to apache-fpm or apache-cgi as well
+# webserver_type: nginx-fpm  # or apache-fpm
 
 # timezone: Europe/Berlin
 # This is the timezone used in the containers and by PHP;
@@ -71,6 +74,13 @@ use_dns_when_possible: true
 # see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
 # For example Europe/Dublin or MST7MDT
 
+# composer_version: "2"
+# if composer_version:"" it will use the current ddev default composer release.
+# It can also be set to "1", to get most recent composer v1
+# or "2" for most recent composer v2.
+# It can be set to any existing specific composer version.
+# After first project 'ddev start' this will not be updated until it changes
+
 # additional_hostnames:
 #  - somename
 #  - someothername