Files
Investidor-V2/tools/portal-profile-installation-status-qa.php
nala 01405cbf8a
tests / ci (push) Canceled after 0s
oportunidades 5
2026-10-10 14:15:28 +02:00

24 lines
1.3 KiB
PHP

<?php
use App\Services\PortalProfileInstallation;
use Illuminate\Contracts\Console\Kernel;
use Illuminate\Support\Facades\DB;
require dirname(__DIR__).'/vendor/autoload.php';
require __DIR__.'/portal-qa-environment.php';
$target = portalQaEnvironment();
$app = require dirname(__DIR__).'/bootstrap/app.php';
$app->make(Kernel::class)->bootstrap();
portalQaAssertTarget($target);
$proof = DB::transaction(function () use ($target) {
DB::statement('SET TRANSACTION READ ONLY');
return ['target' => $target, 'code_hash' => app(PortalProfileInstallation::class)->fingerprint(), 'captured_at' => gmdate('c'),
'schema_installed' => DB::table('migrations')->where('migration', PortalProfileInstallation::MIGRATION)->exists(),
'users' => DB::table('users')->count(), 'grants' => DB::table('portal_role_assignments')->count(),
'pair_hash' => hash('sha256', json_encode(DB::table('portal_superuser_pair')->first(), JSON_THROW_ON_ERROR)),
'active_manifest_sha256' => hash_file('sha256', public_path('build/manifest.json')), 'active_writes' => 0];
});
file_put_contents(storage_path('app/private/investmoz-v2/portal-audit/profile-installation-status-qa.json'), json_encode($proof, JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR));
echo json_encode($proof, JSON_THROW_ON_ERROR).PHP_EOL;