Req #67331 [Opn->Csd]: Have parse_ini_file add empty entries

From: Date: Sat, 15 Sep 2018 14:01:51 +0000
Subject: Req #67331 [Opn->Csd]: Have parse_ini_file add empty entries
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-217068@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=67331&edit=1 ID: 67331 Updated by: cmb@php.net Reported by: philip@php.net Summary: Have parse_ini_file add empty entries -Status: Open +Status: Closed Type: Feature/Change Request Package: *Configuration Issues PHP Version: 5.6.0beta3 -Assigned To: +Assigned To: cmb Block user comment: N Private report: N New Comment: The PR has been applied[1] – closing. [1] <http://git.php.net/?p=php-src.git;a=commit;h=3f3e914df33793a36f51b4e44745d6a5aec4f685> Previous Comments: ------------------------------------------------------------------------ [2018-08-28 15:39:14] cmb@php.net <https://github.com/php/php-src/pull/3473> submitted. ------------------------------------------------------------------------ [2014-07-03 23:10:43] philip@php.net Automatic comment from SVN on behalf of philip Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=334105 Log: Mention that entries without an equal sign are ignored. Recent feature request PHP Bug #67331 requests this functionality. ------------------------------------------------------------------------ [2014-06-16 14:12:14] felipe@php.net You just missed a simple change: -LABEL [^=\n\r\t;|&$~(){}!"\[]+ +LABEL [^=\n\r\t;|&$~(){}!"\[\000]+ ------------------------------------------------------------------------ [2014-05-23 03:53:33] aharvey@php.net I spiked a quick patch for this: https://github.com/LawnGnome/php-src/compare/php:93a98202d0e8d0f2bfdf4392a4baf2301e343985...bug67331?expand=1 There's one issue, though, which causes the new test to fail: a bare option on the last line of input isn't parsed. This appears to be an issue somewhere in the lexer and/or parser, as the callback is never called to process the input, but my lexer/parser-fu is not good enough to discern why. Help is needed! Beyond that, we'd have to figure out if we would need to hide this behind an option, given potential BC concerns, although my feeling is that this is safe enough for master. ------------------------------------------------------------------------ [2014-05-23 02:39:24] philip@php.net Johannes pointed out another example. Python allows the "No value" style, as documented here: https://docs.python.org/3/library/configparser.html#supported-ini-file-structure Also, assigned value for these is worth discussing, as perhaps no value entries should be defined as NULL instead of ""? In that case, the expected results would be: array(3) { ["foo"]=> string(3) "bar" ["auto-refresh"]=> NULL ["baz"]=> string(0) "" } ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=67331 -- Edit this bug report at https://bugs.php.net/bug.php?id=67331&edit=1

« previous php.bugs (#217068) next »