strtoupper($m[1]), 'path'=>$m[2], 'source'=>substr($file, strlen($legacy)+1)]; } $out = $root.'/integration/sonardesk-route-inventory.json'; file_put_contents($out, json_encode(['generated_from'=>'archived SonarDesk source','warning'=>'Static extraction: nested prefixes, resource routes and dynamic registrations require runtime verification','routes'=>$inventory], JSON_PRETTY_PRINT|JSON_UNESCAPED_SLASHES)."\n"); fwrite(STDOUT, count($inventory)." static route declarations written to $out\n");