Re[2]: [SMARTY-DEV] Config files and compiled templates
| From: | Bertrand DUNOGIER | Date: | Tue, 26 Nov 2002 15:30:23 +0000 |
| Subject: | Re[2]: [SMARTY-DEV] Config files and compiled templates | ||
| Groups: | php.smarty.dev | ||
| Request: | Send a blank email to php-smarty-dev+get-351@lists.php.net to get a copy of this message | ||
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