This commit is contained in:
Roman Kelesidis 2025-06-09 14:03:51 +03:00
commit a30b199b30
2 changed files with 1 additions and 22 deletions

View file

@ -94,7 +94,7 @@ if (is_file(BB_ROOT . '.env')) {
}
// composer dir
if (is_dir(BB_ROOT . 'vendor')) {
rmdir_rec(BB_ROOT . 'vendor');
removeDir(BB_ROOT . 'vendor');
if (!is_dir(BB_ROOT . 'vendor')) {
out("- Composer directory successfully removed!");
} else {

View file

@ -117,27 +117,6 @@ function runProcess(string $cmd, string $input = null): void
proc_close($process);
}
/**
* Remove directory recursively
*
* @param string $dir
* @return void
*/
function rmdir_rec(string $dir): void
{
$it = new RecursiveDirectoryIterator($dir, FilesystemIterator::SKIP_DOTS);
$files = new RecursiveIteratorIterator($it,
RecursiveIteratorIterator::CHILD_FIRST);
foreach ($files as $file) {
if ($file->isDir()) {
rmdir($file->getPathname());
} else {
unlink($file->getPathname());
}
}
rmdir($dir);
}
/**
* Setting permissions recursively
*