function LibraryInstaller::update
@inheritDoc
Overrides InstallerInterface::update
2 calls to LibraryInstaller::update()
- PluginInstaller::update in vendor/
composer/ composer/ src/ Composer/ Installer/ PluginInstaller.php - @inheritDoc
- PluginInstaller::update in vendor/
composer/ composer/ src/ Composer/ Installer/ PluginInstaller.php - @inheritDoc
1 method overrides LibraryInstaller::update()
- PluginInstaller::update in vendor/
composer/ composer/ src/ Composer/ Installer/ PluginInstaller.php - @inheritDoc
File
-
vendor/
composer/ composer/ src/ Composer/ Installer/ LibraryInstaller.php, line 171
Class
- LibraryInstaller
- Package installation manager.
Namespace
Composer\InstallerCode
public function update(InstalledRepositoryInterface $repo, PackageInterface $initial, PackageInterface $target) {
if (!$repo->hasPackage($initial)) {
throw new \InvalidArgumentException('Package is not installed: ' . $initial);
}
$this->initializeVendorDir();
$this->binaryInstaller
->removeBinaries($initial);
$promise = $this->updateCode($initial, $target);
if (!$promise instanceof PromiseInterface) {
$promise = \React\Promise\resolve(null);
}
$binaryInstaller = $this->binaryInstaller;
$installPath = $this->getInstallPath($target);
return $promise->then(static function () use ($binaryInstaller, $installPath, $target, $initial, $repo) : void {
$binaryInstaller->installBinaries($target, $installPath);
$repo->removePackage($initial);
if (!$repo->hasPackage($target)) {
$repo->addPackage(clone $target);
}
});
}