2. What is composer?
Composer is a tool for dependency management in
PHP. It allows you to declare the dependent libraries
your project needs and it will install them in your
project for you.
https://getcomposer.org/doc/00-intro.md#introduction
3. How does it work?
• Composer is a phar archive that runs as an
executable in your system
• Download composer.phar to your system and put it
in your PATH.
• Run “composer” as you would any other CLI tool.
6. Time to use it in a project
composer.json
{
"require": {
"acquia/acquia-sdk-php": "*"
}
}
7. composer install
• Installs a known state of dependencies into your
project.
• uses composer.lock to work out what libraries and
versions need to be downloaded into the vendor
directory
• if no composer.lock file exists, this command is the
same as running “composer update”.
8. composer update
• Updates your dependencies to their latest versions
according to the composer.json file.
• Updates composer.lock with the new state
information.
• Updates actual libraries in vendor directory with
new state.