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

From: Date: Tue, 16 Sep 2014 08:59:23 +0000
Subject: Bug #68024 [Opn]: INI/ENV settings get prepended instead of appended
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-187545@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 User updated by: manuel-php at mausz dot at Reported by: manuel-php at mausz dot at Summary: INI/ENV settings get prepended instead of appended Status: Open Type: Bug Package: FPM related PHP Version: Irrelevant Block user comment: N Private report: N New Comment: 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. Previous Comments: ------------------------------------------------------------------------ [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 (#187545) next »