Bug #7695 [NEW]: Bug in ParseConfig
| From: | mike at powerondude dot com | Date: | Mon, 22 May 2006 15:18:22 +0000 |
| Subject: | Bug #7695 [NEW]: Bug in ParseConfig | ||
| Groups: | php.pear.doc | ||
| Request: | Send a blank email to pear-doc+get-7942@lists.php.net to get a copy of this message | ||
From: mike at powerondude dot com
Operating system: Linux
Package version:
PHP version: 5.1.4
Package: Documentation
Bug Type: Bug
Bug description: Bug in ParseConfig
Description:
------------
There appears to be a bug in Config / parseConfig. Using an XML storage
container, it allows you to create sections with spaces in it, but when
reading that config back in with parseConfig, it will throw an exception
in XML_Parse.
To use the example, take the space out between "Mikes" and "Laptop" and it
will not throw the exception.
Test script:
---------------
<?php
require_once 'Config.php';
$c = new Config();
$Section =& new Config_Container("section", "Config");
$Server =& $Section->CreateSection("Servers");
$Rad= & $Server->createSection("Mikes Laptop");
$Rad->createDirective("port", "9000");
$Rad->createDirective("mgmtport", "8000");
$c->setRoot($Section);
$c->writeConfig("test.xml", "XML");
$testconfig = new Config();
$root = $testconfig->parseConfig("test.xml", "XML");
$TENConfig=($root->toArray());
var_dump($TENConfig);
?>
Expected result:
----------------
It should either throw an error on writing the XML file with the space or
the parser should handle the space on reading the file back in.
Actual result:
--------------
Fatal error: Call to undefined method XML_Parser_Error::toArray() in
/var/www/html/xmltest.php on line 21
--
Edit bug report at http://pear.php.net/bugs/bug.php?id=7695&edit=1
--