1
0
Fork 0

Fix case where symlink:true still can downgrade to a copy on windows, refs #10482

pull/10512/head
Jordi Boggiano 2022-02-02 16:59:58 +01:00
parent 7591ef0084
commit 45bbe43aac
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC
1 changed files with 3 additions and 0 deletions

View File

@ -272,6 +272,9 @@ class PathDownloader extends FileDownloader implements VcsCapableDownloaderInter
// Check we can use junctions safely if we are on Windows
if (Platform::isWindows() && self::STRATEGY_SYMLINK === $currentStrategy && !$this->safeJunctions()) {
if (!in_array(self::STRATEGY_MIRROR, $allowedStrategies)) {
throw new \RuntimeException('You are on an old Windows / old PHP combo which does not allow Composer to use junctions/symlinks and this path repository has symlink:true in its options so copying is not allowed');
}
$currentStrategy = self::STRATEGY_MIRROR;
$allowedStrategies = array(self::STRATEGY_MIRROR);
}