pear xml beautifier deprecated?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
pedrotuga
Forum Contributor
Posts: 249
Joined: Tue Dec 13, 2005 11:08 pm

pear xml beautifier deprecated?

Post by pedrotuga »

I am trying to use pear's xml beautifier, but it appears to become deprecated.

The following code

Code: Select all

$xmlstring = <<<EOD
<root>
<at>foo</at>
<att>bar</att>
</root>
EOD;

require_once "XML/Beautifier.php";
$beautifier = new XML_Beautifier();
$result = $beautifier->formatString($xmlstring);
originates the following error/warning messages

Code: Select all

Deprecated: Assigning the return value of new by reference is deprecated in G:\xampp\php\PEAR\XML\Beautifier.php on line 380

Strict Standards: Redefining already defined constructor for class XML_Parser in G:\xampp\php\PEAR\XML\Parser.php on line 227

Deprecated: Assigning the return value of new by reference is deprecated in G:\xampp\php\PEAR\XML\Parser.php on line 616

Strict Standards: Declaration of XML_Parser::raiseError() should be compatible with that of PEAR::raiseError() in G:\xampp\php\PEAR\XML\Parser.php on line 117

Strict Standards: Declaration of XML_Beautifier_Tokenizer::startHandler() should be compatible with that of XML_Parser::startHandler() in G:\xampp\php\PEAR\XML\Beautifier\Tokenizer.php on line 71

Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in G:\xampp\php\PEAR\XML\Beautifier.php on line 337

Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in G:\xampp\php\PEAR\XML\Beautifier.php on line 343

Strict Standards: Non-static method XML_Util::createStartElement() should not be called statically, assuming $this from incompatible context in G:\xampp\php\PEAR\XML\Beautifier\Renderer\Plain.php on line 163

Strict Standards: Non-static method XML_Util::attributesToString() should not be called statically, assuming $this from incompatible context in G:\xampp\php\PEAR\XML\Util.php on line 731

Strict Standards: Non-static method XML_Util::createTag() should not be called statically, assuming $this from incompatible context in G:\xampp\php\PEAR\XML\Beautifier\Renderer\Plain.php on line 156

Strict Standards: Non-static method XML_Util::createTagFromArray() should not be called statically, assuming $this from incompatible context in G:\xampp\php\PEAR\XML\Util.php on line 524

Strict Standards: Non-static method XML_Util::attributesToString() should not be called statically, assuming $this from incompatible context in G:\xampp\php\PEAR\XML\Util.php on line 652

Strict Standards: Non-static method XML_Util::replaceEntities() should not be called statically, assuming $this from incompatible context in G:\xampp\php\PEAR\XML\Util.php on line 664

Strict Standards: Non-static method XML_Util::createTag() should not be called statically, assuming $this from incompatible context in G:\xampp\php\PEAR\XML\Beautifier\Renderer\Plain.php on line 156

Strict Standards: Non-static method XML_Util::createTagFromArray() should not be called statically, assuming $this from incompatible context in G:\xampp\php\PEAR\XML\Util.php on line 524

Strict Standards: Non-static method XML_Util::attributesToString() should not be called statically, assuming $this from incompatible context in G:\xampp\php\PEAR\XML\Util.php on line 652

Strict Standards: Non-static method XML_Util::replaceEntities() should not be called statically, assuming $this from incompatible context in G:\xampp\php\PEAR\XML\Util.php on line 664

Strict Standards: Non-static method XML_Util::createTag() should not be called statically, assuming $this from incompatible context in G:\xampp\php\PEAR\XML\Beautifier\Renderer\Plain.php on line 156

Strict Standards: Non-static method XML_Util::createTagFromArray() should not be called statically, assuming $this from incompatible context in G:\xampp\php\PEAR\XML\Util.php on line 524

Strict Standards: Non-static method XML_Util::attributesToString() should not be called statically, assuming $this from incompatible context in G:\xampp\php\PEAR\XML\Util.php on line 652

Strict Standards: Non-static method XML_Util::replaceEntities() should not be called statically, assuming $this from incompatible context in G:\xampp\php\PEAR\XML\Util.php on line 664

Strict Standards: Non-static method XML_Util::createTag() should not be called statically, assuming $this from incompatible context in G:\xampp\php\PEAR\XML\Beautifier\Renderer\Plain.php on line 156

Strict Standards: Non-static method XML_Util::createTagFromArray() should not be called statically, assuming $this from incompatible context in G:\xampp\php\PEAR\XML\Util.php on line 524

Strict Standards: Non-static method XML_Util::attributesToString() should not be called statically, assuming $this from incompatible context in G:\xampp\php\PEAR\XML\Util.php on line 652

Strict Standards: Non-static method XML_Util::replaceEntities() should not be called statically, assuming $this from incompatible context in G:\xampp\php\PEAR\XML\Util.php on line 664

Strict Standards: Non-static method XML_Util::createTag() should not be called statically, assuming $this from incompatible context in G:\xampp\php\PEAR\XML\Beautifier\Renderer\Plain.php on line 156

Strict Standards: Non-static method XML_Util::createTagFromArray() should not be called statically, assuming $this from incompatible context in G:\xampp\php\PEAR\XML\Util.php on line 524

Strict Standards: Non-static method XML_Util::attributesToString() should not be called statically, assuming $this from incompatible context in G:\xampp\php\PEAR\XML\Util.php on line 652

Strict Standards: Non-static method XML_Util::replaceEntities() should not be called statically, assuming $this from incompatible context in G:\xampp\php\PEAR\XML\Util.php on line 664

Strict Standards: Non-static method XML_Util::createEndElement() should not be called statically, assuming $this from incompatible context in
Am I doing something wrong in here?
If not, how do I mitigate this? Alternatives?
User avatar
Jade
Forum Regular
Posts: 908
Joined: Sun Dec 29, 2002 5:40 pm
Location: VA

Re: pear xml beautifier deprecated?

Post by Jade »

All you need to do is update the code so it's not deprecated anymore. For instance, line 380 means there's an ampersand (&) in front of the word "new" that you need to remove.
User avatar
pedrotuga
Forum Contributor
Posts: 249
Joined: Tue Dec 13, 2005 11:08 pm

Re: pear xml beautifier deprecated?

Post by pedrotuga »

That won't help as I am going to deploy the application a shared hosting account and have no control over pear modules.

But is the answer: "yes, it's deprecated"?
User avatar
Jade
Forum Regular
Posts: 908
Joined: Sun Dec 29, 2002 5:40 pm
Location: VA

Re: pear xml beautifier deprecated?

Post by Jade »

Then you need to contact your hosting provider. Most places will fix/upgrade the packages or install an alternative for you.
Post Reply