任何著名的 PHP 调试器都提供记录堆栈遍历的方法吗? 假设我想以某种方式存储每个类、类方法和函数的每个进入/退出的日志。
有没有办法在服务器端完成这一切(也许某种明文客户端可以自动记录每个步入/步出)?
更新:如果使用 Xdebug,我似乎会寻找某种基于 PHP 的 DBGP 客户端。 到目前为止,我发现的唯一的东西是一个 CLI 客户端,我可以使用 PHP 间接访问它(假设 PHP 运行时用户有权访问): http://candyscript.com/projects/dbgp/
Do any of the well-known PHP debuggers offer any method of logging stack traversal? Say I wanted to somehow store a log of every entry/exit of every class, class method, and function.
Is there any way to do this all on the server side (maybe some sort of plaintext client that could log every step-in/step-out automatically)?
Update: It looks like I would be looking for some sort of PHP-based DBGP client if working with Xdebug. The only thing I've found so far is a CLI client that I can access indirectly with PHP (assuming the PHP runtime user has access): http://candyscript.com/projects/dbgp/
发布评论
评论(2)
我认为您所追求的可以使用 XDebug 与 KCachegrind(Linux/Unix) 或 WinCachegrind(Windows) 结合使用来实现。
我可能误解了你的问题,但要了解 KCachegrind 可以为你做什么,请看一下:
(来源:sourceforge.net)
右边你可以看到调用图。
I think what you're after can be achieved using XDebug in conjunction with KCachegrind(Linux/Unix) or WinCachegrind(Windows).
I might have misunderstood your question, but to get a glimpse of what KCachegrind can do for you have a look at this:
(source: sourceforge.net)
On the right you can see the call graph.
尝试xhprof,可用在 PECL 上,它可能会满足您的需要。
Try xhprof, available on PECL, it may do what you need.