function getFileList($root, $basePath = '')
{
$files = [];
$handle = opendir($root);
while (($path = readdir($handle)) !== false) {
if ($path === '.git' || $path === '.svn' || $path === '.' || $path === '..') {
continue;
}
$fullPath = "{$root}/{$path}";
$relativePath = $basePath === '' ? $path : "{$basePath}/{$path}";
if (is_dir($fullPath)) {
$files = array_merge($files, $this->getFileList($fullPath, $relativePath));
} else {
$files[] = $relativePath;
}
}
closedir($handle);
return $files;
}