Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 1 | <?php |
| 2 | |
| 3 | error_reporting(E_ALL); |
| 4 | |
| 5 | function getGeneratedFiles($dir, &$results = array()) |
| 6 | { |
| 7 | $files = scandir($dir); |
| 8 | |
| 9 | foreach ($files as $key => $value) { |
| 10 | $path = realpath($dir.DIRECTORY_SEPARATOR.$value); |
| 11 | if (!is_dir($path)) { |
| 12 | $results[] = $path; |
| 13 | } else if ($value != "." && $value != "..") { |
| 14 | getGeneratedFiles($path, $results); |
| 15 | } |
| 16 | } |
| 17 | return $results; |
| 18 | } |
| 19 | |
| 20 | foreach (getGeneratedFiles("generated") as $filename) |
| 21 | { |
| 22 | if (!is_dir($filename)) { |
| 23 | include_once $filename; |
| 24 | } |
| 25 | |
| 26 | } |
| 27 | |