Rev 647 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 647 | Rev 1130 | ||
---|---|---|---|
Line 37... | Line 37... | ||
37 | if (!is_dir($output_dir)) { |
37 | if (!is_dir($output_dir)) { |
38 | echo "Path $output_dir does not exist!\n"; |
38 | echo "Path $output_dir does not exist!\n"; |
39 | exit(1); |
39 | exit(1); |
40 | } |
40 | } |
41 | 41 | ||
- | 42 | /** |
|
- | 43 | * @param string $dir |
|
- | 44 | * @param string|null $basepath |
|
- | 45 | * @param array $results |
|
- | 46 | * @return array |
|
- | 47 | * @throws Exception |
|
- | 48 | */ |
|
42 | function getDirContents($dir, $basepath = null, &$results = array()) { |
49 | function getDirContents(string $dir, string $basepath = null, array &$results = array()): array { |
43 | if (is_null($basepath)) $basepath = $dir; |
50 | if (is_null($basepath)) $basepath = $dir; |
44 | $basepath = realpath($basepath) . DIRECTORY_SEPARATOR; |
51 | $basepath = realpath($basepath) . DIRECTORY_SEPARATOR; |
45 | $dir = realpath($dir) . DIRECTORY_SEPARATOR; |
52 | $dir = realpath($dir) . DIRECTORY_SEPARATOR; |
46 | $files = scandir($dir); |
53 | $files = scandir($dir); |
47 | foreach ($files as $file) { |
54 | foreach ($files as $file) { |