Note: issues are now on GitHub; see the Overview for more
Posted by Thomas Weidner (thomas) on 2008-03-17T16:09:49.000+0000
As stated in the manual you MUST set the cache BEFORE creating the object.
Using the same cache for different objects like in your case makes of course problems not only in this component... it leads to unexpectable behaviour as you do not know what's written and what's left from the first object.
Posted by Christoph Schulte Mönting (csm) on 2008-03-18T03:10:55.000+0000
But that is what my example code does: It creates and sets the cache, and then (by calling testTranslate()) twice creates a translate object and uses it. If you want, you can rewrite it to
$translationCache = Zend_Cache::factory('Page', 'File');
$translate1 = new Zend_Translate('tmx', 'texts.tmx', 'de');
$translate2 = new Zend_Translate('tmx', 'texts.tmx', 'de');
which clearly is what the documentation says and does not work either. The point is not that the example creates two instances at the same time, the point is that writing and restoring from and to the cache will lead to parameters being ignored. Please have a look at Zend_Translate_Adapter's constructor, it is obviously not correct.
Posted by Thomas Weidner (thomas) on 2008-03-24T08:35:34.000+0000
2 things to mention:
*) You must not use the incubator in such situations
*) You can try r9038 or higher where the options have been added to cache
But it has to be mentioned that using caches in the way you show it, is problematic.
It is not allowed to have 2 identical adapters with different options. This is against generic rules and leads to the problem that the user has to be aware of which class holds which translation. This is not allowed and also not supported.
With the actual revision there is no problem within your testcode.
Posted by Wil Sinclair (wil) on 2008-09-02T10:39:13.000+0000
Updating for the 1.6.0 release.