talira

Composer

A Dependency Manager for PHP

open sourceMITself-hostablefree

Composer is the dependency manager for PHP: you declare the libraries a project depends on and it works out which versions fit together, then installs and updates them in the project's vendor directory. It was inspired by npm and Bundler, installs nothing globally by default (a global project is available for tools) and pulls packages from Packagist.org or straight from Git, Mercurial, Subversion, Fossil and Perforce repositories. It ships as a PHP archive with an installer, and as Docker images.

Ways to install

Problems it solves

  • install and update the PHP libraries my project depends on without copying files around by hand
  • work out which versions of my PHP dependencies are compatible with each other
  • update all of my PHP project's dependencies with one command
  • keep each PHP project's libraries inside the project instead of installing them system-wide
  • add a PHP dependency manager to my Docker image by copying in a prebuilt binary
  • install PHP libraries straight from a git or Subversion repository, not only a public registry
  • install PHP command-line tools once for my user and use them in every project
  • manage dependencies for a legacy app stuck on PHP 5.3

Features

  • per-project installs into the vendor directory
  • dependency resolution across version constraints
  • update every dependency with one command
  • global project for command-line tools
  • Packagist.org as the default package repository
  • repositories from Git, Mercurial, Subversion, Fossil and Perforce
  • single-file PHAR executable with an installer script
  • Docker images, including binary-only images to copy into your own
  • plugins
  • long-term-support 2.2 line for PHP 5.3.2 and later

Limitations

  • Doesn't install system packages like apt or yum: it installs libraries per project, into the project's vendor directory3

Capabilities

Has a command line toolplan not known
Takes pluginsplan not known