3 lines
1.5 KiB
PHP
3 lines
1.5 KiB
PHP
<?php
|
|
ini_set('zend.exception_ignore_args','1');$root=dirname(__DIR__,2);require $root.'/vendor/autoload.php';$app=require $root.'/bootstrap/app.php';$app->make(Illuminate\Contracts\Console\Kernel::class)->bootstrap();$c=config('database.connections.'.config('database.default'));if($c['database']!=='investemoz'||(int)$c['port']!==5432)throw new RuntimeException('Destination guard');use Illuminate\Support\Facades\DB;DB::beginTransaction();DB::statement('SET TRANSACTION READ ONLY');try{$rows=DB::table('documents as d')->join('portal_resources as r','r.document_id','=','d.id')->whereIn('d.external_id',['legacy-tempo-post-171985-20260420','legacy-tempo-agronegocio-image-5e3840705cf98226'])->get(['d.id','d.external_id','d.sha256','d.status','d.storage_key','d.data_classification','d.rights_status','d.malware_scan_status','d.malware_scanned_sha256','r.id as resource_id','r.published','r.metadata_version']);if($rows->count()!==2)throw new RuntimeException('Need exactly two originals');foreach($rows as$x){if($x->malware_scan_status!=='clean'||trim($x->sha256)!==$x->malware_scanned_sha256||$x->published||$x->data_classification!=='internal')throw new RuntimeException('Scan/private state mismatch');}$v=['at'=>gmdate('c'),'target'=>'investemoz:5432','SQL_read_only'=>true,'result'=>'two exact clean originals, still private and unpublished','resources'=>$rows];file_put_contents(__DIR__.'/SCAN-PRIVATE-VERIFIED.json',json_encode($v,JSON_PRETTY_PRINT|JSON_THROW_ON_ERROR));echo json_encode($v);}finally{DB::rollBack();}
|