Skip to content

Set default start_with_request to yes and remove the "default" option#34

Open
carlos-granados wants to merge 2 commits intophp-debugger:mainfrom
carlos-granados:start_with_request_mode
Open

Set default start_with_request to yes and remove the "default" option#34
carlos-granados wants to merge 2 commits intophp-debugger:mainfrom
carlos-granados:start_with_request_mode

Conversation

@carlos-granados
Copy link
Copy Markdown
Collaborator

@carlos-granados carlos-granados commented Mar 29, 2026

  • Change the default value of "start_with_request" to "yes" so that by default the debugger always tries to connect
  • Remove the "default" value for xdebug.start_with_request configuration option as this only made sense when there were several modes for Xdebug
  • Simplify trigger checking logic by removing mode parameter dependencies since now there are not different modes
  • Clean up test suite by removing obsolete tests for the "default" option which has been removed

xdebug.c Outdated
#endif

static const char *xdebug_start_with_request_types[5] = { "", "default", "yes", "no", "trigger" };
static const char *xdebug_start_with_request_types[5] = { "", "yes", "no", "trigger" };
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should the size be 4?

src/lib/lib.c Outdated
Comment on lines 483 to 492
if (trigger_name) {
xdebug_log(XLOG_CHAN_CONFIG, XLOG_INFO, "Trigger value for 'XDEBUG_TRIGGER' not found, falling back to '%s'", trigger_name);
trigger_value = xdebug_lib_find_in_globals(trigger_name, &found_in_global);
}

/* Also try PHP_DEBUGGER_SESSION alias */
if (!trigger_value && XDEBUG_MODE_IS(XDEBUG_MODE_STEP_DEBUG) && (for_mode == XDEBUG_MODE_STEP_DEBUG)) {
if (!trigger_value) {
trigger_name = "PHP_DEBUGGER_SESSION";
trigger_value = xdebug_lib_find_in_globals(trigger_name, &found_in_global);
}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These conditions can be simplified as I undersand, because trigger_name is always set, right?

src/lib/lib.c Outdated
Comment on lines +538 to +540
/* Returns 1 if the mode is 'trigger', or 'default', where the default mode for
* a feature is to trigger. Does not check whether a trigger is present. */
int xdebug_lib_start_if_mode_is_trigger(int for_mode)
int xdebug_lib_start_if_mode_is_trigger()
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update comment

@carlos-granados carlos-granados requested a review from pronskiy April 2, 2026 17:02
@carlos-granados carlos-granados force-pushed the start_with_request_mode branch from fbdcf59 to 2f857a7 Compare April 4, 2026 21:41
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.

2 participants