1
0
Fork 0

Make sure we get a temporary dir which is unique

pull/8729/head
Jordi Boggiano 2020-03-28 20:37:09 +01:00
parent 73251691a0
commit 918768fc54
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC
1 changed files with 4 additions and 1 deletions

View File

@ -43,7 +43,10 @@ abstract class ArchiveDownloader extends FileDownloader
throw new \RuntimeException('Expected empty path to extract '.$package.' into but directory exists: '.$path);
}
$temporaryDir = $this->config->get('vendor-dir').'/composer/'.substr(md5(uniqid('', true)), 0, 8);
do {
$temporaryDir = $this->config->get('vendor-dir').'/composer/'.substr(md5(uniqid('', true)), 0, 8);
} while (is_dir($temporaryDir));
$fileName = $this->getFileName($package, $path);
try {