Composer

Short description: Software; application level dependency manager for the PHP programming language

Composer

Developer(s)| Nils Adermann,
Jordi Boggiano
Initial release| March 1, 2012; 14 years ago (2012-03-01)[1]
Stable release|

2.2.8 / July 1, 2022; 3 years ago (2022-07-01)[2]

Written in| PHP
Operating system| Cross-platform
Type| Package manager
License| MIT License
Website| getcomposer.org

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]

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.

## Contents

* 1 Syntax
* 1.1 Commands
* 1.2 Libraries definition
* 1.3 Versions
* 2 Supported frameworks
* 3 See also
* 4 References
* 5 External links

## 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]

Symbol | Role (placed before a version number) | Example

|
|

>= | allows to extend the number. Moreover, we can use: >, <, <=. | `"php": ">=5.5.9"` includes PHP 7.
!= | excludes a version. |
- | defines a range of versions. |
* | extends to all subversions. | `"symfony/symfony": "3.1.*"` includes the 3.1.1.
~ | extends to the next versions of the same level. | `"doctrine/orm": "~2.5"` also concerns the 2.6, but neither the 2.4 nor the 3.0.
^ | same as tilde, only if there is a backward compatibility. |

## 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
* Yii version 1.1 and later
* Laminas
* Silex (web framework)
* Lumen (web framework)
* Adianti Framework version 1 and later

## See also

* PEAR

## References

1. ↑ 1.0 1.1 Software release, github.com, Retrieved April 24, 2016.
2. ↑ "Composer". https://getcomposer.org/download/. Retrieved July 1, 2022.
3. ↑ Getting Started/Dependency management, getcomposer.org, Retrieved November 28, 2013.
4. ↑ "composer/composer". Jun 23, 2020. https://github.com/composer/composer. Retrieved Jun 24, 2020.
5. ↑ See packagist.org
6. ↑ "Command-line interface / Commands". https://getcomposer.org/doc/03-cli.md.
7. ↑ "Versions and constraints - Composer". https://getcomposer.org/doc/articles/versions.md.

## External links

* Composer on GitHub
* Composer documentation
* Composer Tutorial
* Packagist - the main Composer repository
* Composer at Open Hub

* v
* t
* e

PHP

People|

* Andi Gutmans
* Rasmus Lerdorf
* Zeev Suraski

Resources|

* Accelerator (List)
* Composer
* Editors
* Libraries
* PEAR

Implementations|

* HHVM
* HPHPc
* Parrot
* PeachPie
* Phalanger
* Quercus
* Zend Engine

Web frameworks|

* CakePHP
* CodeIgniter
* Drupal
* eZ Publish
* Fat-Free
* FuelPHP
* Horde
* Joomla!
* Laravel
* Li3 (formerly Lithium)
* Midgard
* MODx
* Nette Framework
* Phalcon
* Pop PHP
* PHP-Fusion
* PRADO
* Qcodo
* Silex
* SilverStripe
* Symfony
* TYPO3
* WordPress
* XOOPS
* Yii
* Zend Framework
* Zeta Components

Testing|

* Behat
* PHPUnit
* Lime (Symfony)

ORMs|

* Doctrine
* Propel

IDEs|

* Aptana
* Codelobster
* Eclipse PDT
* NetBeans
* PHPEdit
* PhpStorm
* RadPHP
* Zend Studio

Widget toolkit|

* PHP-GTK
* wxPHP

* Category
* Commons

* v
* t
* e

Package managers (format)

Compiled

| Windows|

* Allmyapps
* Cygwin
* Microsoft Store
* Npackd
* NSIS
* NuGet
* Chocolatey
* ProGet
* wpkg

|

macOS|

* Mac App Store
* pkgsrc

Linux
Unix-like|

| dpkg|

* APT
* aptitude
* dselect
* Ubuntu Software Center

|

RPM|

* YUM
* DNF
* APT-RPM
* up2date
* urpmi
* ZYpp

tarball|

* slapt-get
* slackpkg
* netpkg
* swaret

Purely functional|

* Nix
* Guix

Other|

* AppImage
* Autopackage
* Conary
* Flatpak
* PackageKit
* pacman
* PBI
* PETget
* PISI
* Portage
* Snappy
* Upkg
* pkgsrc

Solaris • illumos|

* IPS
* Pkgutil
* OpenCSW
* pkgsrc

z/OS|

* SMP/E

Embedded OS|

* ipkg
* opkg

Mobile OS|

* Amazon Appstore
* App Store
* Cydia
* F-Droid
* GetJar
* Google Play
* Microsoft Store
* RPM
* SlideME
* Windows Phone Store

Gaming console|

* DSi Shop
* Nintendo eShop
* PlayStation Store
* Wii Shop Channel
* Xbox Games Store

Multi-platform|

* OpenPKG
* pkgsrc
* Zero Install

Web browsers|

* Chrome Web Store
* Mozilla Add-ons

Uncompiled

| Linux|

* ABS
* apt-build
* Compile
* Portage
* Sorcery
* BitBake
* pkgsrc

|

macOS|

* Fink
* MacPorts
* Homebrew
* pkgsrc

BSD|

* ports collection
* FreeBSD Ports
* pkgsrc

C++|

* Gradle
* vcpkg

Java|

* Maven
* Ivy
* Gradle

Python|

* PyPl
* pip
* easyinstall
* PyPM
* Anaconda
* Enthought Canopy

JavaScript|

* NPM

.NET|

* NuGet

Perl|

* CPAN

Ruby|

* RubyGems

PHP|

* PEAR
* Composer

* List
* Category
* Commons

0.00

(0 votes)

|

Retrieved from "https://handwiki.org/wiki/index.php?title=Software:Composer&oldid=739355"
*[v]: View this template
*[t]: Discuss this template
*[e]: Edit this template