FirePHP: Tying together Firebug and PHP

FirePHP solves the problem of AJAX debugging by sending debug information along with the response. To avoid breaking the response content, the debug information is placed into special HTTP response headers.

This works for all types of requests, not just AJAX requests, which means you can even debug requests for images that are dynamically generated by a PHP script. You can use FirePHP in your development environment, or use it to track down bugs that only appear on your production site.This is what Christoph Dorn has to say about FirePHP in his recent writeup.He goes into detail on how you can setup the Firebug plugin, and how you use it from within PHP:


  1. // use an ini file to turn it on and off
  2. $settings = @parse_ini_file('settings.ini');
  3. if ($settings['FirePHP'] == 'Enabled') {
  4. FB::setEnabled(true);
  5. } else {
  6. FB::setEnabled(false);
  7. }
  8. // log away!
  9. FB::log('This is a log message');
  10. // selectively log
  11. if (Debug::getOption('DisableCache')) {
  12. // code to disable cache
  13. FB::info('Cache has been disabled!');
  14. } else {
  15. // default code
  16. }

Check out the article for more info.

In related news, Zend just stepped it up a notch with their new Zend Server that fits in nicely with the cloud

If you have better solution, just tell me !

0 comments: