<?php
$d=__DIR__;$map=json_decode(file_get_contents($d.'/source-lock.json'),true);if(count($map)!==959||hash_file('sha256',$d.'/source-lock.json')!=='49b1a564de5a93dcd0385659a3d79f2e92256970b7fd7cc0a1adb8d482ccdd57')throw new RuntimeException('Root959 source');foreach($map as $f=>$h)if(hash_file('sha256',$d.'/source/application/'.$f)!==$h)throw new RuntimeException('Root file drift');$ports=[];foreach([18921,18922]as $port){$s=@fsockopen('127.0.0.1',$port,$n,$e,0.5);$ports[$port]=$s!==false;if($s)fclose($s);}if(array_filter($ports))throw new RuntimeException('Port collision');$r=['source959'=>true,'ports'=>$ports,'SQL'=>0,'HTTP'=>0,'DML'=>0];file_put_contents($d.'/private/pre-auth-static.json',json_encode($r));chmod($d.'/private/pre-auth-static.json',0600);echo json_encode($r),PHP_EOL;

