Files
Investidor-V2/tools/portal-functional-destination-services-readonly.php
T
nala 287e991486
tests / ci (push) Waiting to run
oportunidades 7
2026-10-13 11:40:29 +02:00

8 lines
1.7 KiB
PHP

<?php
// Query the scanner health using only an allowlist of active settings; no active app/DB boot.
$root=dirname(__DIR__);$dir=$root.'/storage/app/private/investmoz-v2/portal-audit';$plan=json_decode(file_get_contents($dir.'/portal-stability-latest.json'),true,512,JSON_THROW_ON_ERROR);putenv('STABILITY_QA_MODE=consumers');$app=(static fn(string $file)=>require $file)($plan['source'].'/tools/portal-stability-runtime.php');
$env=Dotenv\Dotenv::parse(file_get_contents($root.'/.env'));$settings=[];
foreach(['MALWARE_SCANNER','CLAMD_HOST','CLAMD_PORT','CLAMD_MAX_SIGNATURE_AGE_HOURS','QUEUE_CONNECTION']as$name)if(isset($env[$name]))$settings[$name]=$env[$name];
config(['services.malware.scanner'=>$settings['MALWARE_SCANNER']??'clamd','services.malware.host'=>$settings['CLAMD_HOST']??'127.0.0.1','services.malware.port'=>(int)($settings['CLAMD_PORT']??3310),'services.malware.max_signature_age_hours'=>(int)($settings['CLAMD_MAX_SIGNATURE_AGE_HOURS']??48)]);
$health=app(App\Services\Malware\MalwareScanner::class)->health();$proof=['at'=>gmdate('c'),'scope'=>'Existing destination scanner health only; active DB not bootstrapped','scanner_settings'=>$settings,'ClamD'=>$health,'queue_connection'=>$settings['QUEUE_CONNECTION']??'database','active_writes'=>0,'worker_service_not_inferred_from_queue_config'=>true];$receipt=in_array('--upgrade',$argv,true)?'workflow-upgrade-destination-services-readonly-20261011.json':(in_array('--scope',$argv,true)?'functional-scope-destination-services-readonly-20261011.json':'functional-destination-services-readonly-20261011.json');file_put_contents($dir.'/'.$receipt,json_encode($proof,JSON_PRETTY_PRINT|JSON_THROW_ON_ERROR));echo json_encode($proof,JSON_THROW_ON_ERROR).PHP_EOL;