GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Fix php_debugger.* INI aliases being silently ignored by pronskiy · Pull Request #32 · php-debugger/php-debugger

Conversation

@pronskiy

@pronskiy pronskiy commented Mar 24, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Problem

php_debugger.* INI aliases were silently ignored, and when both prefixes were set, ini_get("xdebug.*") did not reflect the php_debugger.* override.

Fixes #31

Changes

Fix alias detection during MINIT — entry->modified is always 0 during zend_register_ini_entries(). Added php_debugger_ini_is_explicitly_set() which falls back to zend_get_configuration_directive() for MINIT-stage detection.

Sync canonical entries — When a php_debugger.* alias is set, php_debugger_sync_canonical() updates the corresponding xdebug.* entry value directly, so ini_get("xdebug.foo") reflects the effective value.

php_debugger.* takes precedence — When both prefixes are set, the php_debugger.* value wins regardless of directive order.

Deduplicate wrappers — All 6 identical OnUpdatePhpDebugger* handlers replaced with a PHP_DEBUGGER_INI_WRAPPER macro.

Tests

  • ini_alias_client_host — DBGp session using only php_debugger.* prefix
  • ini_alias_idekey — php_debugger.idekey appears in DBGp init packet
  • ini_alias_precedence — php_debugger.* wins when set before xdebug.*
  • ini_alias_precedence_reverse — php_debugger.* wins when set after xdebug.*
  • ini_alias_precedence_ini_get — ini_get("xdebug.*") returns php_debugger.* values (mixed order)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@pronskiy
Fix php_debugger.* INI aliases being silently ignored
09738f9
The OnUpdatePhpDebugger* wrapper handlers used entry->modified to
decide whether to apply a value. During zend_register_ini_entries()
(MINIT stage), PHP always sets entry->modified=0 for newly registered
entries, even when the user explicitly set the value via -d or php.ini.
This caused all php_debugger.* settings to be silently ignored.

Replace the entry->modified check with a helper that also consults
zend_get_configuration_directive(), which correctly returns non-NULL
when the value was explicitly set.

Fixes #31
@pronskiy
pronskiy force-pushed the fix/ini-aliases branch 3 times, most recently from b33fc6b to 195202a Compare March 25, 2026 16:37
@pronskiy
Fix php_debugger.* INI aliases: sync canonical xdebug.* entries
6c5fa02
When php_debugger.* and xdebug.* are both set, php_debugger.* must
take precedence. The wrapper handlers already wrote to the correct
struct field, but ini_get("xdebug.foo") still returned the xdebug.*
value because each INI entry maintains its own value string.

Add php_debugger_sync_canonical() which directly updates the canonical
xdebug.* entry value string after a successful php_debugger.* update.
Uses zend_hash_find_ptr on EG(ini_directives) to avoid re-triggering
the canonical handler.

Three new tests verify precedence:
- ini_alias_precedence: php_debugger.* before xdebug.* in -d order
- ini_alias_precedence_reverse: xdebug.* before php_debugger.*
- ini_alias_precedence_ini_get: ini_get() reflects php_debugger.* values
  for both xdebug.* and php_debugger.* names (mixed INI order)
@pronskiy
pronskiy force-pushed the fix/ini-aliases branch from 195202a to 6c5fa02 Compare March 25, 2026 16:49
@pronskiy
pronskiy marked this pull request as ready for review March 25, 2026 16:54
@pronskiy
pronskiy requested a review from carlos-granados March 25, 2026 16:54
carlos-granados
carlos-granados reviewed Mar 25, 2026
View reviewed changes

@carlos-granados carlos-granados left a comment

Copy link
Copy Markdown
Collaborator

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.

Looks good and well tested, thanks @pronskiy

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

pronskiy reacted with heart emoji
All reactions
  • ❤️ 1 reaction
@pronskiy
pronskiy merged commit 52b9aba into main Mar 25, 2026
11 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@carlos-granados
carlos-granados deleted the fix/ini-aliases branch April 3, 2026 04:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@carlos-granados carlos-granados carlos-granados left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

php_debugger ini settings do not work

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@pronskiy @carlos-granados
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.