Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:46375 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 14462 invoked from network); 9 Dec 2009 19:18:01 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 9 Dec 2009 19:18:01 -0000 Authentication-Results: pb1.pair.com header.from=jerome@loyet.net; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=jerome@loyet.net; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain loyet.net from 209.85.223.195 cause and error) X-PHP-List-Original-Sender: jerome@loyet.net X-Host-Fingerprint: 209.85.223.195 mail-iw0-f195.google.com Received: from [209.85.223.195] ([209.85.223.195:37167] helo=mail-iw0-f195.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C3/6C-55877-7E7FF1B4 for ; Wed, 09 Dec 2009 14:18:01 -0500 Received: by iwn33 with SMTP id 33so5028562iwn.29 for ; Wed, 09 Dec 2009 11:17:57 -0800 (PST) MIME-Version: 1.0 Received: by 10.231.157.131 with SMTP id b3mr60567ibx.19.1260386277002; Wed, 09 Dec 2009 11:17:57 -0800 (PST) In-Reply-To: References: <3bea96c40912090655i263115bbid923deb2bdf296a6@mail.gmail.com> <4B1FBAF0.7020506@daylessday.org> <3bea96c40912090711o3927e257gab87783a6763f172@mail.gmail.com> <3bea96c40912090944r23831b52pc57dae2b7905c15@mail.gmail.com> <7.0.1.0.2.20091209200857.07a9da50@zend.com> Date: Wed, 9 Dec 2009 20:17:56 +0100 Message-ID: <3bea96c40912091117g7281a0d1na83630aec93f90fc@mail.gmail.com> To: Michael Shadle Cc: Zeev Suraski , Pierre Joye , Antony Dovgal , php-dev Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] [PHP-FPM] syntax of configuration file From: jerome@loyet.net (=?ISO-8859-1?B?Suly9G1lIExveWV0?=) Le 9 d=E9cembre 2009 19:17, Michael Shadle a =E9crit : > 2009/12/9 Zeev Suraski : > >> We should be using INI unless there are compelling reasons against it, n= ow >> that this project becomes a part of the PHP source tree. =A0As far as I = can >> tell there are no such compelling reasons and it can actually map quite >> nicely into INI, hence, that's what we should use. > > +1 > > multiple syntaxes is not a good idea (sorry Jerome :)) Don't worry for me it was just a proposal :) > > it maps to existing PHP configuration syntax and if this is to be in > core, that makes sense. > > I would just like to see how the ini file syntax ideas come out > though. Sounds like there's options. > OK so it seams to become clear. So INI it will be (even if I don't like it but it's logic so I'm fine with it). Now let's talk about detail of INI. The specs are: 1- there is a set of key/value pairs 2- each key/value pair is present in a path of sections (from no section (global parameters) to N sections (specific parameters like worker pool) What do you think of the following implemenation: - sections and subsections are separated with a single character dot or sla= sh. - sections can be start with brackets ([worker] [worker.listen]) - section can be ended with a special bracket section : empty one [] (if it's authorized by the php ini parser) or something else like [end_section] - key/value pair respect the INI syntax of course (key =3D value) which will looks like something like: ;global options daemonize =3D yes error_log =3D /var/log/php-fpm.log ;pool 1 [worker] ; start section name =3D pool1 chroot =3D /var/www/docs/pool1 [worker.listen] address =3D 127.0.0.1:9000 owner =3D www [end_section] ; end section so move back to [worker] user =3D www; group =3D www; [worker.env] ; start subsection hostname =3D $hostname [worker.defines] ; start a subsection at the same level as the previous one, so it ends the previous one implicitely error_log =3D /var/www/logs/pool1/php.log ;pool 2 [worker] ; new section it closed all the previous ones ... name =3D pool2 ...