ZF-11039: Problem using customBackendNaming with Zend_Cache_Manager
Description
You can't use Cache classes with customBackendNaming in the Zend_Cache_Manager because its getCache method calls Zend_Cache:factor without passing customFrontendNaming and customBackendNaming parameters. It should be
$this->_caches[$name] = Zend_Cache::factory( $this->_optionTemplates[$name]['frontend']['name'], $this->_optionTemplates[$name]['backend']['name'], isset($this->_optionTemplates[$name]['frontend']['options']) ? $this->_optionTemplates[$name]['frontend']['options'] : array(), isset($this->_optionTemplates[$name]['backend']['options']) ? $this->_optionTemplates[$name]['backend']['options'] : array(), isset($this->_optionTemplates[$name]['frontend']['customFontendNaming']) ? $this->_optionTemplates[$name]['frontend']['customFontendNaming'] : false , isset($this->_optionTemplates[$name]['backend']['customBackendNaming']) ? $this->_optionTemplates[$name]['backend']['customBackendNaming'] : false );
This allow you to configure the cache in application.ini like
resources.cachemanager.config.backend.name=Zend_Cache_Backend_ZendServer_ShMem resources.cachemanager.config.backend.customBackendNaming=true
A ready made temple for the ZendServer backends would be even better, allowing you to do just resources.cachemanager.config.backend.name=ZendServer_ShMem
Comments
Posted by Ramon Henrique Ornelas (ramon) on 2011-02-05T22:03:18.000+0000
@bill Not was described no information essential to reproduce bug. I see this issue but how an improvement.
Greetings Ramon
Posted by Frederik Eychenie (feychenie) on 2011-02-27T16:56:35.000+0000
Using customBackendNaming or customFrontendNaming with cachamanager works in 1.11.3. Update your ZF !
If someone could close this issue..
Posted by Markus Perl (_mex_) on 2011-03-29T08:49:45.000+0000
The bug still exists in 1.11.4.
The parameters customFrontendNaming and customBackendNaming are still ignored in the _mergeOptions Method in the Zend_Cache_Manager class.
To fix this issue, i had to add the following lines in this method:
Posted by Renan de Lima (renanbr) on 2011-05-26T15:03:55.000+0000
a solution for this problem (it solve my problem), it needs tests for others situations
Posted by Alex Barnes (abarnes) on 2011-09-16T08:51:30.000+0000
I can confirm this bug still exists in 1.11.9 and that Markus's fix above works.
To replicate if you are using Zend Server (CE or standard) add the following to your application.ini:
On a side note if the file Zend/Cache/Backend/ZendServer/ShMem.php was renamed to Shmem.php I would guess we wouldn't need to set the customBackendNaming on Linux environments? Not tested