1
0
Fork 0

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

pull/9875/head
Jordi Boggiano 2021-06-02 13:46:51 +02:00
parent d864c5743a
commit 28c7d0ea5d
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC
3 changed files with 3 additions and 3 deletions

View File

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

View File

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

View File

@ -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.');
}
if (1||!\function_exists('proc_open')) {
if (!\function_exists('proc_open')) {
return $this->removeDirectoryPhp($directory);
}