插件的名字叫ZFDebug-1.5
把zfdebug\library下面的文件夹ZFDebug拷贝到项目的library目录下面
写一个函数放在Bootstrap.php里面(适用于zend framework 1.8以上)
zfdebug官方下载地址:http://code.google.com/p/zfdebug/downloads/detail?name=ZFDebug-1.5.zip
打开页面有点久。
下面是函数
protected function _initZFDebug()
{
$autoloader = Zend_Loader_Autoloader::getInstance();
$autoloader->registerNamespace('ZFDebug');
$options = array(
'plugins' => array('Variables',
'File' => array('base_path' => APPLICATION_PATH),
'Memory',
'Time',
'Registry',
'Exception')
);
# Instantiate the database adapter and setup the plugin.
# Alternatively just add the plugin like above and rely on the autodiscovery feature.
if ($this->hasPluginResource('db')) {
$this->bootstrap('db');
$db = $this->getPluginResource('db')->getDbAdapter();
$options['plugins']['Database']['adapter'] = $db;
}
# Setup the cache plugin
if ($this->hasPluginResource('cache')) {
$this->bootstrap('cache');
$cache = $this-getPluginResource('cache')->getDbAdapter();
$options['plugins']['Cache']['backend'] = $cache->getBackend();
}
$debug = new ZFDebug_Controller_Plugin_Debug($options);
$this->bootstrap('frontController');
$frontController = $this->getResource('frontController');
$frontController->registerPlugin($debug);
}