← All open source projects

Composer

composer/composer

Composer is PHP’s dependency manager and the main way to install packages from Packagist.

Forks 4,801
Author composer
Language PHP
License MIT
Synced 2026-06-27

In Short

Composer made the PHP ecosystem modular: a project describes dependencies in `composer.json`, and Composer downloads packages, builds autoloading, and locks versions.

What It Is

Composer is PHP’s dependency manager. It helps declare, install, and update project libraries, while public packages are usually found through Packagist.

What Is Inside

The repository contains Composer itself, dependency resolution, lock-file support, autoload generation, documentation, and tests. There is the main Composer 2 line and a 2.2 LTS line.

How People Use It

Composer is used in almost every modern PHP project: frameworks, libraries, console tools, and plugins are installed through one understandable model.

Example

composer.json

The example shows a minimal package description and dependency that Composer installs into vendor.

Language: JSON
{
  "require": {
    "guzzlehttp/guzzle": "^7.0"
  },
  "autoload": {
    "psr-4": { "App\\\\": "src/" }
  }
}

Strengths

Composer’s strength is reproducibility. `composer.lock` fixes exact versions, and autoloading removes manual includes for every class.

Limits

The limitation is dependency discipline. Overly broad version ranges, missing lock files, or uncontrolled packages can make updates risky.

Project Context

Composer is maintained in the composer/composer repository; its public history starts on 2011-06-08. The primary metadata language is PHP, and the license is MIT. The project also has a dedicated site: https://getcomposer.org/.

This context keeps the page grounded in a specific repository: the project has an owner, technical base, license, change history, and real constraints of its ecosystem.

Composer should be evaluated through a concrete scenario: who will maintain it, where it fits in the existing stack, which updates must be tracked, and what happens if it fails. That view is more useful than installing a project just because it is popular, because open source helps only when its role in the system is clear to the team.