#23690 [Asn->Csd]: Config_Container::toArray() Bug + FIX :-)

From: Date: Sun, 15 Jun 2003 01:04:20 +0000
Subject: #23690 [Asn->Csd]: Config_Container::toArray() Bug + FIX :-)
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-17473@lists.php.net to get a copy of this message
ID: 23690 Updated by: mansion@php.net Reported By: info at rhalff dot com -Status: Assigned +Status: Closed Bug Type: PEAR related Operating System: All PHP Version: 4.3.2RC3 Assigned To: mansion New Comment: This bug has been fixed in CVS. In case this was a PHP problem, snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. In case this was a documentation problem, the fix will show up soon at http://www.php.net/manual/. In case this was a PHP.net website problem, the change will show up on the PHP.net site and on the mirror sites in short time. Thank you for the report, and for helping us make PHP better. Previous Comments: ------------------------------------------------------------------------ [2003-05-19 13:30:37] info at rhalff dot com Ok, so that's kind of excpected behaviour then. To me te fix seems to work, there's only one unlogical thing left in there. if (isset($array[$this->name][$key])) { // duplicate name/type ....... } elseif (isset($array[$this->name][$key][0])) { The elseif will never be reached, since isset($array[$this->name][$key]) will always be true first. ------------------------------------------------------------------------ [2003-05-19 12:16:29] mansion@php.net Inicommented uses my own parser. Inifile uses the php function parse_ini_file() which is very fast but not as complete. My parser is quite slow but keeps track of comments, blank lines, duplicates... I don't think parse_ini_file() allows duplicate entries. ------------------------------------------------------------------------ [2003-05-19 10:37:44] info at rhalff dot com Ok your right, with the test code I gave for reproduction of this bug the fix works. But if I change the type from 'inicommented' to 'inifile' the array will only contain 1 'extension'. Is this expected behaviour or a bug ? ------------------------------------------------------------------------ [2003-05-19 10:11:22] info at rhalff dot com Ok.. my fix doesn't work either :| ------------------------------------------------------------------------ [2003-05-19 10:01:18] mansion@php.net > Hmm your fix will cause: > [PHP] > extension = bcmath.so > extension = bz2.so > extension = calendar.so > extension = cdpf.so > extension = crack.so > extension = curl.so Array ( [root] => Array ( [PHP] => Array ( [extension] => curl.so ) ) ) No it won't, you should test it. But I will wait to see if you can come up with a better solution before I commit anything. Let me know, Thanks. ------------------------------------------------------------------------ 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 http://bugs.php.net/23690 -- Edit this bug report at http://bugs.php.net/?id=23690&edit=1

« previous php.pear.dev (#17473) next »