Re: [SMARTY] defining arrays in config files
| From: | Tarik ANSARI | Date: | Mon, 23 Feb 2004 21:24:33 +0000 |
| Subject: | Re: [SMARTY] defining arrays in config files | ||
| References: | 1 2 3 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-11012@lists.php.net to get a copy of this message | ||
Messju Mohr wrote:
> (nice to read you again :)
>
> On Mon, Feb 23, 2004 at 12:19:38PM -0800, boots wrote:
> > --- Tarik ANSARI <ansari@efrei.fr> wrote:
> > > I think that it's exactly what we gonna do.
> >
> > May I suggest that the work is put into a new class that extends the
> > current Config_File? I have some suggestions for handling multiple
> > classes in config_load (I think I may have proposed them some time
> > ago). Unfortunately, I haven't had time to check into the latest
> > changes to config_load (config loading via resources in 2.6.2?) so I
> > don't know if they are still appropriate.
>
> that change is really simple. the source of the (static)
> config-file-contents can be any resource. but there is no big relation
> to templates. no further processing of the fetched resource-contents
> is done inside config_load().
I don't think that it's a goof idea to make it as an extension : we should
rewrite config file parser core, what's not so hard because it's the
question of only a few lines.
That the best way to have a strong template engine well unified and easy to
use, and if we want those improvements to be directly avaible and documented
onto Smarty official doc.
I suppose that by talking of a new Config_File class, you mean to bring
differents way to read config files, on user's choice ?
> > It looks like the current plan is that the new config format will be
> > fully BC.
>
> not *fully*. the definition of a comment in a config-file is
> "everything that is not a valid line is a comment". a bad definition
> IMHO: every addition to config-file's syntax makes something been a
> comment before become something else. but i think in the cases
> discussed here this is only of academic interest, i don't think
> anybody used "foo.bar = value" as a comment.
>
> > If that is not possible and BC must be broken, then I suggest
> > a rethink and propose that syntax similar to YAML
> > (http://yaml.org/spec/) be adopted.
>
> AFAIK yaml's goal is to be easily read and written by machines. in
> contrast config-files should be maintained by humans.
Good answer
Tarik