ZF-11966: Problem with disabling cache in Zend_Locale

Issue Type: Patch Created: 2012-01-04T06:12:37.000+0000 Last Updated: 2012-02-26T06:52:48.000+0000 Status: Open Fix version(s): Reporter: Shinya Hayakawa (tsurumau) Assignee: Thomas Weidner (thomas) Tags: - Zend_Locale

  • zf-crteam-review

Related issues: Attachments: - library_Zend_Locale.diff


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?)


No comments to display

Have you found an issue?

See the Overview section for more details.


© 2006-2018 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.