Can I manually say on xdebug profiler to start profiling in specific place?

后端 未结 2 1254
-上瘾入骨i
-上瘾入骨i 2020-12-24 01:17

I already have enabled xDebug profiling in my XAMPP installation and it works fine.

Now I like to ask if there is a way to say from within my source code when to sta

2条回答
  •  囚心锁ツ
    2020-12-24 01:56

    Edit: Per How to Turn On/Off Xdebug Profiling at Runtime? you can't actually enable/disable at runtime (for example per function call).

    You can selectively enable profiler per request, which is generally better. To achieve this behaviour set those settings:

    xdebug.profiler_enable_trigger=1
    xdebug.profiler_enable=0
    

    Note that we disable profiler and only enable the trigger. From your browser pass XDEBUG_PROFILE=1

    http://example.com/file.php?XDEBUG_PROFILE=1
    

    You may also pass this parameter in POST or COOKIE. For more info check

    1. http://xdebug.org/docs/profiler#starting
    2. http://xdebug.org/docs/all_settings#profiler_enable_trigger

提交回复
热议问题