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

[1.x] Switch from XDEBUG_SESSION to XDEBUG_TRIGGER for sail debug #675

Merged
merged 1 commit into from
Mar 4, 2024

Conversation

GregMayes
Copy link
Contributor

Background

XDEBUG_SESSION is described as a legacy trigger for step debugging in the Xdebug documentation. See the below excerpt from the section on xdebug.start_with_request for the trigger setting:

"The functionality only gets activated when a specific trigger is present when the request starts.

The name of the trigger is XDEBUG_TRIGGER, and Xdebug checks for its presence in either $_ENV (environment variable), $_GET or $_POST variable, or $_COOKIE (HTTP cookie name).

There is a legacy fallback to a functionality specific trigger name: XDEBUG_PROFILE (for Profiling), XDEBUG_TRACE (for a Function Trace), and XDEBUG_SESSION (for Step Debugging)."

Reasoning behind this change

By changing sail debug to use XDEBUG_TRIGGER=1, it'll be in-line with the recommended usage for Xdebug 3 and will be protected against any removal of these "legacy fallbacks".

Additionally, it will allow those using Xdebug profiler via sail to use it in trigger mode, as XDEBUG_TRIGGER works for the the profiler as well as the step debugger. XDEBUG_SESSION does not activate the profiler. To use the profiler via a trigger, you currently have to do something like sail bash -c "XDEBUG_TRIGGER=1 php artisan app:example", which is a bit clunky.

Breaking changes

There should be no breaking changes with this PR as XDEBUG_TRIGGER will activate the step debugger just like XDEBUG_SESSION does. All of the Sail PHP images are using Xdebug 3, so there shouldn't be an issue with some users still using Xdebug 2 via Sail.

@taylorotwell taylorotwell merged commit 4d4931b into laravel:1.x Mar 4, 2024
5 checks passed
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

Successfully merging this pull request may close these issues.

None yet

2 participants