如何获得通过的XDebug中的API调用堆栈追踪? [英] How to get a stack-trace via api-call in xdebug?
问题描述
我们正在使用的的XDebug 并跟踪工作code执行中所标榜的通过..
We are using xdebug and the tracing works as advertised during code execution via..
function someGetUsersHelper() {
xdebug_start_trace();
[SOME CODE HERE]
xdebug_stop_trace();
}
据但是,如果网页/脚本通过请求通过在浏览器中加载整个页面只执行跟踪code的包裹一部分
It however only traces the wrapped part of the code if the page/script is executed via loading the full page in the browser via requesting
index.php
但是,跟踪不工作,当我们调用函数通过API调用
index.php?api=getUsers
即使非常相同的功能执行成功,它不跟踪
Even though the very same function is executed successfully it does not trace.
作为一个额外的注意:跟踪也适用,如果函数是从PHPUnit的测试用例称为或者如果我们在php.ini设置xdebug.auto_trace = 1,但给我们留下了很长的,搞砸了跟踪文件
As an additional note: Tracing also works if the function is called from phpunit testcases or if we set xdebug.auto_trace = 1 in the php.ini, but that leaves us with a very long, messed up trace file.
所以,问题是这样的:
- 可能是什么问题/原因以及我们如何能够设法得到
通过调用API所需的清晰而简洁的痕迹?
非常感谢!
推荐答案
我不能说,为什么跟踪不工作。但你可以尝试这样的:
I could not say why the trace is not working. But you could try this:
- 添加选项
xdebug.trace_enable_trigger = 1
在PHP配置 - 现在,你可以通过添加启动了XDebug
XDEBUG_TRACE
为POST / GET参数或一个cookie
- Add the option
xdebug.trace_enable_trigger=1
in your php configuration - Now you could start a xdebug by adding
XDEBUG_TRACE
as POST/GET Parameter or as a cookie
还有一个Firefox插件叫做的易XDebug的的设置标志
There is also a Firefox Plugin called Easy XDebug to set the flags
这篇关于如何获得通过的XDebug中的API调用堆栈追踪?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!