How To Install php-flow-jsonpath on CentOS 7

In this tutorial we learn how to install php-flow-jsonpath on CentOS 7. php-flow-jsonpath is JSONPath implementation for parsing, searching and flattening

Introduction

In this tutorial we learn how to install php-flow-jsonpath on CentOS 7.

What is php-flow-jsonpath

This is a JSONPath [1] implementation for PHP based on Stefan Goessner’s JSONPath script. JSONPath is an XPath-like expression language for filtering, flattening and extracting data. I believe that is improves on the original script (which was last updated in 2007) by doing a few things * Object-oriented code (should be easier to manage or extend in future) * Expressions are parsed into tokens using some code cribbed from Doctrine Lexer and cached * There is no eval() in use * Performance is pretty much the same * Any combination of objects/arrays/ArrayAccess-objects can be used as the data input which is great if you’re de-serializing JSON in to objects or if you want to process your own data structures. Autoloader [1] http

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

Install php-flow-jsonpath 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-flow-jsonpath using yum by running the following command:

sudo yum -y install php-flow-jsonpath

Install php-flow-jsonpath 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-flow-jsonpath using dnf by running the following command:

sudo dnf -y install php-flow-jsonpath

How To Uninstall php-flow-jsonpath on CentOS 7

To uninstall only the php-flow-jsonpath package we can use the following command:

sudo dnf remove php-flow-jsonpath

References

Summary

In this tutorial we learn how to install php-flow-jsonpath on CentOS 7 using yum and dnf.