*/
protected function _getExpireId()
{
- $id = array($GLOBALS['registry']->getVersion($this->_app));
- if ($this->_app != 'horde') {
- $id[] = $GLOBALS['registry']->getVersion('horde');
- }
+ switch ($GLOBALS['config']['themescacheparams']['check']) {
+ case 'appversion':
+ default:
+ $id = array($GLOBALS['registry']->getVersion($this->_app));
+ if ($this->_app != 'horde') {
+ $id[] = $GLOBALS['registry']->getVersion('horde');
+ }
+ return 'v:' . implode('|', $id);
- return 'v:' . implode('|', $id);
+ case 'none':
+ return '';
+ }
}
/* Serializable methods. */
$this->_theme
) = unserialize($data);
- if ($expire_id != $this->_getExpireId()) {
+ if ($expire_id && ($expire_id != $this->_getExpireId())) {
throw new Exception('Cache invalidated');
}
}
<case name="false" desc="No" />
<case name="true" desc="Yes">
<configsection name="cachethemesparams">
+ <configswitch name="check" desc="The method to use to check for updated
+ theme information.">appversion
+ <case name="appversion" desc="Application versions">
+ <configdescription>
+ The theme cache will be updated only when a new Horde version is
+ installed. This is the RECOMMENDED setting for most installations.
+ </configdescription>
+ </case>
+ <case name="none" desc="None">
+ <configdescription>
+ The theme cache is never checked for consistency. Once created, it
+ will be used until the cache entry expires.
+ </configdescription>
+ </case>
+ </configswitch>
<configinteger name="lifetime" desc="Lifetime of the cached files, in
seconds.">604800</configinteger>
</configsection>