<?php
class ModuleDiscovery{
public function scan($root){
$out=[];
foreach(['engines','services','repositories','interfaces','events'] as $d){
$p=$root.'/'.$d;
if(is_dir($p)){
foreach(scandir($p) as $f){
if(substr($f,-4)=='.php') $out[]=$d.'/'.$f;
}}
}
sort($out);
return $out;
}}
