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: 2024-04-16 01:50:06 UTC


README

68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f31393833376438623363343636343836346135632f6d61696e7461696e6162696c697479 68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f31393833376438623363343636343836346135632f746573745f636f766572616765 68747470733a2f2f7472617669732d63692e6f72672f766974656b2d6d6f2f7068702d70726f6a6563742d6c766c322e7376673f6272616e63683d6d6173746572

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.