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

Breadcrumb

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

function InstallerInterface::prepare

Do anything that needs to be done between all downloads have been completed and the actual operation is executed

All packages get first downloaded, then all together prepared, then all together installed/updated/uninstalled. Therefore for error recovery it is important to avoid failing during install/update/uninstall as much as possible, and risky things or user prompts should happen in the prepare step rather. In case of failure, cleanup() will be called so that changes can be undone as much as possible.

@phpstan-return PromiseInterface<void|null>|null

Parameters

string $type one of install/update/uninstall:

PackageInterface $package package instance:

PackageInterface $prevPackage previous package instance in case of an update:

Return value

PromiseInterface|null

4 methods override InstallerInterface::prepare()
LibraryInstaller::prepare in vendor/composer/composer/src/Composer/Installer/LibraryInstaller.php
@inheritDoc
MetapackageInstaller::prepare in vendor/composer/composer/src/Composer/Installer/MetapackageInstaller.php
@inheritDoc
NoopInstaller::prepare in vendor/composer/composer/src/Composer/Installer/NoopInstaller.php
@inheritDoc
ProjectInstaller::prepare in vendor/composer/composer/src/Composer/Installer/ProjectInstaller.php
@inheritDoc

File

vendor/composer/composer/src/Composer/Installer/InstallerInterface.php, line 69

Class

InstallerInterface
Interface for the package installation manager.

Namespace

Composer\Installer

Code

public function prepare(string $type, PackageInterface $package, ?PackageInterface $prevPackage = null);

API Navigation

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