Support for xdebug in local development with docker#587
Support for xdebug in local development with docker#587ArgusKay99 wants to merge 3 commits intophparkitect:mainfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #587 +/- ##
=========================================
Coverage 98.12% 98.12%
Complexity 663 663
=========================================
Files 84 84
Lines 1923 1923
=========================================
Hits 1887 1887
Misses 36 36 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Hey @ArgusKay99, thanks for the PR! One thing I noticed — the PR installs xdebug 3.4.0 but the configuration uses remote_enable and remote_autostart, which I believe are Xdebug 2.x directives. In 3.x those should be silently ignored, so I'm wondering if the debugger would actually work as expected? |
- seperate xdebug-install and xdebug.ini so we can do fast experiments with the xdebug ini - remove deprecated xdebug2-options
|
Hey @fain182 , oh thanks for noticing. I fixed this. Debugging the unit-tests works fine. This is because apparently my ide did set all the correct environment variables. So as long xdebug is installed and configured in php.ini it will work.
Another Thing i noticed is that the tests can run and can be debugged, but will be shown as terminated. This seems to be the problem because the entrypoint is phparkitect (which i cannot change without destroying some workflows) so i'm unsure if it is smart to run xdebug in the same container? Out of curiosity how are you debugging php-arkitect? Maybe i'm just working "wrong". |


Feature Request
Summary
Can we add xdebug to the docker-container? I created a multi-stage Dockerfile that can be built with and without xdebug.
For context: I am developing on linux with Phpstorm and use the the Docker-container that is created in the CONTRIBUTING.md file as remote PHP interpreter and when there is a xdebug installed, i can already debug unit-tests.
I'm open to suggestions to use xdebug in another way.
BC Break for local development:
docker image build will now need a target:
docker image build --target php_build -t phparkitect .