-
Notifications
You must be signed in to change notification settings - Fork 4
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
Support XDebug on Linux #185
Conversation
Fixes #184 This changes from manually setting the XDEBUG_SESSION cookie and relying remote enabling in favour of setting the XDEBUG_CONFIG environment variable. This will ensure that the debugger connects every time and will handle setting the cookie itself. This also means XDebug can be used to debug CLI commands. Given that local server has 2 separate modes, with & without xdebug having it always be on in xdebug mode is worth the performance hit as developers can easily switch back.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Linting failed (2 errors).
I forgot that although the container is running PHP 7.2 the host machine where `PHP_OS_FAMILY` is in use might not be.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're a life saver, @roborourke !
The backport to
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub.
git fetch
# Create new working tree.
git worktree add .worktrees/backport v3-branch
# Navigate to the new directory.
cd .worktrees/backport
# Cherry-pick all the commits of this pull request and resolve the likely conflicts.
git cherry-pick 37a1a28565b7a028dc4bf7d895c3bd5f2704c47b 3ac5c5fe8129699599bfc140336140a54c06bdab 007fa5b4512b52a1d78e09af170bfb7b24fda9c0 5afaa32ecaa09b4f4d7d3a89c9c8cbaceeb52580 fed9436329628728a9a3e51a561f0e21f7892242 699c9d69d0ff61349d4fd2db202f8b23702e926b a36668d2209bc590ea88fbf0be06f2c2de11c390
# Create a new branch with these backported commits.
git checkout -b backport-185-to-v3-branch
# Push it to GitHub.
git push --set-upstream origin backport-185-to-v3-branch
# Go back to the original working tree.
cd ../..
# Delete the working tree.
git worktree remove .worktrees/backport Then, create a pull request where the |
The backport to
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub.
git fetch
# Create new working tree.
git worktree add .worktrees/backport v3-branch
# Navigate to the new directory.
cd .worktrees/backport
# Cherry-pick all the commits of this pull request and resolve the likely conflicts.
git cherry-pick 37a1a28565b7a028dc4bf7d895c3bd5f2704c47b 3ac5c5fe8129699599bfc140336140a54c06bdab 007fa5b4512b52a1d78e09af170bfb7b24fda9c0 5afaa32ecaa09b4f4d7d3a89c9c8cbaceeb52580 fed9436329628728a9a3e51a561f0e21f7892242 699c9d69d0ff61349d4fd2db202f8b23702e926b a36668d2209bc590ea88fbf0be06f2c2de11c390
# Create a new branch with these backported commits.
git checkout -b backport-185-to-v3-branch
# Push it to GitHub.
git push --set-upstream origin backport-185-to-v3-branch
# Go back to the original working tree.
cd ../..
# Delete the working tree.
git worktree remove .worktrees/backport Then, create a pull request where the |
The backport to
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub.
git fetch
# Create new working tree.
git worktree add .worktrees/backport v4-branch
# Navigate to the new directory.
cd .worktrees/backport
# Cherry-pick all the commits of this pull request and resolve the likely conflicts.
git cherry-pick 37a1a28565b7a028dc4bf7d895c3bd5f2704c47b 3ac5c5fe8129699599bfc140336140a54c06bdab 007fa5b4512b52a1d78e09af170bfb7b24fda9c0 5afaa32ecaa09b4f4d7d3a89c9c8cbaceeb52580 fed9436329628728a9a3e51a561f0e21f7892242 699c9d69d0ff61349d4fd2db202f8b23702e926b a36668d2209bc590ea88fbf0be06f2c2de11c390
# Create a new branch with these backported commits.
git checkout -b backport-185-to-v4-branch
# Push it to GitHub.
git push --set-upstream origin backport-185-to-v4-branch
# Go back to the original working tree.
cd ../..
# Delete the working tree.
git worktree remove .worktrees/backport Then, create a pull request where the |
Fixes #184
This update uses the
XDEBUG_CONFIG
environment variable to set two things:idekey
: this enables xdebug for every run of PHP and handles setting the cookie if not already presentremote_host
:host.docker.internal
is a special value for Windows and Mac only, Linux distros can use the static IP 172.17.0.1 to communicate with the host machineBecause xdebug is switched on or off by switching container I think its ok to run every time. This has the added benefit of being able to use xdebug with CLI commands.