Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 2.0.4

Request #9301 [PATCH] Caching setLang() and setCacheOption()
Submitted: 2006-11-10 21:01 UTC
From: berdir Assigned: quipo
Status: Closed Package: Translation2 (version 2.0.0beta11)
PHP Version: Irrelevant OS:
Roadmaps: (Not assigned)    
Subscription  


 [2006-11-10 21:01 UTC] berdir (Sascha Grossenbacher)
Description: ------------ Hi I have created a patch which adds 2 functions to Translation2_Decorator_CacheLiteFunction -- setLang($langId) Caches the output of $this->translation2->storage->setLang() because this function gets all languages from the database. Caching this query eliminates the need for a db connection if the cache is up to date. -- setCacheOption($name, $value) Simple method which sets an option of the Cache_Lite object. This shouldn't be done directly because you have to access a private method (_prepare()) and a protected attribute then. There are 3 other differencies in my patch, but this are only space issues, which my editor removes automatically. --- On thing, that would be nice to have is the possibility to use your own cache_lite object. It is technically possible to set cacheLiteFunction, but this attribute is declared protected. I didn't create a patch, because I don't know which is the best solution for this (constructor or a new method?) Patch Location: http://web6.radon.caraweb.ch/pear/CacheLiteFunction.patch

Comments

 [2006-11-14 18:53 UTC] quipo (Lorenzo Alberton)
committed to CVS, thanks. I've also removed the @protected tag from the $cacheLiteFunction var.