16 lines
1.9 KiB
PHP
16 lines
1.9 KiB
PHP
<?php
|
|
require __DIR__.'/boot-QA.php';
|
|
use Illuminate\Support\Facades\DB;
|
|
use Illuminate\Support\Facades\Crypt;
|
|
$id='025cce5b-73c1-43a3-b969-dc6e592bc28d';$zone='0ae14c9a-1adb-4ee7-8094-d5d54d4e75f1';
|
|
$d=DB::table('documents')->where('id',$id)->firstOrFail();
|
|
if($d->file_name!=='synthetic-qa-proof.txt'||$d->status!=='active'||$d->malware_scan_status!=='clean'||trim($d->sha256)!==$d->malware_scanned_sha256)throw new RuntimeException('Existing authorized synthetic support required');
|
|
$from='C:/Users/macbook/.config/investmoz/referencias-economicas-QA-20261016/source/storage/app/private/'.$d->storage_key;
|
|
$stored=file_get_contents($from);$bytes=$d->storage_encryption==='laravel'?Crypt::decryptString($stored):$stored;
|
|
if(hash('sha256',$bytes)!==trim($d->sha256))throw new RuntimeException('Support bytes mismatch');
|
|
$to=$source.'/storage/app/private/'.$d->storage_key;if(!is_dir(dirname($to)))mkdir(dirname($to),0700,true);file_put_contents($to,$stored);
|
|
if(DB::table('investment_zone_attachments')->where('document_id',$id)->exists())throw new RuntimeException('Preserve prior attachment');
|
|
$attachment=(string)Illuminate\Support\Str::uuid();
|
|
DB::table('investment_zone_attachments')->insert(['id'=>$attachment,'zone_id'=>$zone,'document_id'=>$id,'kind'=>'other','caption'=>'SIMULAÇÃO QA — suporte existente reutilizado','source_reference'=>'Synthetic QA proof; no operational/legal validity','rights_status'=>'pending','personal_data_status'=>'unknown','review_status'=>'pending','uploaded_by'=>2,'version_no'=>1,'created_at'=>now(),'updated_at'=>now()]);
|
|
file_put_contents(__DIR__.'/SUPORTE-QA.json',json_encode(['document_id'=>$id,'attachment_id'=>$attachment,'sha256'=>trim($d->sha256),'bytes_verified'=>true,'existing_clean_scan_reused'=>true,'publicly_selected'=>false,'fixture_only'=>true,'uploads'=>0],JSON_PRETTY_PRINT));echo 'Existing synthetic support privately linked in clone; no upload/publication';
|