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

From: Date: Tue, 26 Nov 2002 15:15:23 +0000
Subject: Re: [SMARTY-DEV] Config files and compiled templates
References: 1  Groups: php.smarty.dev 
Request: Send a blank email to php-smarty-dev+get-350@lists.php.net to get a copy of this message
The biggest problem would be determining a recompile. Currently the timestamp is checked against the original template. If config vars are hard coded, you would have to keep track of what config files were loaded in this template, in any parent template, and any child template since you could reference a variable from any one of them. Maybe you can accomplish what you're after if you enable caching and also enable compile_check. As long as no templates or config files have changed, you will get the cached version (no config file loading). If anything did change, the cache is dumped and regenerated. Monte On Mon, 2002-11-25 at 15:38, Bertrand DUNOGIER wrote: > Hello, > > This question mainly targets Andrei and Monte, but others might be > interested as well. > I was wondering about something... I have browsed Smarty Source code > and several compiled templates, and it appears that the config files > and the config vars are parsed every time the page is parsed. Would it > be possible to trick this so that the config vars are written as full > text to the compiled template ? > I have by instance > alert('<?php echo > $this->_config[0]['vars']['loginform_error_login_empty']; ?> > And I'd like to get > alert('<loginform_error_login_empty_value_here>') > > would it be technically possible ? Of course there are points that > would need to be clarified, a variable config file path being one of > them. But don't you think it would be a great speed increase if the > config file didn't have to be loaded everytime ? > > Before i check, i was sure i read several times on the mailing list > that config_vars was written "as is" to the config file. But it > appears that they don't... > > Bertrand -- Monte Ohrt <monte@ispi.net>

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