(Fwd) Re: PEAR::Config, PHP5 and XML problems
| From: | Stefan Neufeind | Date: | Sat, 28 Feb 2004 18:59:47 +0000 |
| Subject: | (Fwd) Re: PEAR::Config, PHP5 and XML problems | ||
| Groups: | php.pear.dev | ||
| Request: | Send a blank email to pear-dev+get-25958@lists.php.net to get a copy of this message | ||
Volunteers for php5-changes to Config? Maybe a working version is
possible even without using the "advanced" php5-features, for the
moment. Would require some testing ...
Stefan
------- Forwarded message follows -------
Date sent: Thu, 26 Feb 2004 10:11:52 +0100
From: Bertrand Mansion <bmansion@mamasam.com>
To: Lance O'Connor <lance@monkeymental.com>,
<pear-general@lists.php.net>
Subject: Re: [PEAR] PEAR::Config, PHP5 and XML problems
[ Double-click this line for list subscription options ]
<lance@monkeymental.com> wrote :
> 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
> )
I am not surprised that Config does not work with PHP5. It will
probably need a complete rewrite as PHP5 adds new features needed by
Config and I had to find workarounds for them in PHP4.
The Config package will benefit a lot from the new PHP5 features,
especially the xml parser (will use simpleXML probably).
Unfortunately, I don't have the time to fix it now. Personally, I
don't have PHP5 installed yet. So you will have to find another way
to
parse your XML.
Bertrand Mansion
Mamasam
--
PEAR General Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
------- End of forwarded message -------