Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. ProjectInstaller.php

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\Installer

Code

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);
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal