ezsystems / launchpad

CLI tool to bootstrap an eZ Platform project Docker stack | #justcode
https://ezsystems.github.io/launchpad
MIT License
22 stars 27 forks source link

Support Xdebug? #39

Closed SalvatorePollaci closed 5 years ago

SalvatorePollaci commented 5 years ago
Q A
Bug report? no
Feature request? yes
BC Break report? no
RFC? no
Version x.y.z
Environment Linux/Mac/Windows

It would be very nice if eZ Launchpad supported xdebug.

Could this be implemented?

Plopix commented 5 years ago

@yhanini can you do a PR, also I would like more

To me xdebug can reduce performances, then I would love to be able to enable/disable it very easily. (using the provisionning/engine/php.ini + ez up => today in your code installation is triggered by the env var but installation could be in the image actually

XDEBUG_REMOTE_AUTOSTART and XDEBUG_REMOTE_CONNECT_BACK could be hardcode right? not sure if we should let then in the docker-compose file. same with XDEBUG_REMOTE_HOST is that the "host" then I think that could be automated.

=> actually I think all those value should be put in the php.ini we don't even need a script Those are just xdebug properties

To sum up:

At then end we should have the xdebug properties all setup in the provisionning/engine/php.ini (with xdebug disabled by default)

And to enable it, the procedure should be to just enable it in this provisionning/engine/php.ini and run ez up.

=> that is it!

kemoc commented 5 years ago

I ask to add more settings configurable by ENVs, my example xdebug settings without docker:

[xdebug]
xdebug.max_nesting_level = 500
xdebug.remote_autostart = 0
xdebug.remote_enable = 1
xdebug.remote_host = localhost
xdebug.remote_port = 9000
xdebug.idekey = "PHPStorm"
xdebug.profiler_enable_trigger = 1
; default cachegrind.out.%p
xdebug.profiler_output_name = cachegrind.out.%s
xdebug.profiler_output_dir = "/tmp/xdebug/profiler/output"
xdebug.trace_output_dir = "/tmp/xdebug/trace/output"
xdebug.remote_cookie_expire_time = 7200

so for me important are enable/disable Xdebug by Cookie or GET, for it will be needed in container XDEBUG_IDEKEY XDEBUG_REMOTE_ENABLE and xdebug.max_nesting_level should be configurable too, so XDEBUG_MAX_NESTING_LEVEL

kemoc commented 5 years ago

@Plopix

XDEBUG_REMOTE_AUTOSTART and XDEBUG_REMOTE_CONNECT_BACK could be hardcode right?

I did not understand what you mean hardcoded but for me XDEBUG_REMOTE_AUTOSTART must able to set value by .env and/or docker-compose.yml

yhanini commented 5 years ago

PR : https://github.com/ezsystems/launchpad/pull/43

Plopix commented 5 years ago

https://github.com/ezsystems/launchpad/pull/44/commits/857d991f1881b3bbe4a1163d367e858240eb57da

Plopix commented 5 years ago

enjoy ! https://github.com/ezsystems/launchpad/pull/44

Don't forget to get the last engine: docker pull plopix/docker-php-ez-engine:7.2

Plopix commented 5 years ago

@kemoc you can now do all the config that you want through the php.ini

SalvatorePollaci commented 5 years ago

Thank you. Great work!