autoload.php 524 B

12345678910111213141516171819202122232425
  1. <?php
  2. function getGeneratedFiles($dir, &$results = array())
  3. {
  4. $files = scandir($dir);
  5. foreach ($files as $key => $value) {
  6. $path = realpath($dir.DIRECTORY_SEPARATOR.$value);
  7. if (!is_dir($path)) {
  8. $results[] = $path;
  9. } else if ($value != "." && $value != "..") {
  10. getGeneratedFiles($path, $results);
  11. }
  12. }
  13. return $results;
  14. }
  15. foreach (getGeneratedFiles("generated") as $filename)
  16. {
  17. if (!is_dir($filename)) {
  18. include_once $filename;
  19. }
  20. }