Composer 2.0, released on October 24, 2020, changes the sequence that custom PHP build tools must follow: it writes the dependency lock file before installing packages. In Composer 1, the lock file came after package operations. For teams maintaining installers or release hooks, that means a newly written composer.lock is not evidence that the corresponding installation has finished. [S2][S3]

The split does not require two commands for every update. Composer’s announcement says installation runs automatically after an update; the upgrade guide says the command reports lock-file changes first and installation changes afterward. The new --no-install option lets callers update, require or remove dependencies without running that installation step. Build owners need to distinguish a deliberately lock-file-only job from one that has not finished installing yet. [S1][S2][S3]

Custom downloaders have a concrete migration task. Their download method should now do the network work needed to prepare a package, not install it. The new prepare step is where the project tells implementers to put prompts and checks that could prevent installation from succeeding. The install step takes over the non-network work, while cleanup handles material left behind. Teams maintaining those downloaders should check where their existing code performs each operation. [S2]

Event hooks need a separate check. The plugin API rises to 2.0.0, and PRE_DEPENDENCIES_SOLVING and POST_DEPENDENCIES_SOLVING are removed. The guide points to PRE_POOL_CREATE, PRE_OPERATIONS_EXEC or other events depending on the task. They are not interchangeable stages: dependency resolution comes before the lock-file write, while PRE_OPERATIONS_EXEC starts the install flow. Package operations can also run in parallel, so a package started later can finish first. A hook that assumes completion order needs more than an event-name replacement. [S2]

The new stages address a specific failure risk. The release changelog says installation performs network operations before disk changes to reduce the chance of a partly updated vendor directory. That does not promise an all-or-nothing deployment. The upgrade guide says cleanup is called after a failure so changes can be undone as far as possible; it still urges plugin authors to avoid failures during install, update and uninstall and to move risky work into prepare. [S2][S3]

Source documents

  1. Composer 2.0 is now available!https://blog.packagist.com/composer-2-0-is-now-available/
  2. Upgrade guides for Composer 1.x to 2.0 — release tag 2.0.0https://raw.githubusercontent.com/composer/composer/2.0.0/UPGRADE-2.0.md
  3. Composer changelog — release tag 2.0.0https://raw.githubusercontent.com/composer/composer/2.0.0/CHANGELOG.md