Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:35522 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 99963 invoked by uid 1010); 15 Feb 2008 14:33:23 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 99948 invoked from network); 15 Feb 2008 14:33:23 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 15 Feb 2008 14:33:23 -0000 Authentication-Results: pb1.pair.com header.from=buildsmart@daleenterprise.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=buildsmart@daleenterprise.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain daleenterprise.com from 67.78.11.229 cause and error) X-PHP-List-Original-Sender: buildsmart@daleenterprise.com X-Host-Fingerprint: 67.78.11.229 daleenterprise.com Received: from [67.78.11.229] ([67.78.11.229:51168] helo=daleenterprise.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 12/7B-26828-1B2A5B74 for ; Fri, 15 Feb 2008 09:33:22 -0500 Received: from localhost (localhost [127.0.0.1]) by daleenterprise.com (Postfix) with ESMTP id 4BBA95F3445; Fri, 15 Feb 2008 09:33:19 -0500 (EST) Received: from daleenterprise.com ([127.0.0.1]) by localhost (daleenterprise.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 18560-10; Fri, 15 Feb 2008 09:33:16 -0500 (EST) Received: from [10.1.100.11] (daleenterprise.com [10.1.100.11]) by daleenterprise.com (Postfix) with ESMTP id AE1B65F3431; Fri, 15 Feb 2008 09:33:16 -0500 (EST) In-Reply-To: <47B5917C.5050606@sci.fi> References: <971575499.20080209153315@marcus-boerger.de> <47B54F0C.2090700@zend.com> <1203067815.10500.5.camel@localhost.localdomain> <47B56334.9070007@zend.com> <1203070677.10500.12.camel@localhost.localdomain> <47B568A6.9060704@zend.com> <1158304008.20080215122414@marcus-boerger.de> <47B58B5D.9020301@zend.com> <47B5917C.5050606@sci.fi> Mime-Version: 1.0 (Apple Message framework v752.2) Content-Type: multipart/signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="Apple-Mail-6--706987076" Message-ID: <81BAF097-DF7D-4A3D-AED6-A22C912C83DB@daleenterprise.com> Cc: Dmitry Stogov , Marcus Boerger , Andi Gutmans , Jani Taskinen , PHP Internals List Reply-To: PHP Internals List Date: Fri, 15 Feb 2008 09:33:15 -0500 To: jani.taskinen@iki.fi Content-Transfer-Encoding: 7bit X-Pgp-Agent: GPGMail 1.1.2 (Tiger) X-Mailer: Apple Mail (2.752.2) MTA-Interface: amavisd-new-2.3.3 (2005-08-22) + Maia Mailguard 1.1.0 at daleenterprise.com X-Spam-Scanned: using SpamAssassin 3.1.7 (2006-10-05) at daleenterprise.com X-Virus-Scanned: using ClamAV 0.88.6 (2006-11-05) at daleenterprise.com Subject: Re: [PHP-DEV] [RFC] Conditional INI support From: buildsmart@daleenterprise.com (BuildSmart) --Apple-Mail-6--706987076 Content-Type: multipart/alternative; boundary=Apple-Mail-5--706987226 --Apple-Mail-5--706987226 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Now that what-if's are occurring in the theoretical world of intelligent INI, what about file testing capabilities so that the following can be used to preload extensions by existance? #if -f ${EXTENSIONS_DIR}/gd.so extension=gd.so #endif or some other syntax that allows testing to include an extension On Feb 15, 2008, at 8:19 AM, Jani Taskinen wrote: > > Currently UNDEFINED would be just string 'UNDEFINED'. > Doesn't atoi() for non-numeric string make it 0 ?? > (or null..:) So that would work without changing anything.. > > --Jani > > Dmitry Stogov kirjoitti: >> I think it will work. >> #ifdef UNDEFINED > 5 (false) >> #ifdef UNDEFINED <= 5 (true) >> (but anyway I think it is possible to find out an unclear condition) >> Dmitry. >> Marcus Boerger wrote: >>> Hello Dmitry, >>> >>> shouldn't this be like in C/C++ where a non existing value is >>> treated like >>> an empty string which behaves like false in boolean evaluations? >>> >>> marcus >>> >>> Friday, February 15, 2008, 11:25:42 AM, you wrote: >>> >>>> #if defined(PHP_MAJOR_VERSION) && PHP_MAJOR_VERSION >= 6 >>>> extension="unicode.so" >>>> #endif >>> >>>> Here PHP_MAJOR_VERSION is a PHP constant that is not defined in >>>> php-5.3 but might be defined in the future version. >>> >>>> Dmitry. >>> >>> >>>> Jani Taskinen wrote: >>>>> On Fri, 2008-02-15 at 13:02 +0300, Dmitry Stogov wrote: >>>>>> Jani Taskinen wrote: >>>>>>>> c) We can use just "value" insted of ${value} in conditions. >>>>>>> Yup. ${foobar} is actually not any "variable" per se, but just a >>>>>>> reference to existing ini entry in the file. And I don't >>>>>>> think that >>>>>>> needs to change. >>>>>> Oh, I see. Then we can use just "$string" (or "$str.str") for >>>>>> ini entries and "string" for PHP constants. We can also >>>>>> implement defined() macro-function, to check if constant defined. >>>>> Why? Don't make php.ini parsing any more complex than it already >>>>> is(n't). >>>>> Any string which can pass as constant will have that constant's >>>>> (or >>>>> environment variable) value. Why do you need any "variable" in >>>>> there >>>>> anyway? And why do you need defined() ??? (examples please? :) >>>>> >>>>> --Jani >>>>> >>> >>> >>> >>> >>> Best regards, >>> Marcus >>> > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Dale --Apple-Mail-5--706987226 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=ISO-8859-1 Now that what-if's are=A0occurring in the theoretical world of = intelligent INI, what about file testing capabilities so that the = following can be used to preload extensions by existance?

#if -f = ${EXTENSIONS_DIR}/gd.so
extension=3Dgd.so
#endif

or some other = syntax that allows testing to include an extension
On Feb = 15, 2008, at 8:19 AM, Jani Taskinen wrote:


Doesn't atoi() for non-numeric string make it 0 = ??
(or null..:) So that would work without = changing anything..
--Jani

Dmitry = Stogov kirjoitti:
I think it will work.
#ifdef = UNDEFINED > 5=A0 = (false)
#ifdef UNDEFINED <=3D 5 = (true)
(but anyway I think it is = possible to find out an unclear condition)
Marcus Boerger wrote:
=
Hello Dmitry,

=A0 shouldn't this be like in = C/C++ where a non existing value is treated like
an empty string which behaves like false in boolean = evaluations?

marcus

Friday, February 15, 2008, = 11:25:42 AM, you wrote:

#if = defined(PHP_MAJOR_VERSION) && PHP_MAJOR_VERSION >=3D = 6
extension=3D"unicode.so"
#endif

Here PHP_MAJOR_VERSION is a PHP constant that is not = defined in php-5.3 but might be defined in the future version.
=

=
Dmitry.
=


Jani Taskinen wrote:
=
On Fri, 2008-02-15 at 13:02 = +0300, Dmitry Stogov wrote:
Jani Taskinen wrote:
c) We can use = just "value" insted of ${value} in conditions.
Yup. ${foobar} is actually not any "variable" per = se, but just a
reference to existing ini entry = in the file. And I don't think that
needs to = change.
Oh, I see. Then we can use = just "$string" (or "$str.str") for ini entries and "string" for PHP = constants. We can also implement defined() macro-function, to check if = constant defined.
Why? Don't = make php.ini parsing any more complex than it already
is(n't).
Any string = which can pass as constant will have that constant's (or
environment variable) value. Why do you need any = "variable" in there
anyway? And why do you need = defined() ??? (examples please? :)

--Jani

=



Best = regards,
=A0Marcus

=
--=A0
PHP = Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



-- Dale


=

= --Apple-Mail-5--706987226-- --Apple-Mail-6--706987076 content-type: application/pgp-signature; x-mac-type=70674453; name=PGP.sig content-description: This is a digitally signed message part content-disposition: inline; filename=PGP.sig content-transfer-encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.2 (Darwin) iD8DBQFHtaKr0hzWbkf0eKgRArzeAKC0bWlltYwlSUG32jcefFmUaUdxwgCg2yKD bU6fsIsim+5lt/Mwzk1MIbY= =LO0+ -----END PGP SIGNATURE----- --Apple-Mail-6--706987076--