PHP code example of bluetree-service / duplicate-detector-lib
1. Go to this page and download the library: Download bluetree-service/duplicate-detector-lib library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
bluetree-service / duplicate-detector-lib example snippets
use BlueDuplicateDetector\Command\DuplicatedFilesCommand;
use Symfony\Component\Console\Application;
$application = new Application();
$application->addCommand(new DuplicatedFilesCommand('duplicate', ['/duplicates'], '/out', [
'host' => 'redis',
'password' => \getenv('REDIS_PASSWORD') ?: null,
]));
$application->run();
use BlueDuplicateDetector\{Scanner, Grouper};
use BlueDuplicateDetector\Hasher\{Threads, FileTransport, RedisTransport};
use BlueDuplicateDetector\Progress\NullProgress;
$files = (new Scanner(minSize: 1, sameSizeOnly: true, exclude: ['.git'], Group[]: key, files, sizes, size