Home » XML » XML_Serializer » Bug #3444
undefined method in unserializer
Details
| Submitted | 2005-02-12 15:43 UTC |
|---|---|
| From | joe-xmls at 1db dot com |
| Status | Bogus |
| Package | XML_Serializer |
| PHP Version | 5.0.3 |
| OS | RHEL3 |
| Roadmaps | (Not assigned) |
Comments
[2005-02-12 15:43 UTC] joe-xmls at 1db dot com
Description:
------------
I was just testing with a demo from http://
www.melonfire.com/community/columns/trog/article.php?
id=244&page=8.
I get an error:
Fatal error: Call to undefined method XML_Parser::
setHandlerObj() in /usr/local/lib/php/XML/
Unserializer.php on line 562
thanks
Reproduce code:
---------------
$library="<?xml version='1.0'?>
<library>
<book>
<title>The Adventures of Sherlock Holmes</title>
<author>Arthur Conan Doyle</author>
<price>24.95</price>
</book>
</library>";
include("XML/Unserializer.php");
$unserializer = &new XML_Unserializer();
$result = $unserializer->unserialize($library);
print_r($data = $unserializer->getUnserializedData());
[2005-02-12 22:15 UTC] joe-xmls at 1db dot com
I think I have the latest versions:
Installed packages:
===================
Package Version State
XML_Parser 1.2.4 stable
XML_RPC 1.1.0 stable
XML_Serializer 0.15.0 beta
XML_Util 1.1.1 stable
It serializes fine. I've tried to unserialize as an array and object and still the same error. Any other suggestions?
[2005-02-13 20:45 UTC] joe-xmls at 1db dot com
Bingo, thank you for getting me on the right track. I know very little about pear and even less about php5. It looks like when I installed php5 it made a new pear dir at /usr/local/lib/php. My php4 pear dir is at /usr/lib/php. Both php4 and php5 have the include path set to ".:/usr/lib/php:/usr/local/lib/php". I deleted the old /usr/lib/php and made it a link to /usr/local/lib/php and that fixed it. Sorry for the trouble. This is a great script by the way. I tried to use php's serialize but it is very complicated to get serialized data in and out of a database without breaking the serialization or the query with quotes.
Thanks again