Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:35398 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 57389 invoked by uid 1010); 11 Feb 2008 21:31:22 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 57374 invoked from network); 11 Feb 2008 21:31:22 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Feb 2008 21:31:22 -0000 Authentication-Results: pb1.pair.com smtp.mail=pierre.php@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=pierre.php@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 64.233.184.232 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: pierre.php@gmail.com X-Host-Fingerprint: 64.233.184.232 wr-out-0506.google.com Linux 2.4/2.6 Received: from [64.233.184.232] ([64.233.184.232:40927] helo=wr-out-0506.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 9D/D9-64922-AAEB0B74 for ; Mon, 11 Feb 2008 16:31:22 -0500 Received: by wr-out-0506.google.com with SMTP id c38so4208739wra.17 for ; Mon, 11 Feb 2008 13:31:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=FrGVQnA5Or0Lbtp3iiG4inI7qK6uFYjhWZrAmLVXBkM=; b=F0Sdssvq8N4J02QYJLeh3ZS2uwhZ1QghcVKauTAzcZEG12yo6jCbrCziLwAnypdszlhcLXCSgO0vfab0ACH/HzWJzOsZGqXgyfx1qSEIjfNyZQ+NeXnL8vLLYoZGrfgdF627uaRy3+J4umVeK66hxKnYMoi7NuXjsKEPV20Q1Bs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=dqYeECF2COW9qWgxML/Z1wSpKk42pMG9MRO5NMkp/efzuFFc9adqdCg3oopAZa8feCK3z+R0WvizBSizmdHfwtkT0A3FUjGFCz/YR8N3XOyq8hjJ523SBtpdElJtF8KgtU2mwRfEdolD1EGCHpEbdb5HqG9KvXqC4wA4SebybnE= Received: by 10.141.202.12 with SMTP id e12mr353357rvq.65.1202765477087; Mon, 11 Feb 2008 13:31:17 -0800 (PST) Received: by 10.141.70.21 with HTTP; Mon, 11 Feb 2008 13:31:17 -0800 (PST) Message-ID: Date: Mon, 11 Feb 2008 22:31:17 +0100 To: "Marcus Boerger" Cc: "PHP Internals List" In-Reply-To: <971575499.20080209153315@marcus-boerger.de> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <971575499.20080209153315@marcus-boerger.de> Subject: Re: [PHP-DEV] [RFC] Conditional INI support From: pierre.php@gmail.com ("Pierre Joye") 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. > 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