Re: Conf: argue !
"Wim Niemans ri" <[email protected]>
| Newsgroups | gmane.comp.lib.binarycloud.devel |
|---|---|
| Organization | Pb Solo |
| Message-ID | <421E8979.1746.30DD74E@localhost> |
On 25 Feb 2005 at 1:22, Jean-Christophe Michel wrote:
> Wim Niemans ri wrote:
> > On 24 Feb 2005 at 18:45, Jean-Christophe Michel wrote:
> >>Manuel Holtgrewe wrote:
> >>
> >>
> >>>I like the idea of "core settings cannot be changed on the fly"... And
> >>>what about people who do not have a database?
> >>
> >>They'll have to put their conf values in xml and call
> >>tools/cli/reload-confs.php instead of tools/web/reload-confs.php :-)
> >
> > So, the proposed method myConf->set(path,value) shoud evaporate than?
>
> No, the set method will be used by the web gui to edit db. But the
Perhaps. I can imagine that the web GUI just uses Creole.
> script evoqued here would make a dump of all values for caching.
True. However I do think that it is not such easy.
> >>I mean that we can check bad names in conf when rebuilding the cache.
> >>No need to wait for running the site.
> >
> > Check for bad names? What's the definition of a 'bad name' ?
> > To my humble opnion conf can't check nothing while loading.
>
> From xml: that constants in "raw" exist. That xml is valid.
> From db or xml: that there's not a unicity name conflict. That an
> overriding value (a dev value over core one) doesn't change type.
I could agree to this. Sounds oke.
The following example will blow it away:
Say in version 2.0 the value for 'currrency_rate' is an integer.
In version 3.0 that is changed into a float.
Both versions are available in base_config. That's the idea though?
And....btw...all conf_values are stored in php, like
array('currency_rate' => '123'), so what's the difference ?
> >>>>property::path should already be unique. Of course this makes a long
> >>>>pkey, but since all db is cached into a php array, why have a numeric id?
> >>>
> >>>Because you might decide to shift things and path is volatile in this
> >>>respect. However, you are right, id is a candidate key - a *possible* key.
> >
> > You will need an 'id' when updating, since you can't guarantee that a path
> > is unique. Stronger, a unique integer-id is required.
>
> Disagree. A path must be unique. If not what is a path useful for?
I noticed in some xml files the occurrence of:
<section name="plugins_dir">
<property type="raw">BC_PATH_BASE . '/smarty/libs/plugins'</property>
<property type="raw">BC_PATH_BASE . '/smarty-plugins'</property>
The path is 'smarty/plugins_dir' for two properties.
To my opinion Conf:: could handle this as an array, *or* as two properties
with the same path (but a different id). Think about it.
See also the above example of one path with different type and version.
And it is always a good idea to have a separate id as pk and use that for
update. Just in case.........
Have fun.
wim niemans
>
> --
> Jean-Christophe Michel
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe-zNu2Yekbks92Brm55YPRC3dfcadvtA/[email protected]
> For additional commands, e-mail: dev-help-zNu2Yekbks92Brm55YPRC3dfcadvtA/[email protected]
>
>