Re: Re[2]: [SMARTY-DEV] Config files and compiled templates

From: Date: Tue, 26 Nov 2002 15:40:22 +0000
Subject: Re: Re[2]: [SMARTY-DEV] Config files and compiled templates
References: 1 2 3  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-11111@lists.php.net to get a copy of this message
With seperate compile ids you can make separate compiled templates per language, but yes the config file parsing is always in there (although the file is parsed only once, not each time a var is referenced.) On Tue, 2002-11-26 at 09:29, Bertrand DUNOGIER wrote: > MO> The biggest problem would be determining a recompile. Currently the > MO> timestamp is checked against the original template. If config vars are hard > MO> coded, you would have to keep track of what config files were loaded in this > MO> template, in any parent template, and any child template since you could > MO> reference a variable from any one of them. > Yes, indeed, i also thought about this one. > It would probably be possible to keep in the compiled template a reference to > the external files that need to be checked, right ? And if compile_check is > enabled, these files are also reparsed. If it's disabled, nothing is done. > > MO> Maybe you can accomplish what you're after if you enable caching and also > MO> enable compile_check. As long as no templates or config files have changed, > MO> you will get the cached version (no config file loading). If anything did > MO> change, the cache is dumped and regenerated. > But I'd like to keep my standard variables dynamic... It's the biggest problem. > What I'm trying to achieve is an efficient internationalisation. My text > strings are in config files, one for each language (several config files by > languauge of course), and it would be perfect if it was possible to build > several compiled version of the templates, with the config_vars written > statically to the compiled templates. The overhead for a multilingual site would > then by almost 0... > > Bertrand -- Monte Ohrt <monte@ispi.net>

« previous php.pear.dev (#11111) next »