ZF-10140: In Zend_Translate->setOptions, tries to set entire options array as cache object


If I add a cache object to my Zend_Translate options, like so:

$options = array('cache' => Zend_Cache::factory(...));

This leads to the following error:

Catchable fatal error: Argument 1 passed to Zend_Translate_Adapter::setCache() must be an instance of Zend_Cache_Core, array given, called in /usr/local/zend/share/ZendFramework/library/Zend/Translate/Adapter.php on line 335 and defined in /usr/local/zend/share/ZendFramework/library/Zend/Translate/Adapter.php on line 885

Looking in Translate/Adapter.php line 335, I found the problem:

if ($key == 'cache') {

I may be misunderstanding something, but you should be sending $option to setCache, not $options, which is the entire $options array.

If I change it to $option, everything works as expected.


I agree... you misunderstood :p

Fixed with r22554