Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

For what is used composer.json [closed]

I recently saw this "composer.json" in the major php frameworks, what is it? and what you can do with it?

like image 753
Sîrbu Nicolae-Cezar Avatar asked Dec 29 '25 17:12

Sîrbu Nicolae-Cezar


1 Answers

composer.json Is just a config file that describes your application, and its needs !!

By that I mean, your application, its version, and what it needs to work properly (also known as the dependency) can all be written inside the composer.json file, to ease the burden of downloading or trying to use something without knowing what it needs it work in the first place.

For example, I could include a composer.json file for this Image uploader repo, that says the repo requires the the PHP GD library to work and submit the repo on packagist.

By doing that, whenever someone downloads the repo using Composer, the required library (its dependencies) would also be downloaded along with it.

Check out the composer for this password_compat file. It gives you information about the author, the library and what it needs to work require-dev:, and where it is found autoload:.

like image 142
samayo Avatar answered Dec 31 '25 07:12

samayo