Re: [RFC] Conditional INI support

From: Date: Mon, 11 Feb 2008 21:31:17 +0000
Subject: Re: [RFC] Conditional INI support
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-35398@lists.php.net to get a copy of this message
Hi Marcus, Nice addition, it is really handy and it'll help to solve the php.iniS mess :) On Feb 9, 2008 3:33 PM, Marcus Boerger <helly@php.net> wrote: > attached is a patch against 5.3 that brings three feature > additions to INI parsing. > > 1) Ternary support for values > > setting = ${value?1:2} Sounds overkilled. Not like one will edit php.ini every day. I find the classic if elseif endif clearer. > If ${value} evaluates to true then setting becomes 1 otherwise 2. > This cannot be nested and only works for values, not for setting names. > > 2) if-elif-else-endif support > > [IF ${value} == 1] > setting = 1 > [ELIF ${value} == 2] > setting = 2 > [ELSE] > setting = 3 > [ENDIF] Perfect if ELSEIF instead of ELIF (which I can't write correctly anyway, ELSEIF comes automatically). > This can be nested. Alternatively we could use apache style syntax that > looks more like XML. The reason I used square brackets is that this is the > smallest change to normal INI files. > > 3) Add more values to INI parsing, namely: > > ${php.version} = 50300 > ${php.debug} = 0 > ${php.zts} = 0 > ${php.sapi} = CLI > > Any comments? I like it. Thanks for your work! -- Pierre http://blog.thepimp.net | http://www.libgd.org

« previous php.internals (#35398) next »