Recommended: [composer tutorial]
What software is composer?
Simply put, Composer is a new 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 is a command line tool created by Jordi Boggiano and Nils Aderman. Its mission is to help you automatically install projects. The development packages it 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.
The above is the detailed content of What software is composer?. For more information, please follow other related articles on the PHP Chinese website!