Installing Zend framework debug bar

Zend framework debug bar is a useful and lightweight plugin. It will make the debugging tasks easier and less painful showing us information like:

  • Script running time
  • Memory usage
  • Variables ($_COOKIE, $_POST and $_SESSION)
  • SQL querys
  • Included files
  • Cache
  • Used databases
Zend Framework debug bar

Installation

Download the ZFDebug plugin. place the folder ‘ZFDebug‘ in your library path, next to the ‘Zend‘ folder. And add the following method to your bootstrap.php file:

protected function _initZFDebug()
{
    $autoloader = Zend_Loader_Autoloader::getInstance();
    $autoloader->registerNamespace('ZFDebug');

    $options = array(
        'plugins' => array('Variables',
                           'Database' => array('adapter' => $db),
                           'File' => array('basePath' => '/path/to/project'),
                           'Cache' => array('backend' => $cache->getBackend()),
                           'Exception')
    );
    $debug = new ZFDebug_Controller_Plugin_Debug($options);

    $this->bootstrap('frontController');
    $frontController = $this->getResource('frontController');
    $frontController->registerPlugin($debug);
}

Comments 1

  1. Pingback: Zend Debug toolbar | Lưu lại những kinh nghiệm lập trình web

Leave a Reply

Your email address will not be published. Required fields are marked *