Re: [SMARTY-DEV] Re: config vars are now static

From: Date: Sat, 14 Jun 2003 20:39:38 +0000
Subject: Re: [SMARTY-DEV] Re: config vars are now static
References: 1  Groups: php.smarty.dev 
Request: Send a blank email to php-smarty-dev+get-1584@lists.php.net to get a copy of this message
boots wrote:
Hi Monte. Just started testing the new config var patch. Initial observation is that as a consequence of going compile time, two important issues arise: 1. Literal names in the config_file 'file' parameter are now required: no more dynamically selected configurations. No longer supported: {config_load file=$config_file}
Let alone this:      {config_load file=$Object->config_file}
Yes, see my notes in my previous e-mail to Thomas Seifert, it should solve this problem. I guess it is a decision which would be faster: including a static template (one file stat), or building the config data array statically in the template and accessing them dynamically. Hmm, maybe #2 would be easier, quicker and better BC. It's actually almost the same as the original setup, except instead of storing the config file data in a cache file, it would be buried directly in the template where the config_load happens.
2. All templates are now required to explicitly do a config_load to have access to the configuration values.
You always have to load config file values into a template to be able to access them. Whether you use {config_load} directly in the template or the config_load() API to load them, the data gets compiled statically in either case, but the difference is that {config_load} won't be called again after compiletime, whereas config_load() may needlessly load config file data every invocation (unless you take steps manually to avoid that.) Also in both methods, templates will get recompiled upon a change to a config file value. I'll give all this some thought and work on it over the next few days. Monte
I think the previous framework still allowed for a static config_load implementation (well, I did work against 2.5 that achieved a similar outcome.} I like the idea, but I think that those are pretty big changes. xo boots __________________________________ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com


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