while ($row = $res->fetchObject()) { $classes = array_intersect($classes, explode(',', $row->classes)); } foreach ($classes as &$class) { $class = str_replace('\\', '/', $class) . '.php'; } } unset($class); $file_mappings = []; $files = \classes\get::recursive_glob(root . '/.core/', '*.php'); foreach ($files as $file) { $new_path = str_replace(root . '/.core/dependent/', '', $file); $new_path = str_replace(root . '/.core', 'core', $new_path); $file_mappings[$new_path] = $file; } $files = \classes\get::recursive_glob(root . '/inc', '*.php'); foreach ($files as $file) { $new_path = str_replace(root . '/inc/', '', $file); $file_mappings[$new_path] = $file; } $dependencies = []; foreach ($classes as $class) { $dependencies[$class] = find_dependencies($file_mappings[$class]); } $met_dependencies = ['Serializable.php']; $iterations = 0; while ($classes && $iterations < 10) { foreach ($classes as $index => $class) { foreach ($dependencies[$class] as $dependant) { if (!in_array($dependant, $met_dependencies)) { continue 2;