diff --git a/README.md b/README.md index c4e53c5..31f585f 100644 --- a/README.md +++ b/README.md @@ -6,12 +6,22 @@ ## What is ddev-phpmyadmin? -This add-on provides a phpMyAdmin service for [DDEV](https://github.com/ddev/ddev/). +This add-on provides a phpMyAdmin service for [DDEV](https://github.com/ddev/ddev/). -In DDEV v1.22+ phpMyAdmin will not be provided by default, but can be added with this add-on: +In DDEV v1.22+ phpMyAdmin is not provided by default, but it can be added with this add-on: -`ddev get ddev/ddev-phpmyadmin` +``` +ddev get ddev/ddev-phpmyadmin +ddev restart +``` -You can run phpMyAdmin easily with the command `ddev phpmyadmin` after installing this add-on. +You can run phpMyAdmin easily with the command after installing this add-on: + +``` +ddev phpmyadmin +``` + +> [!TIP] +> For Gitpod: The `ddev phpmyadmin` command can open a blank page in preview mode, open the link in a new browser tab/window to make it work. **Contributed and maintained by [@rfay](https://github.com/rfay)** diff --git a/commands/host/phpmyadmin b/commands/host/phpmyadmin index 6d1fdf8..f780468 100644 --- a/commands/host/phpmyadmin +++ b/commands/host/phpmyadmin @@ -8,8 +8,8 @@ DDEV_PHPMYADMIN_PORT=8036 DDEV_PHPMYADMIN_HTTPS_PORT=8037 -if [ ${DDEV_PRIMARY_URL%://*} = "https" ]; then - ddev launch $DDEV_PRIMARY_URL:$DDEV_PHPMYADMIN_HTTPS_PORT -else +if [ ${DDEV_PRIMARY_URL%://*} = "http" ] || [ -n "${GITPOD_WORKSPACE_ID:-}" ] || [ "${CODESPACES:-}" = "true" ]; then ddev launch $DDEV_PRIMARY_URL:$DDEV_PHPMYADMIN_PORT +else + ddev launch $DDEV_PRIMARY_URL:$DDEV_PHPMYADMIN_HTTPS_PORT fi diff --git a/docker-compose.phpmyadmin-norouter.yaml b/docker-compose.phpmyadmin_norouter.yaml similarity index 100% rename from docker-compose.phpmyadmin-norouter.yaml rename to docker-compose.phpmyadmin_norouter.yaml diff --git a/install.yaml b/install.yaml index b580ac9..781000d 100644 --- a/install.yaml +++ b/install.yaml @@ -4,7 +4,7 @@ name: phpmyadmin project_files: - docker-compose.phpmyadmin.yaml -- docker-compose.phpmyadmin-norouter.yaml +- docker-compose.phpmyadmin_norouter.yaml - commands/host/phpmyadmin pre_install_actions: @@ -19,7 +19,7 @@ post_install_actions: #ddev-description:If router disabled, directly expose port # if ( {{ contains "ddev-router" (list .DdevGlobalConfig.omit_containers | toString) }} ); then - printf "#ddev-generated\nservices:\n phpmyadmin:\n ports:\n - 8036:80\n" > docker-compose.phpmyadmin-norouter.yaml + printf "#ddev-generated\nservices:\n phpmyadmin:\n ports:\n - 8036:80\n" > docker-compose.phpmyadmin_norouter.yaml fi - | echo "You can now use 'ddev phpmyadmin' to launch PhpMyAdmin"