Default values for php.ini environment variables

php.internals

Derick Rethans

3 years ago
Hi, coming forth out of an Xdebug issue (https://bugs.xdebug.org/view.php?id=2174) I made a pull request so that it is possible to use a fallback value in environment variables in INI files, such as in: xdebug.start_with_request = ${PHP_XDEBUG_START_WITH_REQUEST:-default} This is a syntax that bash also supports. Ilija pointed out an already existing PR (https://github.com/php/php-src/pull/11351) which had been extensively reviewed. Its author never seem to have emailed the list, so here I am. I would like to see this in PHP 8.3, and don't see the need for an RFC. If there are no objects, I'll merge this in the next few days. cheers, Derick

Flávio Heleno

3 years ago
I don't have voting rights, but this is a very positive addition IMO. On Thu, Jul 13, 2023 at 10:27 AM Derick Rethans <derick@php.net> wrote:
> Hi, > > coming forth out of an Xdebug issue > (https://bugs.xdebug.org/view.php?id=2174) I made a pull request so that > it is possible to use a fallback value in environment variables in INI > files, such as in: > > xdebug.start_with_request = ${PHP_XDEBUG_START_WITH_REQUEST:-default} > > This is a syntax that bash also supports. > > Ilija pointed out an already existing PR > (https://github.com/php/php-src/pull/11351) which had been extensively > reviewed. Its author never seem to have emailed the list, so here I am. > I would like to see this in PHP 8.3, and don't see the need for an RFC. > > If there are no objects, I'll merge this in the next few days. > > cheers, > Derick > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: https://www.php.net/unsub.php > >
-- Atenciosamente, Flávio Heleno

Ben Ramsey

3 years ago
> On Jul 13, 2023, at 08:26, Derick Rethans <derick@php.net> wrote: > > Hi, > > coming forth out of an Xdebug issue > (https://bugs.xdebug.org/view.php?id=2174) I made a pull request so that > it is possible to use a fallback value in environment variables in INI > files, such as in: > > xdebug.start_with_request = ${PHP_XDEBUG_START_WITH_REQUEST:-default} > > This is a syntax that bash also supports. > > Ilija pointed out an already existing PR > (https://github.com/php/php-src/pull/11351) which had been extensively > reviewed. Its author never seem to have emailed the list, so here I am. > I would like to see this in PHP 8.3, and don't see the need for an RFC. > > If there are no objects, I'll merge this in the next few days.
No objections from me. I really like this idea. Cheers, Ben

Marc

3 years ago
On 13.07.23 17:39, Ben Ramsey wrote:
>> On Jul 13, 2023, at 08:26, Derick Rethans <derick@php.net> wrote: >> >> Hi, >> >> coming forth out of an Xdebug issue >> (https://bugs.xdebug.org/view.php?id=2174) I made a pull request so that >> it is possible to use a fallback value in environment variables in INI >> files, such as in: >> >> xdebug.start_with_request = ${PHP_XDEBUG_START_WITH_REQUEST:-default} >> >> This is a syntax that bash also supports. >> >> Ilija pointed out an already existing PR >> (https://github.com/php/php-src/pull/11351) which had been extensively >> reviewed. Its author never seem to have emailed the list, so here I am. >> I would like to see this in PHP 8.3, and don't see the need for an RFC. >> >> If there are no objects, I'll merge this in the next few days. >>
This would be a very welcome addition as configuring PHP via environment variables is (at least for me) very importing on serving fargate containers. Same questions ... Is it possible (like in bash) to escape the sequence in case you need the unparsed text for some reason? Does the opposite with :+ work as well?     Example: auto_prepend_file="${PHP_DEBUG:+/path/to/init_debug.php}" Is it possible to chain multiple :- (or :+) together? Anyway even without ":+" or chaining it would be a very good addition :+1: Thanks, Marc

Gabriel Fontes

3 years ago
Hi everyone, PR author here. Thanks a lot for pushing this forward, Derick! Do let me know if you folks have any feedback or concerns about the PR, I'll be happy to address them. PS: Sorry for the double post, wasn't subscribed before. Cheers, Gabriel

Gabriel Fontes

3 years ago
Hi everyone, PR author here. Thanks a lot for pushing this forward, Derick. Do let me know if you folks have any feedback or concerns about the PR, I'll be happy to address them. Cheers, Gabriel

Derick Rethans

3 years ago
On 13 July 2023 18:35:44 BST, Gabriel Fontes <hi@m7.rs> wrote:
>Hi everyone, > >PR author here. Thanks a lot for pushing this forward, Derick. >Do let me know if you folks have any feedback or concerns about the PR, I'll be happy to address them. > >Cheers, >Gabriel
Aa it seems nobody objected and feature freeze is this week, I'm going to merge this PR. cheers Derick

Ben Ramsey

3 years ago
> On Jul 17, 2023, at 09:25, Derick Rethans <derick@php.net> wrote: > > On 13 July 2023 18:35:44 BST, Gabriel Fontes <hi@m7.rs> wrote: >> Hi everyone, >> >> PR author here. Thanks a lot for pushing this forward, Derick. >> Do let me know if you folks have any feedback or concerns about the PR, I'll be happy to address them. >> >> Cheers, >> Gabriel > Aa it seems nobody objected and feature freeze is this week, I'm going to merge this PR.
Did you see this other thread that somehow got created separate from this thread? https://externals.io/message/120811 Cheers, Ben

Derick Rethans

3 years ago
On 17 July 2023 17:40:06 BST, Ben Ramsey <ben@benramsey.com> wrote:
>> On Jul 17, 2023, at 09:25, Derick Rethans <derick@php.net> wrote: >> >> On 13 July 2023 18:35:44 BST, Gabriel Fontes <hi@m7.rs> wrote: >>> Hi everyone, >>> >>> PR author here. Thanks a lot for pushing this forward, Derick. >>> Do let me know if you folks have any feedback or concerns about the PR, I'll be happy to address them. >>> >>> Cheers, >>> Gabriel >> Aa it seems nobody objected and feature freeze is this week, I'm going to merge this PR. > > >Did you see this other thread that somehow got created separate from this thread? > >https://externals.io/message/120811
I did. But that deals with an issue that is already present in the current implementation. This PR does not effect that at all. cheers Derick