fix dir count

This commit is contained in:
Jean-Christian Paul Denis 2023-04-16 23:24:19 +02:00
parent 90e88e43c1
commit 92b0e70e5d
Signed by: JcDenis
GPG Key ID: 1B5B8C5B90B6C951

View File

@ -28,9 +28,13 @@ trait TraitCleanerDir
'..', '..',
'__MACOSX', '__MACOSX',
'.svn', '.svn',
'.hg',
'.git',
'CVS', 'CVS',
'.directory',
'.DS_Store', '.DS_Store',
'Thumbs.db', 'Thumbs.db',
'_disabled',
]; ];
protected static function getDirs(string|array $roots): array protected static function getDirs(string|array $roots): array
@ -43,7 +47,7 @@ trait TraitCleanerDir
foreach ($roots as $root) { foreach ($roots as $root) {
$dirs = Files::scanDir($root); $dirs = Files::scanDir($root);
foreach ($dirs as $k) { foreach ($dirs as $k) {
if ('.' == $k || '..' == $k || !is_dir($root . DIRECTORY_SEPARATOR . $k)) { if (in_array($k, self::EXCLUDED) || !is_dir($root . DIRECTORY_SEPARATOR . $k)) {
continue; continue;
} }
$rs[$i]['key'] = $k; $rs[$i]['key'] = $k;