Re: [SMARTY] clear_cache unexpected behavior
| From: | Monte Ohrt | Date: | Wed, 12 Feb 2003 14:37:18 +0000 |
| Subject: | Re: [SMARTY] clear_cache unexpected behavior | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-7680@lists.php.net to get a copy of this message | ||
That's not how it works. If you don't supply a group id, then Smarty
will not know any grouping association and only clear the single cache
file for the 'foo.tpl' template as if you called:
$smarty->display('foo.tpl');
If you want to clear a group of templates, you must supply a group id.
You could do something like this:
display('foo.tpl', 'C|0|1', 'english') // first page of
display('foo.tpl', 'C|0|2', 'spanish)
display('foo.tpl', 'C|1|1', 'catalan')
Then to clear them all:
clear_cache('foo.tpl', 'C')
Monte
On Wed, 2003-02-12 at 07:25, Ubaldo Huerta wrote:
> Hi all,
>
> I'm wondering if it's my misunderstanding of the way the API should work or if
> it's simply a bug (hard to believe given the maturity of smarty). I've been using it
> myself for more 5 months now in production and it's remarkably predictable.
>
> So the question is:
>
> Shouldn't clear_cache('foo.tpl') clear all caches for that template, period?
> I'm observing that this is NOT happening.
>
> In my particular setup, I'm using compile id (because it's handy to do multilanguage
> sites) and also cache groups (because I'm caching pages in a result set', that is,
> I'm calling display in the following way
>
> display('foo.tpl', '0|1', 'english') // first page of
> display('foo.tpl', '0|2', 'spanish)
> display('foo.tpl', '1|1', 'catalan')
> ... so on ....
>
> So, my goal is to get rid of all caches (all languages) for all pages, so I thought that
> clear_cache('foo.tpl') should do it, but it doesn't seem to work. Note that the
> following DOES work:
>
> clear_cache('foo.tpl', '0')
> clear_cache('foo.tpl', '1')
> and so on ....
>
> but that'll force me to keep track of all possible cache ids for template
> 'foo.tpl'.
>
> Am I making any sense?
>
> BTW, I tried it with Smarty 2.4.2 and still didn't work
>
> Thank you.
>
> Ubaldo
>
> LoQUo Barcelona Community
> www.loquo.com
--
Monte Ohrt <monte@ispi.net>