Re: [SMARTY] Problem with clear_cache and cache groups

[email protected] (Francesco Cipriani) Thu, 31 May 2007 14:24:56 +0200
Newsgroups php.smarty.general
Message-ID <[email protected]>
> I'm using smarty 2.6.18, I've just upgraded from smarty 2.5 (...).
> I'm using clear_cache to clear cache groups, it did work with smarty 2.5
> but now it doesn't work anymore. 

Trying every available release, I found that the latest version able to
clear my group caches is 2.6.1. But it not compatible with php5 (I have:
"Fatal error: using $this when not in object context").
To test the releases I used the following code

<?php

require('lib/smarty/libs/Smarty.class.php');

$tpl = new Smarty();
$tpl->cache_dir = "/var/www/localhost/htdocs/test/cache";
$tpl->compile_dir = '/var/www/localhost/htdocs/test/templates_c';

$res = $tpl->clear_cache(null, "latest");
echo ($res ? "true\n" : "false\n");

?>

The root of the cache group is "latest".
Versions until 2.6.1 work, newer not, all things being the same.

-- 
Francesco