perftools / php-profiler

A PHP profiling library based on XHGUI Data Collector
MIT License
147 stars 26 forks source link

Add example for profiler.enable with xdebug profiling enabled #58

Open glensc opened 3 years ago

glensc commented 3 years ago

This adds an example to Detect XDebug triggers and skip profiling:

See https://github.com/perftools/xhgui/issues/104#issuecomment-54754662

glensc commented 3 years ago

This needs to be validated first as xdebug_is_enabled() description in phpstorm stubs says "Return whether stack traces would be shown in case of an error or not"

glensc commented 3 years ago

Perhaps xdebug_info gives he accurate info:

➔ php -r "xdebug_info();"|grep -i xdebug.mode
xdebug.mode => develop => develop

which is just in value:

$ php -r 'var_dump(ini_get("xdebug.remote_autostart"));'
string(1) "0"