ZF-11966: Problem with disabling cache in Zend_Locale

Description

Onece cache is set in Zend_Locale, it can't be disabled. A minimal code that reproduces the problem is here.

// Prepare for using a cache $cm = new Zend_Cache_manager(); $cache = $cm->getCache('default'); Zend_Locale::setCache($cache);

// Disabling the cache Zend_Locale::disableCache(true);

// Call one Zend_Locale method, which will not use the cache but still save a cache... Zend_Locale::getTranslationList('script');

My attached patch ensure that it disable cache a little more carefully.

BTW, in order to disable cache properly, use following code instead of Zend_Locale::disableCache(true).

Zend_Locale_Format::setOptions(array('disableCache' => true));

This is due to an internal option of Zend_Locale_Format which is not influenced by Zend_Locale::disableCache(). I'm not sure whether it is a bug or not. (It may be an architectural problem?)

Comments

No comments to display