Re: [SMARTY] Caching & dynamic changing of cache_dir
| From: | Monte Ohrt | Date: | Sat, 29 Jun 2002 15:53:09 +0000 |
| Subject: | Re: [SMARTY] Caching & dynamic changing of cache_dir | ||
| References: | 1 2 3 4 5 6 7 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-5097@lists.php.net to get a copy of this message | ||
Smarty's functionality should be backward compatible, regardless of added features. What you are talking about I already tried to create a discussion, and with basically no feedback ;)
The cache_id does NOT care about the directory structure in the template_dir, it only cares about the cache_id. (compile_id works the same way.)
examples:
$smarty->display('index.tpl','orange|blue|green');
$smarty->display('foo.tpl','orange|blue|green');
$smarty->display('foo.tpl','foo|bar'');
// clears the first two templates
$smarty->clear_cache(null,'orange');
So what you are saying, you want something like this:
$smarty->display('/foo/bar/index.tpl');
$smarty->clear_cache('foo|bar');
... and you want this to clear your template? This will cause conflicts, but it is a good topic of discussion.
Example, if you have this:
$smarty->display('index.tpl','foo|bar');
$smarty->display('foo/bar/index.tpl');
$clear_cache(null,'foo|bar');
What gets cleared? Currently, only the first one will. I'm not sure if it should respect template paths, or if it is even desirable.
Monte
Norbert Röcher wrote:
"Monte Ohrt" <monte@ispi.net> schrieb im Newsbeitrag news:3D1D1634.3010302@ispi.net...haveIt shouldn't do that, I'm not able to replicate your problem :( Norbert Röcher wrote:"Monte Ohrt" <monte@ispi.net> schrieb im Newsbeitrag news:3D1C63C3.9040605@ispi.net...So you prepend your blockID to the cache_id. Remember how they can
Now I got a previous version from CVS... creating subdirs works, clear_cache() works only, if the templates full cacheID is given. But it doesn't work as described above for subdirs. So, where is the use? I really loved Smarty, I optimized my whole app for Smarty over month, but regarding the quality of too much hastily added new features I predict the next official release of Smarty will become a disaster. No easy decision for me, but now it's time to prove something else. Many thnx and all the best. Bye, Norbert"|" separators now? $cache_id = "$blockID|foo"; So if you want to clear all the caches for a particular block: $smarty->clear_cache($blockID); Or a particular cache id for a particular block: $smarty->clear_cache("$blockID|foo");