function LibraryInstaller::install
@inheritDoc
Overrides InstallerInterface::install
2 calls to LibraryInstaller::install()
- PluginInstaller::install in vendor/
composer/ composer/ src/ Composer/ Installer/ PluginInstaller.php - @inheritDoc
- PluginInstaller::install in vendor/
composer/ composer/ src/ Composer/ Installer/ PluginInstaller.php - @inheritDoc
1 method overrides LibraryInstaller::install()
- PluginInstaller::install in vendor/
composer/ composer/ src/ Composer/ Installer/ PluginInstaller.php - @inheritDoc
File
-
vendor/
composer/ composer/ src/ Composer/ Installer/ LibraryInstaller.php, line 142
Class
- LibraryInstaller
- Package installation manager.
Namespace
Composer\InstallerCode
public function install(InstalledRepositoryInterface $repo, PackageInterface $package) {
$this->initializeVendorDir();
$downloadPath = $this->getInstallPath($package);
// remove the binaries if it appears the package files are missing
if (!Filesystem::isReadable($downloadPath) && $repo->hasPackage($package)) {
$this->binaryInstaller
->removeBinaries($package);
}
$promise = $this->installCode($package);
if (!$promise instanceof PromiseInterface) {
$promise = \React\Promise\resolve(null);
}
$binaryInstaller = $this->binaryInstaller;
$installPath = $this->getInstallPath($package);
return $promise->then(static function () use ($binaryInstaller, $installPath, $package, $repo) : void {
$binaryInstaller->installBinaries($package, $installPath);
if (!$repo->hasPackage($package)) {
$repo->addPackage(clone $package);
}
});
}