<?php
declare(strict_types=1);
$root=__DIR__;$out=[];foreach(new DirectoryIterator($root) as $f){if(!$f->isFile()||$f->getFilename()==='MANIFEST.sha256'||strpos($f->getFilename(),'private')===0)continue;$out[$f->getFilename()]=hash_file('sha256',$f->getPathname());}ksort($out);$lines=[];foreach($out as $name=>$sha)$lines[]=$sha.'  '.$name;file_put_contents($root.'/MANIFEST.sha256',implode("\n",$lines)."\n");echo json_encode(['manifest_files'=>count($out)]),"\n";
