From b59c82f690f9d764fe0663c32830510bce18f89d Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Mon, 22 Jul 2024 17:33:29 -0500 Subject: [PATCH] Try to avoid 'Unable to add newly converted phar... to the list of phars, a phar with that name already exists' due to https://bugs.php.net/bug.php\?id\=75101 [skip ci] --- src/BinaryInstaller.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/BinaryInstaller.php b/src/BinaryInstaller.php index 5004cb15..1234b1ad 100644 --- a/src/BinaryInstaller.php +++ b/src/BinaryInstaller.php @@ -206,7 +206,7 @@ protected function installBinary($binary, $version, $url, $sha, $hashalgo = 'sha else { $cacheFolder = sys_get_temp_dir() . \DIRECTORY_SEPARATOR . $binary . \DIRECTORY_SEPARATOR . $version; } - $cacheDestination = $cacheFolder . \DIRECTORY_SEPARATOR . $fileName; + $cacheDestination = $cacheFolder. \DIRECTORY_SEPARATOR . bin2hex(random_bytes(5)) . $fileName; $cacheExtractedBinary = $cacheFolder . \DIRECTORY_SEPARATOR . $binary; $binDestination = $bin . \DIRECTORY_SEPARATOR . $binary;