How To Install php-pear-XML-Beautifier on CentOS 7

In this tutorial we learn how to install php-pear-XML-Beautifier on CentOS 7. php-pear-XML-Beautifier is Class to format XML documents

Introduction

In this tutorial we learn how to install php-pear-XML-Beautifier on CentOS 7.

What is php-pear-XML-Beautifier

XML_Beautifier is a package, that helps you making XML documents easier to read for human beings. It is able to add line-breaks, indentation, sorts attributes, convert tag cases and wraps long comments. It recognizes tags, character data, comments, XML declarations, processing instructions and external entities and is able to format these tokens nicely. The document is split into these tokens using the XML_Beautifier_Tokenizer class and the expat parser. Then a renderer is used to create the string representation of the document and formats it using the specified options. Currently only one renderer is available, but as XML_Beautifier uses a driver-based architecture, other renderers (like syntax-highlighting) will follow soon.

We can use yum or dnf to install php-pear-XML-Beautifier on CentOS 7. In this tutorial we discuss both methods but you only need to choose one of method to install php-pear-XML-Beautifier.

Install php-pear-XML-Beautifier on CentOS 7 Using yum

Update yum database with yum using the following command.

sudo yum makecache

After updating yum database, We can install php-pear-XML-Beautifier using yum by running the following command:

sudo yum -y install php-pear-XML-Beautifier

Install php-pear-XML-Beautifier on CentOS 7 Using dnf

If you don’t have dnf installed you can install DNF on CentOS 7 first. Update yum database with dnf using the following command.

sudo dnf makecache

After updating yum database, We can install php-pear-XML-Beautifier using dnf by running the following command:

sudo dnf -y install php-pear-XML-Beautifier

How To Uninstall php-pear-XML-Beautifier on CentOS 7

To uninstall only the php-pear-XML-Beautifier package we can use the following command:

sudo dnf remove php-pear-XML-Beautifier

References

Summary

In this tutorial we learn how to install php-pear-XML-Beautifier on CentOS 7 using yum and dnf.