ZFDebug没有调试栏

时间:2017-09-26 13:33:31

标签: php zend-framework

我正在使用ZF1并且刚安装了ZFDebug,但是当我进入网站时没有调试窗口。这是我用来初始化ZFDebug的函数

protected function _initZFDebug()
    {
        if (APPLICATION_ENV == 'testing')
        {
            $auth = Zend_Auth::getInstance();
            if ($auth->hasIdentity())
            {
                $identity = $auth->getIdentity();
                if ($identity->getRole() == 'admin')
                {
                $autoloader = Zend_Loader_Autoloader::getInstance();
                $autoloader->registerNamespace('ZFDebug_');

                $options = array(
                'plugins' => array(
                            'Variables',
                            'Database' => array(
                                'adapter' => Zend_Registry::get('db')
                            ),
                            'File' => array(
                                'basePath' => APPLICATION_PATH
                            ),
                            'Cache' => array(
                                'backend' => Zend_Registry::get('Cache')->getBackend()
                            ),
                            'Exception'
                        )
                );
                $debug = new ZFDebug_Controller_Plugin_Debug($options);
                $this->bootstrap('frontController');
                $frontController = $this->getResource('frontController');
                $frontController->registerPlugin($debug);
                }
            }
        }
    }

0 个答案:

没有答案