./cos-autoloader.php */ echo "rewind(); while ($iter->valid()) { if (!$iter->isDot()) { $path = $iter->getSubPathName(); $ext = pathinfo($path, PATHINFO_EXTENSION); if ($ext === 'php') { $namespace = preg_replace('/.php$/s', '', $path); $path = str_replace('\\', '/', $path); echo " '$namespace' => 'src/$path',\n"; } } $iter->next(); } echo ");\n"; echo ' spl_autoload_register(function ($class) use ($mapping) { if (isset($mapping[$class])) { require $mapping[$class]; } }, true);' . "\n";