【问题标题】:ini-config for Zend_Cache_Frontend_PageZend_Cache_Frontend_Page 的 ini-config
【发布时间】:2011-02-14 21:44:17
【问题描述】:

如何在 application.ini 中配置 Zend_Cache_Frontend_Page?我无法定义正则表达式(参见示例http://framework.zend.com/manual/en/zend.cache.frontends.html#zend.cache.frontends.page.examples。它应该类似于以下内容

resources.cachemanager.page.frontend.options.regexps.^/$.cache = true

但这是一个糟糕的ini文件语法,它失败了

Zend_Config_Exception:语法错误,意外的'$'

【问题讨论】:

  • 你可以试试resources.cachemanager.page.frontend.options.regexps['^/$'].cache = true。但根据 Marcin 的回答,我怀疑它会起作用。

标签: zend-framework zend-cache zend-config


【解决方案1】:

不确定你能做到。根据parse_ini_file 手册:Characters ?{}|&~![()^" must not be used anywhere in the key and have a special meaning in the value。请注意,^ 位于这些字符集中。

但是,有趣的是,当您从密钥中删除 $ 并仅留下 ^/ 时,您应该不会收到任何错误。所以看来问题只出在 $ 上。但我不知道如何将它用作 ini 文件中的键。

在这种情况下,我建议在您的 Bootsrap.php 中设置正则表达式。您可以在 application.ini 中定义自定义变量,值中应允许使用正则表达式,并将它们添加到 Bootsrap.php 中的 cachemanager 资源。

【讨论】:

    猜你喜欢
    • 2011-12-29
    • 2010-11-04
    • 1970-01-01
    • 2012-03-03
    • 2012-06-16
    • 2012-03-12
    • 1970-01-01
    • 2010-12-11
    • 1970-01-01
    相关资源
    最近更新 更多