Re: [RFC] Conditional INI support
| From: | Dmitry Stogov | Date: | Fri, 15 Feb 2008 10:02:28 +0000 |
| Subject: | Re: [RFC] Conditional INI support | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-35511@lists.php.net to get a copy of this message | ||
Jani Taskinen wrote:
On Fri, 2008-02-15 at 11:36 +0300, Dmitry Stogov wrote: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. Dmitry.a) I think we don't need (1) ternary support at all, as (2) if-elif=else-endif may do the same.That was already dropped. :)b) I think usage of square brackets is not a good idea, because they are commonly used to divide ini files into sections. Why not to use C syntax? (#if...)I'd prefer that syntax too, it would be much clearer than mixing the sections with this. It's also backwards compatible, lines prefixed with # are simply ignored.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.
d) I would prefer not to use '.' in the variables name. It will allow to distribute conditional ini files, and use them with old PHP versions after manual preprocessing (using cpp).. is acceptable since it's acceptable in ini directive names too. And works just fine in pre 5.3 versions too.e) We don't need to define special names, we can use internal PHP constants.Yup, I mentioned this a couple of times already. :) --Jani