phpdebuggingzend-frameworkbreakpointszend-debugger

PHP debugging - where to set the breakpoints? How to authenticate?


So I've just recently made the step from ad hoc debugging with dump, print_r and echo to some more sophisticated methods and I'm having a struggle.

I work with Zend Framework, Aptana and Zend Debugger.

At this moment I'm trying to debug a custom controller and whatever I try I don't get to my breakpoint which I understand since there is authentication in between and using the menu.

Questions:

  1. How can I make my application break at the point of authentication, login in the browser, navigate to a certain uri and then continue debugging?
  2. What are good places to set breakpoints in Zend Framework with MVC?

Solution

  • You want to change the current user's authentication details mid-way through a request?

    I don't think this is possible. Zend Debugger is pretty much a read-only tool. Even if it were, you're assuming that whatever framework you're using can handle this. That would mean it would have to constantly try to synchronize it's internal state with changing input data.

    I think instead of asking us how to solve this specific problem, you should be telling us why you need to change authentication. It sounds like you're launching a script in your debugger, which fails because you have no user session.

    Zend Debugger has a browser toolbar (http://files.zend.com/help/Zend-Studio-Eclipse-Help/zend_debugger_toolbar.htm) that allows you to start a the debugger for your current page; the debugger will have all information that the browser would have sent: cookies, post data, etc. There's even a "debug next page" setting which helps you debug POST forms. It sounds like this is what you want.