ZF:在 application.ini 中禁用资源插件

发布于 2024-10-11 15:35:49 字数 723 浏览 4 评论 0原文

如何在 cli 环境中禁用缓存?

原因是执行脚本的系统用户不允许写入缓存目录,因此脚本无法执行。

在我的 application.ini 中,我有

[production]

resources.cachemanager.database.frontend.name = Core
resources.cachemanager.database.frontend.customFrontendNaming = false
resources.cachemanager.database.frontend.options.lifetime = 7200
resources.cachemanager.database.frontend.options.automatic_serialization = true
resources.cachemanager.database.backend.name = File
resources.cachemanager.database.backend.customBackendNaming = false
resources.cachemanager.database.backend.options.cache_dir = HTTPDOCS_PATH "/data/cache/database"
resources.cachemanager.database.frontendBackendAutoload = false

[cli : production]

*<]:-)

How can I disable cache in the cli enviroment?

Reason being, the system user that executes the script is not allowed to write to the cache directory, thus the script is unable to execute.

In my application.ini I have

[production]

resources.cachemanager.database.frontend.name = Core
resources.cachemanager.database.frontend.customFrontendNaming = false
resources.cachemanager.database.frontend.options.lifetime = 7200
resources.cachemanager.database.frontend.options.automatic_serialization = true
resources.cachemanager.database.backend.name = File
resources.cachemanager.database.backend.customBackendNaming = false
resources.cachemanager.database.backend.options.cache_dir = HTTPDOCS_PATH "/data/cache/database"
resources.cachemanager.database.frontendBackendAutoload = false

[cli : production]

*<]:-)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

‘画卷フ 2024-10-18 15:35:49

尝试

resources.cachemanager.database.frontend.options.caching = false

查看 APIZF 参考指南,适用于 Zend_Cache_Core$_options 属性代码>

Try

resources.cachemanager.database.frontend.options.caching = false

See the API and the ZF Reference Guide for the $_options property in Zend_Cache_Core

安静 2024-10-18 15:35:49

和您一样,我没有看到明显的方法来禁用在父部分中注册的配置部分中的插件。如果 Zend_Config_Ini 允许多重继承,就像 HTML 元素可以在 class 属性中使用多个 CSS 类一样,那就太酷了。 (是吗?我猜不是)。然后你可以将插件注册放入一个部分[myplugsection],允许[生产]扩展[myplug],而[cli ] 没有,有点像 Doctrine 的 actAs 模板和行为。

下一个最好的事情可能是创建一个名为 [core] 的部分,其中包含您现在在 [生产] 中拥有的大部分内容。 [product][cli] 都可以扩展 [core],但 [product] 会注册插件而 [cli] 则不会。

当然,另一种方法是将插件注册移动到 Bootstrap 中,您可以更好地控制插件注册。特别是,您可以调用 $front->unregisterPlugin(),其中 $frontFrontController

只是大声思考......

干杯!

Like you, I see no obvious way to disable a plugin in a config section that was registered in a parent section. It would be cool if Zend_Config_Ini allowed multiple inheritance, kind of like how an HTML element can multiple CSS classes in the class attribute. (Does it? I'm guessing not). Then you could put the plugin registration into one section [myplugsection], allow [production] to extend [myplug] while [cli] does not, kind of like how Doctrine has actAs templates and beahviors.

The next best thing might be to create a section called something like [core]containing most of what you now habe in [production]. Both [production] and [cli] could extend [core], but [production] would register the plugin while [cli] would not.

Of course, an alternative would be to could move the plugin registration into Bootstrap where you have finer control of the plugin registration. In particular, you can call $front->unregisterPlugin(), where $front is the FrontController.

Just thinking out loud...

Cheers!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文