Re: [RFC] Conditional INI support
| From: | BuildSmart | Date: | Fri, 15 Feb 2008 20:37:00 +0000 |
| Subject: | Re: [RFC] Conditional INI support | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-35535@lists.php.net to get a copy of this message | ||
Take a look at apache's config mechanism, it allows conditional arguments.
Yes, it can be abused but we're not talking about an extensive INI language, just something covering basic conditional control.
On Feb 15, 2008, at 9:48 AM, Chris Stockton wrote:
It might be to late to keep it simple, once you add basic language components like IF-ELSE as you can see people already want basically another programming language embedded into it. It is my opinion that the INI files should be simple configuration files. Otherwise they will become more and more feature rich and people will start shifting program complexity from the PHP application to the INI file. This might not be the intention of the people in this list as you are all pretty sharp, but have you read some of the online tutorials on php? I just think this kind of feature would be badly abused... -Chris On Fri, Feb 15, 2008 at 7:40 AM, Jani Taskinen <jani.taskinen@sci.fi> wrote:-- DaleDmitry, please don't throw gasoline on the flames. We have to keep the ini files as simple as possible, this isn't the job of the ini file. --Jani Dmitry Stogov kirjoitti:--PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.phpThe idea makes sense too, but mix of C and SH syntax isn't good. Dmitry. BuildSmart wrote:-- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.phpNow 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:-- DaleI 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:-- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.phpHello 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" #endifHere 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:Best regards, MarcusOn Fri, 2008-02-15 at 13:02 +0300, Dmitry Stogov wrote:Jani Taskinen wrote: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? :) --JaniOh, 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.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.