View Issue Details

IDProjectCategoryView StatusLast Update
0001959XdebugUncategorizedpublic2021-03-21 21:08
ReporterJohnStevenson Assigned Toderick  
Status closedResolutionduplicate 
Summary0001959: Add a function to obtain xdebug.mode settings

Although it is possible to obtain the mode value in userland, it is quite cumbersome and possibly brittle (either parsing xdebug info, or checking XDEBUG_MODE and xdebug.mode ini settings then replicating xdebug's procedure for arriving at a value).

My personal use case is for my composer/xdebug-handler package, to not restart the process without xdebug if the mode is "off" - and for composer to not display a warning about xdebug being loaded in this situation. However I am sure that such a function would prove useful to others.

I have knocked up an example function and will PR it for your perusal.

TagsNo tags attached.
Operating System
PHP Version8.0.0-8.0.4


duplicate of 0001898 closedderick API for querying the currently active mode(s) 



2021-03-21 20:20

reporter   ~0005813

Example implementation:


2021-03-21 20:44

administrator   ~0005814

This is a duplicate of 0001898, which I'll implement for 3.1. I'm still pondering how to make this more useful than just returning a list of enabled modes though.


2021-03-21 21:08

reporter   ~0005815

Oh sorry (but I couldn't find anything on the Roadmap).

I wondered about doing a pathinfo-like implementation with constants (XDEBUG_MODE_OFF, XDEBUG_MODE_DEVELOP etc) for checking a mode returning boolean, otherwise an array containing the enabled modes. However this seemed quite complex when I guess folks just want to know if a feature (or what features) are enabled.

I'll keep an eye out for your implementation.

Issue History

Date Modified Username Field Change
2021-03-21 19:28 JohnStevenson New Issue
2021-03-21 20:20 JohnStevenson Note Added: 0005813
2021-03-21 20:44 derick Assigned To => derick
2021-03-21 20:44 derick Status new => closed
2021-03-21 20:44 derick Resolution open => duplicate
2021-03-21 20:44 derick Note Added: 0005814
2021-03-21 20:44 derick Relationship added duplicate of 0001898
2021-03-21 21:08 JohnStevenson Note Added: 0005815