What is Composer?
Composer is a dependency manager for PHP.
You use many PHP libraries in your project, right?
These are your project's dependencies.
Bundler is for ruby, npm is for node.js, Composer is for PHP.
No problem, all do have problems understanding for the ﬁrst
time, including me.
How would I explain Composer
to my wife?
You're going to cook delicious Biryani.
So you need rice, spices, onions, ...?
These are dependencies of Biryani.
You want me to buy and manage these dependencies for
So now you can just call these dependencies when needed.
Congrats! I am your Composer.
Theory behind package
Lets not always reinvent the wheel.
I depend on you, someone else depends on me and the
nesting goes further.
We can use bits and pieces.
Installation (requires Git mostly)
curl -sS https://getcomposer.org/installer | php
mv composer.phar /usr/local/bin/composer
Download and run and set up your PATH so that
you can just call composer from any directory in your command line.
The store for Biryani materials :D
Search for packages/libraries.
Select the version you want.
Install a package (go to your project root)
composer require monolog/monolog
Basic composer.json ﬁle
Update or install dependencies