[augeas-devel] Re: [PATCH] Add PHP module and associated (basic) test file

Raphaël Pinson raphink at gmail.com
Sat Jul 26 13:36:28 UTC 2008


On Sat, Jul 26, 2008 at 2:23 PM, Dominique Dumont <domi.dumont at free.fr>wrote:

> "Raphaël Pinson" <raphink at gmail.com> writes:
> >
> >     Also, did you observe that augparse runs _really_ slow with that
> >     lens ?  It seems to allocate a _ton_ of memory. Seems like we
> >     need to do some optimizations somewhere to keep that at bay.
> >
> > Very slow indeed. Maybe the tip you gave me on dput.aug would
> > improve this. The fact is that php.aug has _tons_ of keywords. I'm
> > not even sure to have listed them all. since it seems that PHP
> > modules might allow more here...
>
> An alternative way would be to use Augeas only to perform
> transformation from syntax to abstract tree and to control/validate
> the content of the abstract tree with another tool. Your tons of
> keywords would be declared in and verified by this other tool.


This was my original idea... but [^=:\n] matches "/" so I didn't find a way
to specify a key word without naming it. Any idea is welcome!



> > There's another problem though. As I was working on this file, it
> > seems logical to me to treat it as a standard INI file, with
> > sections and variables. Now I was surprised to find that variables
> > have a naming space in them, such that most variables exist several
> > times in different naming spaces (e.g.
> > (ifx,msql,mssql,mysql,mysqli,
> > odbc,pgsql,etc.).allow_persistent. After noticing that, I wondered
> > if the sections in php.ini were _really_ useful. If the were, what
> > would be the use of adding a naming space to the variable names? So
> > I talked with a few of my colleagues that are used to php.ini, and
> > they told me that PHP seems to completely ignore the sections in
> > php.ini, such that moving variables around has no effect on the
> > configuration. In that situation. should we consider sections as
> > comments, seeing that it would be hard to move values around if we
> > use standard INI file sections?
>
> From my experience on Config::Model, I'd said you should focus on the
> semantics of the configuration file and not its syntax. The syntax is
> an "implementation detail".
>
> It looks like the "real" structure of php configuration is modeled
> after the "naming spaces" you mentioned. Presenting this "real"
> structure is more likely to help your users than presenting the INI
> file structure which has not much meaning.



Thank you for the advice. The name "php.ini" suggests that this file is
supposed to be an INI file though. I'm wondering if maybe this has
originally been done for Windows compatibility. I think Windows requires INI
files to have sections.

If the real structure of php.ini does not consider sections, do you think it
would be better to just see them as comments ?


Raphael
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/augeas-devel/attachments/20080726/06e0aaba/attachment.htm>


More information about the augeas-devel mailing list