|
|
@ -137,9 +137,18 @@ abstract class ArchiveDownloader extends FileDownloader
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
$renameAsOne = false;
|
|
|
|
$renameAsOne = false;
|
|
|
|
if (!file_exists($path) || ($filesystem->isDirEmpty($path) && $filesystem->removeDirectoryPhp($path))) {
|
|
|
|
if (!file_exists($path)) {
|
|
|
|
$renameAsOne = true;
|
|
|
|
$renameAsOne = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($filesystem->isDirEmpty($path)) {
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
if ($filesystem->removeDirectoryPhp($path)) {
|
|
|
|
|
|
|
|
$renameAsOne = true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} catch (\RuntimeException $e) {
|
|
|
|
|
|
|
|
// ignore error, and simply do not renameAsOne
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$contentDir = $getFolderContent($temporaryDir);
|
|
|
|
$contentDir = $getFolderContent($temporaryDir);
|
|
|
|
$singleDirAtTopLevel = 1 === count($contentDir) && is_dir(reset($contentDir));
|
|
|
|
$singleDirAtTopLevel = 1 === count($contentDir) && is_dir(reset($contentDir));
|
|
|
|