filesize($to),'sha256'=>hash_file('sha256',$to)];}} $scanner=app(MalwareScanner::class);$health=$scanner->health(); if($health['signatures_at']!==null)$health['signatures_at']=$health['signatures_at']->format(DATE_ATOM); $scans=[]; foreach([1,2,3] as $level){$name='moz-adm'.$level.'-ine-20190607.geojson';$f=$directory.'/'.$name; $scan=$scanner->scan($f,filesize($f),storage_path('app/private')); if($scan['signatures_at']!==null)$scan['signatures_at']=$scan['signatures_at']->format(DATE_ATOM); $scans[]=['file'=>$name,'sha256'=>$files[$name]['sha256'],'scan'=>$scan];} file_put_contents($directory.'/geometry-source-scans.json',json_encode(['captured_at'=>gmdate('c'),'files'=>$scans],JSON_PRETTY_PRINT|JSON_THROW_ON_ERROR)); $proof=['at'=>gmdate('c'),'target'=>$p['consumer_environment']['target'],'retained_exemplars'=>$files,'ClamD_real'=>$health, 'scan_results'=>$scans,'active_writes'=>0,'official_acceptance_preserved'=>true,'main_QA_files_modified'=>false]; file_put_contents($private.'/portal-stability-services-qa.json',json_encode($proof,JSON_PRETTY_PRINT|JSON_THROW_ON_ERROR)); echo json_encode(['target'=>$proof['target'],'ClamD_real'=>$health,'scan_results'=>array_map(fn($s)=>['file'=>$s['file'],'result'=>$s['scan']['result'],'reason'=>$s['scan']['reason_code']],$scans),'active_writes'=>0]).PHP_EOL;