function ProjectInstaller::download
@inheritDoc
Overrides InstallerInterface::download
File
-
vendor/
composer/ composer/ src/ Composer/ Installer/ ProjectInstaller.php, line 62
Class
- ProjectInstaller
- Project Installer is used to install a single package into a directory as root project.
Namespace
Composer\InstallerCode
public function download(PackageInterface $package, ?PackageInterface $prevPackage = null) : ?PromiseInterface {
$installPath = $this->installPath;
if (file_exists($installPath) && !$this->filesystem
->isDirEmpty($installPath)) {
throw new \InvalidArgumentException("Project directory {$installPath} is not empty.");
}
if (!is_dir($installPath)) {
mkdir($installPath, 0777, true);
}
return $this->downloadManager
->download($package, $installPath, $prevPackage);
}