Upload
tim-hilliard
View
77
Download
0
Embed Size (px)
Citation preview
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
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.
Composer is installed Now what?
Time to use it in a projectcomposer.json
{ "require": { "acquia/acquia-sdk-php": "*" } }
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”.
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.
Demo time