Skip to content

Commit

Permalink
use true to activate xdebug
Browse files Browse the repository at this point in the history
  • Loading branch information
Toby Bellwood committed Jul 1, 2021
1 parent 11820f9 commit c36e635
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions images/php-cli/61-php-xdebug-cli-env.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/sh

# Only if XDEBUG_ENABLE is not empty
if [ ! -z ${XDEBUG_ENABLE} ]; then
# enable XDebug only if XDEBUG_ENABLE is set to true or TRUE or True
if expr "$XDEBUG_ENABLE" : '[Tt][Rr][Uu][Ee]' > /dev/null; then
# XDEBUG_CONFIG is used by xdebug to decide if an xdebug session should be started in the CLI or not.
# The content doesn't really matter it just needs to be set, the actual connection details are loaded from /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
export XDEBUG_CONFIG="idekey=lagoon"
Expand Down
6 changes: 3 additions & 3 deletions images/php-fpm/entrypoints/60-php-xdebug.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ get_dockerhost() {
return
}

# Only if XDEBUG_ENABLE is not empty
if [ ! -z ${XDEBUG_ENABLE} ]; then
# enable XDebug only if XDEBUG_ENABLE is set to true or TRUE or True
if expr "$XDEBUG_ENABLE" : '[Tt][Rr][Uu][Ee]' > /dev/null; then
# remove first line and all comments
sed -i '1d; s/;//' /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
# add comment that explains how we have xdebug enabled
sed -i '1s/^/;xdebug enabled as XDEBUG_ENABLE is not empty, see \/lagoon\/entrypoints\/60-php-xdebug.sh \n/' /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
sed -i '1s/^/;xdebug enabled as XDEBUG_ENABLE is set to true, see \/lagoon\/entrypoints\/60-php-xdebug.sh \n/' /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini

# Only if DOCKERHOST is not already set, allows to set a DOCKERHOST via environment variables
if [[ -z ${DOCKERHOST+x} ]]; then
Expand Down

0 comments on commit c36e635

Please sign in to comment.