zend 模块特定 ini 与 phpSettings.display_errors
一直在尝试覆盖我的 application/modules/module5/config/module.ini 中的 phpSettings.display_errors 。
我的 module5/Bootstrap.php 已
protected function _initModuleConfig() { $iniOptions = new Zend_Config_Ini(dirname(__FILE__) . '/configs/module.ini'); $this->getApplication()->setOptions($iniOptions->toArray()); }
正确解析文件,但 application.ini 中给出的 phpSettings 正在加载,而 module.ini 中给出的 phpSettings 则被忽略。
在我的应用程序/Bootstrap 上,我可以正确获取 $this->getAPplication() 。 php设置生效。当我在 application/modules/module5/Bootstrap.php 上时,我丢失了应用程序对象, getApplication() 返回 Bootstrap 而什么都不做,php 设置不会被激活。
Been trying to override the phpSettings.display_errors
from my application/modules/module5/config/module.ini.
My module5/Bootstrap.php has
protected function _initModuleConfig() { $iniOptions = new Zend_Config_Ini(dirname(__FILE__) . '/configs/module.ini'); $this->getApplication()->setOptions($iniOptions->toArray()); }
so the file is parsing properly but the the phpSettings given in application.ini are getting loaded while those given in module.ini are getting ignored.
While on my application/Bootstrap I can get $this->getAPplication() properly. php settings take effect. while Im on application/modules/module5/Bootstrap.php I loose the application object, getApplication() returns Bootstrap while does nothing, php settings don't get activated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
查看文件系统,您的
模块不应该.ini
文件位于模块的配置文件夹中,并称为application.ini
吗?Looking at the filesystem, shouldn't your
module.ini
file be in a config folder in your module and be calledapplication.ini
instead?嗯,我对应用程序了解不多,但在我看来,它作为一个 Bootstrap 对象并没有什么问题。看看我的转储,似乎 Zend_Application 实际上与它相关联。它似乎也有您正在寻找的详细信息:
我实际上不明白为什么您有问题,您将不得不给我们一些转储。
当我尝试它时它起作用了:
这是在我的布局中:
这是我的输出:
对我来说效果很好。
Meh, I don't know much about application, but there's nothing wrong with it being a Bootstrap object in my opinion. Looking at my dump it seems the Zend_Application is actually associated with it. It also seem to have the details you are looking for:
I actually don't get why you have a problem, you are going to have to give us some dumps.
It works when I try it:
This is in my layout:
This is my output:
Works fine for me.
假设您真正关心的是打开/关闭 php display_error 设置,您可能只想这样做:
因此,如果这对您不起作用,请从该命名的额外 ini 文件中删除 display_errors 设置中的所有行并在上述代码后添加以下行,然后在此处发布结果。
Assuming the thing you really care for is switching on/off the php display_error setting, you might just want to do this:
So if this doesn't work for you, delete all lines appart from your display_errors setting from that named, extra ini file and add the following lines after the code mentioned above and post the result here.