Gendiff compares two configuration files and shows a difference. It can be used both in terminal and as a library. Acceptable input file formats are JSON and YAML.
$ git clone https://github.com/davydovks/php-project-48.git
$ cd php-package-48
$ make installgenDiff(string $pathToFile1, string $pathToFile2, string $format = 'stylish'): string- pathToFile1 - Absolute or relative path to the first file to compare.
- pathToFile2 - Absolute or relative path to the second file to compare.
- format - Output format. Possible fromats: stylish, plain, json. Default value is 'stylish'.
<?php
use function Differ\Differ\genDiff;
$diff = genDiff($pathToFile1, $pathToFile2, $format);
print_r($diff);Usage:
gendiff [options] <firstFile> <secondFile>
Options:
-h, --help Show help screen
-v, --version Show version
-f, --format <fmt> Report format [default: stylish]