简体   繁体   English

XDebug与Symfony2和Sublime Text

[英]XDebug with Symfony2 and Sublime Text

I am running a symfony2 webapp, and Im trying to use XDebug with Sublime Text 3, using this package but I am running with the problem that I need to manually write XDEBUG_SESSION_START in the URL for it to work. 我正在运行一个symfony2 webapp,我试图使用XDebug和Sublime Text 3,使用这个包但是我运行的问题是我需要在URL中手动编写XDEBUG_SESSION_START才能使用它。 Is there a way that Symfony could add this automatically, so I dont lose it in page transitions? 有没有一种Symfony可以自动添加它的方式,所以我不会在页面转换中丢失它?

php.ini

[xdebug]
zend_extension = "c:\Program Files (x86)\PHP5\ext\php_xdebug-2.2.2-5.3-vc9.dll"
xdebug.remote_enable = 1
xdebug.remote_host = "127.0.0.1"
xdebug.remote_port = 9000
xdebug.remote_handler = "dbgp"
xdebug.remote_mode = req
xdebug.remote_connect_back = 1
xdebug.profiler_enable = 1;

Yep, set it as a cookie. 是的,将其设置为cookie。 Here you can generate bookmarklets for setting / deleting the cookie: http://www.jetbrains.com/phpstorm/marklets/ 在这里,您可以生成用于设置/删除cookie的bookmarklet: http//www.jetbrains.com/phpstorm/marklets/

HTTP Debug Sessions HTTP调试会话

Xdebug contains functionality to keep track of a debug session when started through a browser: cookies. Xdebug包含通过浏览器启动时跟踪调试会话的功能:cookie。 This works like this: 这样工作如下:

When the URL variable XDEBUG_SESSION_START=name is appended to an URL Xdebug emits a cookie with the name "XDEBUG_SESSION" and as value the value of the XDEBUG_SESSION_START URL parameter. 当URL变量XDEBUG_SESSION_START = name附加到URL时,Xdebug会发出一个名为“XDEBUG_SESSION”的cookie,并将值作为XDEBUG_SESSION_START URL参数的值。 The expiry of the cookie is one hour. cookie的到期时间为一小时。 The DBGp protocol also passes this same value to the init packet when connecting to the debugclient in the "idekey" attribute. 当连接到“idekey”属性中的debugclient时,DBGp协议也将相同的值传递给init数据包。

When there is a GET (or POST) variable XDEBUG_SESSION_START or the XDEBUG_SESSION cookie is set, Xdebug will try to connect to a debugclient. 当存在GET(或POST)变量XDEBUG_SESSION_START或XDEBUG_SESSION cookie时,Xdebug将尝试连接到debugclient。

To stop a debug session (and to destroy the cookie) simply add the URL parameter XDEBUG_SESSION_STOP. 要停止调试会话(并销毁cookie),只需添加URL参数XDEBUG_SESSION_STOP。 Xdebug will then no longer try to make a connection to the debugclient. 然后,Xdebug将不再尝试建立与debugclient的连接。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM