Designing a tool for PHP debugging
EDIT: Like I said, Xdebug type responses are not really that helpful here. I've added some more info below:
I am planning on writing a small PHP debugging solution and would like to poll Stack Overflow for some ideas before I get started. The goal is to simplify debugging a PHP based web app.
The tool should be able to plug into an existing web app and to display and traverse a PHP backtrace. I'd probably implement it in PHP (and potentially with the help of some javascript). Some php functions that come to mind: set_error_handler() and debug_backtrace().
Generally the idea is a lightweight debugging tool that's easy to configure, doesn't require root on a dev box, and/or any of the other overhead associated with server side debuggers like xdebug.
Some of the things open for discussion may include:
- Nice to have functionality/features for a GUI that does this sort of thing.
- What are considerations when plugging in this tool into another app I might be developing? (for debugging purposes.
- Ideas on how the integration between the GUI and the app I want to debug.
I am open to other suggestions as well, li开发者_如何转开发ke, this has already been done, this is stupid, and why not just use xdebug/echo debugging. (Ok, maybe not really the last two, but depending on the quality of the response I might consider it :).
You could take a look at FirePHP, a plugin for FireFox's Firebug. Supposedly it can be used for debugging and tracing. I could be wrong - haven't used it yet.
It would be really nice to be able to dump arrays or objects to a logger at specified execution points (eg when returning from a method):
$your_tool->log_this_var("var_name" => "var", "log_at" => array("return_from" => "aMethod"));
And view them later:
foreach($var_log['saved_states'] as $key => $val): print_r($val);
Not sure why everyone is commenting this one instead of answering, with xdebug.org. There's no point in recreating the wheel with other frameworks out there for you to use. You could spend months on creating your own.
To meet your GUI needs, it's possible with 3rd party clients.
I'd give it or Zend a try before going it alone. Either one will likely do 95% of what you need. :)
精彩评论