Avoid creating new processes to remove directories which we know are empty, which speeds things up a lot on windows

main
Jordi Boggiano 3 years ago
parent d864c5743a
commit 28c7d0ea5d
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC

@ -137,7 +137,7 @@ abstract class ArchiveDownloader extends FileDownloader
}; };
$renameAsOne = false; $renameAsOne = false;
if (!file_exists($path) || ($filesystem->isDirEmpty($path) && $filesystem->removeDirectory($path))) { if (!file_exists($path) || ($filesystem->isDirEmpty($path) && $filesystem->removeDirectoryPhp($path))) {
$renameAsOne = true; $renameAsOne = true;
} }

@ -306,7 +306,7 @@ class FileDownloader implements DownloaderInterface, ChangeReportInterface
foreach ($dirsToCleanUp as $dir) { foreach ($dirsToCleanUp as $dir) {
if (is_dir($dir) && $this->filesystem->isDirEmpty($dir) && realpath($dir) !== getcwd()) { if (is_dir($dir) && $this->filesystem->isDirEmpty($dir) && realpath($dir) !== getcwd()) {
$this->filesystem->removeDirectory($dir); $this->filesystem->removeDirectoryPhp($dir);
} }
} }

@ -188,7 +188,7 @@ class Filesystem
throw new \RuntimeException('Aborting an attempted deletion of '.$directory.', this was probably not intended, if it is a real use case please report it.'); throw new \RuntimeException('Aborting an attempted deletion of '.$directory.', this was probably not intended, if it is a real use case please report it.');
} }
if (1||!\function_exists('proc_open')) { if (!\function_exists('proc_open')) {
return $this->removeDirectoryPhp($directory); return $this->removeDirectoryPhp($directory);
} }

Loading…
Cancel
Save