viktor / differ
Calculate differencies in config files. Second project in PHP proffession.
Requires
- docopt/docopt: ^1.0
- funct/funct: ^1.5
- symfony/yaml: ^5.0
Requires (Dev)
- phpunit/phpunit: ^8.5
- squizlabs/php_codesniffer: ^3.5
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)
Usage examples
Flat JSON
Flat YAML
Recursive JSON
Recursive YAML
Output in JSON and plain format
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.