Zend Framework

Zend_Translate should not clear all cache and use tagging when backend is capable of it

Details

  • Type: Improvement Improvement
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.10.3
  • Fix Version/s: 1.10.7
  • Component/s: Zend_Translate
  • Labels:
    None

Description

I pass my cache object to Zend_Translate::setCache and when I call Zend_Translate::clearCache() it clears complete cache - no matter who worte it. problem is that one server is used by few projects and they all lose cache.

Could Zend_Translate and probably all other components (currency, locale data ... etc) that use cache, try to use tags if available in cache component.

I've extended Memcached backend so it supports cache tagging. So MyComp_Cache_Backend_Memcached::getCapabilities() return array with entry ('tags' => true) and I have implemented my way of handling tags.

Activity

Hide
Zoran Lazic added a comment -

selected component/s that concern this issue

Show
Zoran Lazic added a comment - selected component/s that concern this issue
Hide
Thomas Weidner added a comment -

It is not possible to add tagging because when a cache does not support tagging an notice/warning is thrown.

As long as Zend_Cache does not support tagging, or a proper handling for un-tagable cache adapters, it is not possible for the I18n core to support tagging.

Tags have been erased 3 releases before as there were problems with this approach.

Now, when using cache, Zend_Translate must have it's own cache or you omit using clearCache().

Show
Thomas Weidner added a comment - It is not possible to add tagging because when a cache does not support tagging an notice/warning is thrown. As long as Zend_Cache does not support tagging, or a proper handling for un-tagable cache adapters, it is not possible for the I18n core to support tagging. Tags have been erased 3 releases before as there were problems with this approach. Now, when using cache, Zend_Translate must have it's own cache or you omit using clearCache().
Hide
Dolf Schimmel (Freeaqingme) added a comment -

Thomas you can use getCapabilities() to determine whether the cache returns tags. If it does; it should use tags rather than clearing it all - imho.

Show
Dolf Schimmel (Freeaqingme) added a comment - Thomas you can use getCapabilities() to determine whether the cache returns tags. If it does; it should use tags rather than clearing it all - imho.
Hide
Thomas Weidner added a comment -

There is no need to duplicate things which we already discussed and clearified.

You should give me some minutes to add a feature even if it's bug hunt day and I decleared that it works different that you noted within irc

Show
Thomas Weidner added a comment - There is no need to duplicate things which we already discussed and clearified. You should give me some minutes to add a feature even if it's bug hunt day and I decleared that it works different that you noted within irc
Hide
Thomas Weidner added a comment -

Added with r22586
See the manual for proper usage

Show
Thomas Weidner added a comment - Added with r22586 See the manual for proper usage

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: