Re: [SMARTY-DEV] clear_compiled_tpl() bug or missing feature

From: Date: Thu, 06 Nov 2003 16:17:35 +0000
Subject: Re: [SMARTY-DEV] clear_compiled_tpl() bug or missing feature
References: 1 2 3 4  Groups: php.smarty.dev 
Request: Send a blank email to php-smarty-dev+get-1915@lists.php.net to get a copy of this message
Maybe all the cache and compile files could be under a version-named subdirectory. That would keep things separate and easy to maintain. templates_c/2.6.0-RC1/ templates_c/2.6.0-RC2/ templates_c/2.6.0/ On Thu, 2003-11-06 at 10:00, Jan Rosier / Interstroom wrote: > Monte Ohrt <monte@ispi.net> wrote: > > As long as testing for template versions does not take a performance > > hit, I'd be for it. I wonder if we should integrate the version number > > into the template filename creation process. This way when you > > upgrade, > > new compiled files (and cache files) will get created. This leaves old > > versions of template files around, but does not add version testing > > logic. > > > > And of course, we should make the version value more granular so this > > is usable. > > > > Monte > > > > I like the idea of adding the version value into the filename. > > To prevent bulky cache and compile dirs a function like the one below could > be added. This function must be call after the compile_dir is set. > > /** > * This method check the current version of Smarty. On different > * versions the compiled and cached templates are deleted. > * > * @access public > */ > function clear_invalid_files() > { > $fname = $this->compile_dir . DIRECTORY_SEPARATOR . '.version-' . > $this->_version; > if (!file_exists($fname)) { > $this->clear_all_cache(); > $this->clear_compiled_tpl(); > touch($fname); > } > } > > > Greetings, > Jan Rosier > > * The greatest lesson in life is to know that even fools are right > sometimes. - Sir Winston Leonard Spencer Churchill *

« previous php.smarty.dev (#1915) next »