ini-config for Zend_Cache_Frontend_Page

642 views Asked by At

How to configure Zend_Cache_Frontend_Page in application.ini? I cannot define regexps (see example http://framework.zend.com/manual/en/zend.cache.frontends.html#zend.cache.frontends.page.examples. It should be something like following

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

But it is a bad ini-file syntax, it fails with

Zend_Config_Exception: syntax error, unexpected '$'

1

There are 1 answers

0
Marcin On

Not sure you can do it. According to parse_ini_file manual: Characters ?{}|&~![()^" must not be used anywhere in the key and have a special meaning in the value. Notice that ^ is in the set of these characters.

However, what is interesting, when you remove $ from your key, and leave only ^/ you should not get any error. So it seems that the problem is only with $. But I don't know how to use it as a key in a ini file.

In this situation I would recommend setting regexps in your Bootsrap.php. You could define custom variables in application.ini, regexps should be allowed in values, and add them to cachemanager resource in your Bootsrap.php.