Skip to content

Commit a33478e

Browse files
nerdgodnicolas-grekas
authored andcommitted
Update ComposerPlugin.php
On Windows systems where the project directory is a junction or symlink, realpath() must be called on any directories (withing a subtree) you wish to compare relative paths for, because otherwise the directory upon which realpath() was called will point to the link target (original) and the other will point to the link (copy) which may be on a different filesystem (resulting in an invalid projectDir path like `C:\project\\Z:\project\` in the autoload_runtime.php)
1 parent 612648c commit a33478e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Internal/ComposerPlugin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public function uninstall(Composer $composer, IOInterface $io): void
5858

5959
public function updateAutoloadFile(): void
6060
{
61-
$vendorDir = $this->composer->getConfig()->get('vendor-dir');
61+
$vendorDir = realpath($this->composer->getConfig()->get('vendor-dir'));
6262

6363
if (!is_file($autoloadFile = $vendorDir.'/autoload.php')
6464
|| false === $extra = $this->composer->getPackage()->getExtra()['runtime'] ?? []

0 commit comments

Comments
 (0)