Composer basics
Composer is a command-line tool for managing code in PHP-based applications such as Drupal. PHP has a vast ecosystem of components, libraries, and so on, including the catalog of Drupal projects and various Symfony components used by Drupal. Like a package manager, Composer helps assemble and update the PHP-based parts of an application.
Composer starts with a project. Not to be confused with a Drupal project, a Composer project is the high-level scaffolding for an application. Drupal applications are initialized as a Composer project. Composer projects have installed packages, and each package has its own dependencies – all of which can be managed by Composer through Composer projects.
Once a Composer project is initialized, Composer has a few key constructs. A composer.json
file manages a developer-friendly list of projects, versions, and constraints for the Drupal application. A constraint in Composer is a set of directives defined per project to help...