drcvvkx914772 2011-05-04 13:09
浏览 33
已采纳

Zend Framework - displayExceptions属性不起作用

In my ZF project's application.ini, I've set "resources.frontController.params.displayExceptions = 1". However, if an exception is thrown, the exception isn't displayed in the browser.

Looking at the code in the generated ErrorController.php, it looks like the line that says:

if ($this->getInvokeArg('displayExceptions') == true)

always fails this condition.

I'm new to the ZF, so there's likely something obvious I'm missing - but I don't know why it's not being set. It does seem to be processing the application.ini file, as it would be failing to connect to my database if it wasn't.


EDIT

Just found a clue:

I had changed my modules directory. I've just undone that change, and this problem no longer occurs. However, I do actually want to change the modules directory. Here's a list of the changes I had made:

In my application.ini, I added:

resources.frontController.moduleDirectory = APPLICATION_PATH "/modules"

In my Bootstrap class, I added:

protected function _initFrontController()
{
    $front = Zend_Controller_Front::getInstance();
    $front->addModuleDirectory(dirname(__FILE__) . '/modules');
    $front->setDefaultModule('frontend');

    return $front;
}

This seems to successfully handle the module's new location and the site works fine (except that the displayExceptions flag isn't being set properly).

Any ideas why this would be causing this symptom?

  • 写回答

3条回答 默认 最新

  • dougan7523 2011-05-06 12:51
    关注

    Finally worked it out. My bootstrap initialisation was happening in the wrong order. I fixed it by completely removed this bootstrap method:

    protected function _initFrontController()
    {
        $front = Zend_Controller_Front::getInstance();
        $front->addModuleDirectory(dirname(__FILE__) . '/modules');
        $front->setDefaultModule('frontend');
    
        return $front;
    }
    

    And then instead putting the first three lines of it in the _initAutoLoad method above where I set my autoload settings.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 fluent的在模拟压强时使用希望得到一些建议
  • ¥15 STM32驱动继电器
  • ¥15 Windows server update services
  • ¥15 关于#c语言#的问题:我现在在做一个墨水屏设计,2.9英寸的小屏怎么换4.2英寸大屏
  • ¥15 模糊pid与pid仿真结果几乎一样
  • ¥15 java的GUI的运用
  • ¥15 Web.config连不上数据库
  • ¥15 我想付费需要AKM公司DSP开发资料及相关开发。
  • ¥15 怎么配置广告联盟瀑布流
  • ¥15 Rstudio 保存代码闪退