Bug #68024 [Opn->Fbk]: INI/ENV settings get prepended instead of appended

From: Date: Sun, 15 Jan 2017 07:15:05 +0000
Subject: Bug #68024 [Opn->Fbk]: INI/ENV settings get prepended instead of appended
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-206630@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=68024&edit=1 ID: 68024 Updated by: krakjoe@php.net Reported by: manuel-php at mausz dot at Summary: INI/ENV settings get prepended instead of appended -Status: Open +Status: Feedback Type: Bug Package: FPM related PHP Version: Irrelevant Block user comment: N Private report: N New Comment: We are awaiting a new patch for supported version of PHP, as mentioned in the (closed) PR. Previous Comments: ------------------------------------------------------------------------ [2014-10-09 01:54:55] datibbaw@php.net Thanks for the proposed patch, but abusing a doubly linked list is scary stuff, so I've opted to add a simple structure to keep track of both head and tail. ------------------------------------------------------------------------ [2014-09-16 08:59:22] manuel-php at mausz dot at The attached patch works around this by appending the setting at the end of the key-value list. I've modified the linked list so it's a circular double linked list with the exception that the tail is not linked to the head (but head to tail). This way appending is still fast and there are no changes to the traversals. An alternative approach would be to replace the list with a Zend HashTable. I can also create a pull request on GitHub if that's preferred. ------------------------------------------------------------------------ [2014-09-16 08:50:59] manuel-php at mausz dot at Description: ------------ During parsing the config FPM files FPM prepends new settings instead of appending (or replacing) them. This way it's impossible to override a previously defined setting. e.g. overriding a global setting with a pool specific. The only way this is possible is to define the setting before including global settings, which is somewhat unexpected behavior. Additional this behavior only applies to environment variables and INI settings. Test script: --------------- # cat fpm.d/test.conf [test] prefix = /var/www/$pool user = $pool pm = ondemand env[TMP] = foo env[TMP] = bar Expected result: ---------------- [16-Sep-2014 10:50:10] NOTICE: env[TMP] = foo [16-Sep-2014 10:50:10] NOTICE: env[TMP] = bar Actual result: -------------- [16-Sep-2014 10:50:10] NOTICE: env[TMP] = bar [16-Sep-2014 10:50:10] NOTICE: env[TMP] = foo ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=68024&edit=1

« previous php.bugs (#206630) next »