Skip to content

Commit

Permalink
Update ComposerPlugin.php
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
nerdgod authored and nicolas-grekas committed Jan 20, 2023
1 parent 612648c commit a33478e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Internal/ComposerPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public function uninstall(Composer $composer, IOInterface $io): void

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

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

0 comments on commit a33478e

Please sign in to comment.