Closed carlos-reynosa closed 8 years ago
By the way i'm removing the package as a dependency an then running a composer update.
Maybe the LibraryInstaller
might need to override the uninstall
function to take into account the custom paths?
uninstall(), here you can determine the actions that need to be executed when the package needs to be removed. - Composer Docs
Seems like the getPackageBasePath
function has the vendor directory hard coded in:
protected function removeCode(PackageInterface $package)
{
$downloadPath = $this->getPackageBasePath($package);
$this->downloadManager->remove($package, $downloadPath);
}
protected function getPackageBasePath(PackageInterface $package)
{
$this->initializeVendorDir();
return ($this->vendorDir ? $this->vendorDir.'/' : '') . $package->getPrettyName();
}
hello .. sorry for the late reply, but currently i'm heading off to my wedding vacations and i'll be available again after the 14th of October and I'll look into deep for all the comments you asked and pointed out.
thanks
I think this issue is resolved automatically if you update your composer
Please check the latest commit at https://github.com/composer/composer/blob/master/src/Composer/Installer/LibraryInstaller.php#L162
protected function getPackageBasePath(PackageInterface $package)
{
$installPath = $this->getInstallPath($package);
$targetDir = $package->getTargetDir();
if ($targetDir) {
return preg_replace('{/*'.str_replace('/', '/+', preg_quote($targetDir)).'/?$}', '', $installPath);
}
return $installPath;
}
if you are okay with it .. can you close the issue please?
thanks a lot.
Hi,
Can you confirm that composer should remove a package installed with this installer, if it was removed from the composer.json within the "require" section?
It seems that composer is not removing the custom package directory that was installed with this installer.
Thanks for your help!
Regards,
Carlos