Re: [SMARTY] possible bug in 2.6.0-RC1

From: Date: Wed, 17 Sep 2003 16:10:18 +0000
Subject: Re: [SMARTY] possible bug in 2.6.0-RC1
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-10231@lists.php.net to get a copy of this message
On Wed, Sep 17, 2003 at 11:05:40AM -0400, Marshall Sorenson wrote: > Hello, > > I think I may have found a bug in 2.6.0-RC1 (possibly previous versions?). > > Calling is_cached() prior to a successful clear_cache() causes display() to > NOT write a cache file. if is_cached() is successful, then display() displays the cached versions it read at the call to is_cached(). it does not make any attempts to write or read a cache-file. maybe it's not documented anywhere explicitly, but it's not a bug IMHO. if is_cached() returns true you have to see is_cached() as the actual call to fetch()/display() any subsequemt calls to fetch()/display() with the same tpl/cache_id-settings don't result in any filereads/filewrites/compilations/compilechecks etc. anymore. the situation is different if is_cached() returns false, of course. > $smarty = new Smarty; > $smarty->template_dir = 'tpls'; > $smarty->caching = 2; > > // Clears and writes new cache file every time > $smarty->clear_cache('test.tpl', 'foo|bar'); > $smarty->display('test.tpl', 'foo|bar'); > > // Clears cache file if one exists, but does not write new cache file. > // Writes new cache file if one did not exist prior to request. > $smarty->is_cached('test.tpl', 'foo|bar'); > $smarty->clear_cache('test.tpl', 'foo|bar'); > $smarty->display('test.tpl', 'foo|bar'); > > Can someone else maybe verify this and let me know if maybe it is something > I am doing wrong? > > Thanks, > > Marshall > > -- > Smarty General Mailing List (http://smarty.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.smarty.general (#10231) next »