Packagist

Composer (software)

Composer (software)

Software; application level dependency manager for the PHP programming language


Composer is an application-level dependency manager for the PHP programming language that provides a standard format for managing dependencies of PHP software and required libraries. It was developed by Nils Adermann and Jordi Boggiano, who continue to manage the project. They began development in April 2011 and first released it on March 1, 2012.[1] Composer is strongly inspired by Node.js's "npm" and Ruby's "bundler".[3] The project's dependency solving algorithm started out as a PHP-based port of openSUSE's libzypp SAT solver.[4]

Quick Facts Developer(s), Initial release ...

Composer runs from the command line and installs dependencies (e.g. libraries) for an application. It also allows users to install PHP applications that are available on "Packagist"[5] which is its main repository containing available packages. It also provides autoload capabilities for libraries that specify autoload information to ease usage of third-party code.

Syntax

Commands

Composer offers several parameters including :[6]

  • require: add the library in parameter to the file composer.json, and install it.
  • install: install all libraries from composer.json. It's the command to use to download all PHP repository dependencies.
  • update: update all libraries from composer.json, according to the allowed versions mentioned into it.
  • remove: uninstall a library and remove it from composer.json.

Libraries definition

Example of composer.json generated by the following command:

composer require monolog/monolog
{
    "require": {
        "monolog/monolog": "1.2.*"
    }
}

Versions

The different authorized versions of the libraries are defined by:[7]

More information Symbol, Role (placed before a version number) ...

Supported frameworks

  • Symfony version 2 and later
  • Laravel version 4 and later
  • CodeIgniter version 3.0 and later
  • CakePHP version 3.0 and later
  • FuelPHP version 2.0 and later
  • Drupal version 8 and later
  • TYPO3 version 6.2 and later
  • Neos Flow version 2.0 and later
  • SilverStripe version 3.0 later
  • Magento version 2.0 later
  • OpenMage version 20.0.0 and later
  • Yii version 1.1 and later
  • Laminas
  • Silex (web framework)
  • Lumen (web framework)
  • Adianti Framework version 1 and later

See also


References

  1. Software release, github.com, Retrieved April 24, 2016.
  2. "Release 2.7.2". 11 March 2024. Retrieved 22 March 2024.
  3. Getting Started/Dependency management, getcomposer.org, Retrieved November 28, 2013.
  4. "composer/composer". Jun 23, 2020. Retrieved Jun 24, 2020 via GitHub.

Share this article:

This article uses material from the Wikipedia article Packagist, and is written by contributors. Text is available under a CC BY-SA 4.0 International License; additional terms may apply. Images, videos and audio are available under their respective licenses.