karakhanyans / comparison
Compare two Images, Texts or Files and get the difference.
1.0.1
2017-02-02 05:58 UTC
Requires
- php: ~5.6|~7.0
- illuminate/support: ~5.1
Requires (Dev)
- phpunit/phpunit: ~4.0||~5.0
- squizlabs/php_codesniffer: ^2.3
This package is auto-updated.
Last update: 2024-03-28 21:46:38 UTC
README
Compare two Images, Texts or Files.
Install
Via Composer
$ composer require karakhanyans/comparison
Usage
Add Service provider into providers array in config/app.php
Karakhanyans\Comparison\ComparisonServiceProvider::class,
$compare = new Compare(); echo $compare->images('path_to_first_image','path_to_second_image'); // will print difference percent echo $compare->files('path_to_first_file','path_to_second_file'); // after this you can use following actions echo $compare->differentWords(); // array with different words between two files echo $compare->differentWordsCount(); // count of different words echo $compare->differencePercent(); // difference in percent echo $compare->sameWords(); // array with same words echo $compare->sameWordsCount(); // count of same words echo $compare->showFormattedText(); // will print different words highlighted in text To compare texts you can use $compare->files() or $compare->texts();
##Configs
You can configure formatted styles, tags etc.
By default for highlighting plugin using <b> tag and #00BB00 color
To change that you should add configs before $compare->files();
$compare->tag('pre'); // will set tag to <pre>
$compare->style('color:#cccccc'); // will change highlighted color
$compare->class('className'); // class name
Change log
Please see CHANGELOG for more information on what has changed recently.
Testing
$ composer test
Contributing
Please see CONTRIBUTING and CONDUCT for details.
Security
If you discover any security related issues, please email karakhanyansa@gmail.com instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.