Skip to content

Commit

Permalink
Fix case where symlink:true still can downgrade to a copy on windows,…
Browse files Browse the repository at this point in the history
… refs #10482
  • Loading branch information
Seldaek committed Feb 2, 2022
1 parent 7591ef0 commit 45bbe43
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Composer/Downloader/PathDownloader.php
Expand Up @@ -272,6 +272,9 @@ private function computeAllowedStrategies(array $transportOptions)

// 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);
}
Expand Down

0 comments on commit 45bbe43

Please sign in to comment.