Composer - What is it and what is it for?

Asked

Viewed 1,571 times

6

I have seen several times in projects the archive composer.json!

I’d like to know what it is and what it’s used for?

1 answer

7


The Composer is a dependency manager for PHP. It is for PHP as well as npm is for the NodeJS, or the Bower is under development frontend, or the pip is for Python...

By using Composer you can define the libraries your code needs, through the file composer.json. Running the command composer install, the tool will download all dependencies for you. When your dependencies are updated, you can ask Composer to download the updates via composer update.

You can browse all available libraries on the site Packagist.

  • 1

    Great answer, I would add two that have nothing to do with programming but resemble apt-get and yum, correct me if I’m talking nonsense :)

  • I wanted to keep the examples more in the area of programming, but you’re right, the principle is the same. The difference is that in the case of your examples, the managed dependencies are in the operating system.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.