Page 1 of 1

pear xml beautifier deprecated?

Posted: Sun May 15, 2011 10:34 am
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?

Re: pear xml beautifier deprecated?

Posted: Mon May 16, 2011 12:07 pm
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.

Re: pear xml beautifier deprecated?

Posted: Tue May 17, 2011 4:57 pm
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"?

Re: pear xml beautifier deprecated?

Posted: Wed May 18, 2011 8:58 am
by Jade
Then you need to contact your hosting provider. Most places will fix/upgrade the packages or install an alternative for you.