Home > Article > Development Tools > what is composer
What is composer?
Simply put, Composer is a new installation package management tool serving the PHP ecosystem. It actually consists of two parts: Composer and Packagist. Below we will briefly talk about their respective uses.
Composer
Composer is a command line tool created by Jordi Boggiano and Nils Aderman. Its mission is to help you automatically install the development packages that your project depends on. Many concepts in Composer are borrowed from npm and Bundler. If you know something about these two tools, you will find them in composer. Composer includes a dependency parser to handle complex dependencies between development packages; in addition, it also includes downloaders, installers and other interesting things.
As a user, all you have to do is declare the development packages that the current project depends on in the composer.json file, and then run composer.phar install. The composer.json file defines the development packages and composer configuration information that the current project depends on. The following is a small example:
{ "require": { "monolog/monolog": "1.2.*" } } Packagist
Packagist is Composer's default development package repository. You can submit your installation package to packagist. In the future, if you create a new tag or update the code in your VCS (source code management software, such as Github) warehouse, packagist will automatically build a new development package. This is how packagist currently works, in the future packagist will allow direct uploading of development packages.
For more related composer usage tutorial articles, please visit the composer tutorial column!
The above is the detailed content of what is composer. For more information, please follow other related articles on the PHP Chinese website!