Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Xdebug always enabled if XDEBUG_ENABLE has empty value [has PR] #1170

Closed
AlexSkrypnyk opened this issue Aug 8, 2019 · 2 comments
Closed

Comments

@AlexSkrypnyk
Copy link
Contributor

AlexSkrypnyk commented Aug 8, 2019

Describe the bug
Currently, the developer experience to enable Xdebug is to uncomment
the line XDEBUG_ENABLE: true in docker-compose.yml..

This is annoying and not possible to set this variable on host (and automate it) like so in docker-compose.yml:

XDEBUG_ENABLE: "${XDEBUG_ENABLE:-}"

This line
https://github.com/amazeeio/lagoon/blob/master/images/php/fpm/entrypoints/60-php-xdebug.sh#L29
uses if [ ${XDEBUG_ENABLE+x} ];, which evaluates to boolean true when XDEBUG_ENABLE env variable is set to empty.

Proposed solution
Change the condition to check if XDEBUG_ENABLE variable value is empty instead of checking if the value is set.

@AlexSkrypnyk AlexSkrypnyk changed the title Xdebug always enabled if XDEBUG_ENABLE has empty value Xdebug always enabled if XDEBUG_ENABLE has empty value [has PR] Aug 13, 2019
@AlexSkrypnyk
Copy link
Contributor Author

With PR merged now, it is possible to enable Xdebug like so XDEBUG_ENABLE=1 docker-compose build, provided that docker-compose.yml has this line:

x-environment:
  &default-environment
    XDEBUG_ENABLE: ${XDEBUG_ENABLE:-}

@AlexSkrypnyk
Copy link
Contributor Author

If using Ahoy, the workflow to enable/disable XDebug is now greatly simplified:
ahoy debug to enable; ahoy up to disable.

in .ahoy.yml:

commands:
  up:
    cmd: docker-compose up -d "$@"
  debug:
    cmd: XDEBUG_ENABLE=1 ahoy up

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant