For those who are unaware of composer in php, Composer is a tool for dependency management. It allows us to declare the dependent libraries our project needs and installs them in our project.
It is inspired by the node's npm and ruby's bundler.
So, basically if we have a project that depends on a number of libraries and those libraries depend on other libraries, we declare the libraries we depend on. Composer downloads and installs the required packages in our project.
For this, we need a file composer.json that describes the project's dependencies.
For e.g. we have used here monolog library to do logging.
{
"require": {
"monolog/monolog": "1.2.*"
}
}
It is inspired by the node's npm and ruby's bundler.
So, basically if we have a project that depends on a number of libraries and those libraries depend on other libraries, we declare the libraries we depend on. Composer downloads and installs the required packages in our project.
For this, we need a file composer.json that describes the project's dependencies.
For e.g. we have used here monolog library to do logging.
{
"require": {
"monolog/monolog": "1.2.*"
}
}
Comments
Post a Comment