/** * Generates a list of all the PHP files that should be analysed by the manifest builder. * * @param string $folder The folder to traverse (recursively) * @param array $classMap The already built class map */ private static function get_all_php_files($folder, $excludedFolders, &$allPhpFiles) { $items = scandir($folder); if ($items) { foreach ($items as $item) { // Skip some specific PHP files if (in_array($item, self::$ignore_files)) { continue; } // ignore hidden files and folders if (substr($item, 0, 1) == '.') { continue; } // ignore files without php-extension if (substr($item, -4) != '.php' && !@is_dir("{$folder}/{$item}")) { continue; } // ignore files and folders with underscore-prefix if (substr($item, 0, 1) == '_') { continue; } // ignore certain directories if (@is_dir("{$folder}/{$item}") && in_array($item, self::$ignore_folders)) { continue; } // ignore directories with _manifest_exlude file if (@is_dir("{$folder}/{$item}") && file_exists("{$folder}/{$item}/_manifest_exclude")) { continue; } // i18n: ignore language files (loaded on demand) if ($item == 'lang' && @is_dir("{$folder}/{$item}") && ereg_replace("/[^/]+/\\.\\.", "", $folder . '/..') == Director::baseFolder()) { continue; } if (@is_dir("{$folder}/{$item}")) { // Folder exclusion - used to skip over tests/ folders if (in_array($item, $excludedFolders)) { continue; } // recurse into directories (if not in $ignore_folders) ManifestBuilder::get_all_php_files("{$folder}/{$item}", $excludedFolders, $allPhpFiles); } else { $allPhpFiles[] = "{$folder}/{$item}"; } } } }