Initial commit
Build / run (push) Has been cancelled

This commit is contained in:
maher
2026-05-14 13:42:10 +02:00
commit 511fad8199
4595 changed files with 385164 additions and 0 deletions
+38
View File
@@ -0,0 +1,38 @@
<?php
namespace Common\Core\Commands;
use File;
use Illuminate\Console\Command;
use Str;
class GenerateChecksums extends Command
{
/**
* @var string
*/
protected $signature = 'checksums:generate';
public function handle(): int
{
$rootPath = base_path();
$allFiles = File::allFiles($rootPath);
$bar = $this->output->createProgressBar(count($allFiles));
$bar->start();
$checksums = [];
foreach ($allFiles as $file) {
if (Str::startsWith($file->getFilename(), '.')) {
continue;
}
$relativePath = str_replace($rootPath, '', $file->getPathname());
$checksums[$relativePath] = md5_file($file);
$bar->advance();
}
file_put_contents("$rootPath/checksums.json", json_encode($checksums));
$bar->finish();
return 0;
}
}