From c232566e5266366ca3d26030056e86c68356bc73 Mon Sep 17 00:00:00 2001 From: Rob Bast Date: Thu, 21 Jan 2016 16:02:44 +0100 Subject: [PATCH] add a hash to make sure CA file gets recreated if the content changes --- src/Composer/Util/RemoteFilesystem.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Composer/Util/RemoteFilesystem.php b/src/Composer/Util/RemoteFilesystem.php index 58e95d53e..a13f6f449 100644 --- a/src/Composer/Util/RemoteFilesystem.php +++ b/src/Composer/Util/RemoteFilesystem.php @@ -639,7 +639,8 @@ class RemoteFilesystem } if (preg_match('{^phar://}', $result)) { - $targetPath = rtrim(sys_get_temp_dir(), '\\/') . '/composer-cacert.pem'; + $hash = md5(file_get_contents($result)); + $targetPath = rtrim(sys_get_temp_dir(), '\\/') . '/composer-cacert-' . $hash . '.pem'; if (!file_exists($targetPath)) { // use stream_copy_to_stream instead of copy