Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:35447 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 3849 invoked by uid 1010); 13 Feb 2008 15:46:00 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 3833 invoked from network); 13 Feb 2008 15:45:59 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 13 Feb 2008 15:45:59 -0000 Authentication-Results: pb1.pair.com header.from=helly@php.net; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=helly@php.net; spf=unknown; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain php.net does not designate 85.214.94.56 as permitted sender) X-PHP-List-Original-Sender: helly@php.net X-Host-Fingerprint: 85.214.94.56 aixcept.net Linux 2.6 Received: from [85.214.94.56] ([85.214.94.56:44846] helo=h1149922.serverkompetenz.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 46/0D-24174-6B013B74 for ; Wed, 13 Feb 2008 10:45:59 -0500 Received: from MBOERGER-ZRH.corp.google.com (187-169.79-83.cust.bluewin.ch [83.79.169.187]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by h1149922.serverkompetenz.net (Postfix) with ESMTP id 527A61B365D; Wed, 13 Feb 2008 16:45:55 +0100 (CET) Date: Wed, 13 Feb 2008 16:45:26 +0100 Reply-To: Marcus Boerger X-Priority: 3 (Normal) Message-ID: <1432448814.20080213164526@marcus-boerger.de> To: "Pierre Joye" CC: "PHP Internals List" In-Reply-To: References: <971575499.20080209153315@marcus-boerger.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC] Conditional INI support From: helly@php.net (Marcus Boerger) Hello Pierre, Monday, February 11, 2008, 10:31:17 PM, you wrote: > 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 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. Yeah, and you can actually accomplish this with IF/ELSE. >> 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). Fine with me >> 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! Best regards, Marcus