mirror of
https://github.com/composer/composer
synced 2025-05-10 00:53:06 +00:00
Fix binary proxies having an absolute path to vendor dir when project dir is a symlink, fixes #11947
This commit is contained in:
parent
80631d2fc8
commit
d4396a85bf
1 changed files with 6 additions and 1 deletions
|
@ -225,7 +225,12 @@ class BinaryInstaller
|
|||
$phpunitHack1 = $phpunitHack2 = '';
|
||||
// Don't expose autoload path when vendor dir was not set in custom installers
|
||||
if ($this->vendorDir) {
|
||||
$globalsCode .= '$GLOBALS[\'_composer_autoload_path\'] = ' . $this->filesystem->findShortestPathCode($link, $this->vendorDir . '/autoload.php', false, true).";\n";
|
||||
// ensure comparisons work accurately if the CWD is a symlink, as $link is realpath'd already
|
||||
$vendorDirReal = realpath($this->vendorDir);
|
||||
if ($vendorDirReal === false) {
|
||||
$vendorDirReal = $this->vendorDir;
|
||||
}
|
||||
$globalsCode .= '$GLOBALS[\'_composer_autoload_path\'] = ' . $this->filesystem->findShortestPathCode($link, $vendorDirReal . '/autoload.php', false, true).";\n";
|
||||
}
|
||||
// Add workaround for PHPUnit process isolation
|
||||
if ($this->filesystem->normalizePath($bin) === $this->filesystem->normalizePath($this->vendorDir.'/phpunit/phpunit/phpunit')) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue