PEAR::Config, PHP5 and XML problems
| From: | Lance O'Connor | Date: | Thu, 26 Feb 2004 06:20:31 +0000 |
| Subject: | PEAR::Config, PHP5 and XML problems | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-10948@lists.php.net to get a copy of this message | ||
I'm having a problem with Config, PHP5 and XML files. Everything works fine with PHP 4.3.4 but it doesn't work with PHP5.
parseConfig generates errors relating the the various handlers (startHandler, cdataHandler, endHandler). Since these handlers are just stub functions (return NULL;) in the XML_Parser class and are actally implemented in the Config/Container/XML.php config.
The samle code, XML file, and outputs are below. I could really use some help on this, or another solution to parse my XML config files.
Regards,
Lance O'Connor
lance@monkeymental.com
Sample Code:
<?
require_once('Config.php');
$Config = new Config();
$root =& $Config->parseConfig('./graphics.xml', 'xml');
print_r($root);
?>
XML File:
<?xml version="1.0" encoding="ISO-8859-1"?>
<switch>
<row>
<port type="RJ">FastEthernet0/1</port>
</row>
</switch>
PHP 4.3.4 Output:
PHP 4.3.4 (cli) (built: Jan 16 2004 21:49:20)
Copyright (c) 1997-2003 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2003 Zend Technologies
config_container Object
(
[type] => section
[name] => root
[content] =>
[children] => Array
(
[0] => config_container Object
(
[type] => section
[name] => switch
[content] =>
[children] => Array
<snip> [_id] => switchsection403d8ed8101a30.86454393
)
)
[parent] =>
[attributes] =>
[_id] => rootsection403d8ed80d8a90.51860680
)
PHP 5.0.0b4 Output:
PHP 5.0.0b4 (cli) (built: Feb 22 2004 21:45:34)
Copyright (c) 1997-2004 The PHP Group
Zend Engine v2.0.0-dev, Copyright (c) 1998-2004 Zend Technologies
PHP Warning: xml_parse(): Unable to call handler startHandler() in /usr/local/lib/php/XML/Parser.php on line 265
PHP Warning: xml_parse(): Unable to call handler cdataHandler() in /usr/local/lib/php/XML/Parser.php on line 265
PHP Warning: xml_parse(): Unable to call handler startHandler() in /usr/local/lib/php/XML/Parser.php on line 265
PHP Warning: xml_parse(): Unable to call handler cdataHandler() in /usr/local/lib/php/XML/Parser.php on line 265
PHP Warning: xml_parse(): Unable to call handler startHandler() in /usr/local/lib/php/XML/Parser.php on line 265
PHP Warning: xml_parse(): Unable to call handler cdataHandler() in /usr/local/lib/php/XML/Parser.php on line 265
PHP Warning: xml_parse(): Unable to call handler endHandler() in /usr/local/lib/php/XML/Parser.php on line 265
PHP Warning: xml_parse(): Unable to call handler cdataHandler() in /usr/local/lib/php/XML/Parser.php on line 265
PHP Warning: xml_parse(): Unable to call handler endHandler() in /usr/local/lib/php/XML/Parser.php on line 265
PHP Warning: xml_parse(): Unable to call handler cdataHandler() in /usr/local/lib/php/XML/Parser.php on line 265
PHP Warning: xml_parse(): Unable to call handler endHandler() in /usr/local/lib/php/XML/Parser.php on line 265
Config_Container Object
(
[type] => section
[name] => root
[content] =>
[children] =>
[parent] =>
[attributes] =>
[_id] => rootsection403d8e8ebdcb55.14334544
)