viktor/differ

Calculate differencies in config files. Second project in PHP proffession.

v0.1.2 2020-01-22 17:12 UTC

This package is auto-updated.

Last update: 2025-06-16 04:08:02 UTC


README

Description
Compare difference between configuration files. Supported files types:

  • JSON
  • YAML File should have appropriate extension to correctly interpret file type it - "json" or "yml".

Installation Can be installed globally with composer using

composer require global viktor/differ:*

or use function from library in your project

\Differ\Analyzer\genDiff($path1, $path2, $format)

Installation example
asciicast

Usage examples
Flat JSON
asciicast Flat YAML
asciicast Recursive JSON
asciicast Recursive YAML asciicast Output in JSON and plain format
asciicast

P.S. I have faced one trouble during writing project. I have ubuntu 18.04, and there is alreday gendiff file which can be called from any place (global). It is located in /usr/bin/gendiff. If you install my gendiff and will try to run it, you will/may run /usr/bin/gendiff. So, if you want to globally run my gendiff, you need to change order of PATHs in $PATH. I was able to do this by modifying file ~/.bashrc. There is a line like "PATH=$PATH" or "PATH=$PATH:$HOME/.composer/vendor/bin" if you already added composer bin path. Modify it like this "PATH=$HOME/.composer/vendor/bin:$PATH", reboot, and problem will be solved. It is possible that after some time /usr/bin/gendiff will be dicovered first. Reboot will help.