1
0
Fork 0

Update PathDownloader.php

If a path repository points at a directory that is managed by composer installers, the path that gets set ends up being relative, and this check fails to see that the source is already present, and therefore removes it.

Since ->install is already using realpath around the $path argument, remove should as well.

For an example repository that demonstrates this bug See: https://github.com/ryanaslett/pathrepotestcase
pull/9116/head
Ryan Aslett 2020-08-10 12:51:48 -07:00 committed by GitHub
parent 54aac000ba
commit c0309f22d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -180,7 +180,7 @@ class PathDownloader extends FileDownloader implements VcsCapableDownloaderInter
{ {
$realUrl = realpath($package->getDistUrl()); $realUrl = realpath($package->getDistUrl());
if ($path === $realUrl) { if (realpath($path) === $realUrl) {
if ($output) { if ($output) {
$this->io->writeError(" - " . UninstallOperation::format($package).", source is still present in $path"); $this->io->writeError(" - " . UninstallOperation::format($package).", source is still present in $path");
} }