Composer 101
summary
Composer manages PHP dependencies using three files and one directory: composer.json, composer.lock, the vendor directory and the composer.phar executable. Five commands cover most work: composer require, composer install, composer update, composer remove and composer init. Use semantic versioning with tilde/caret constraints, install composer per-project or globally, never commit vendor but commit composer.lock so everyone gets identical major.minor.patch versions, and include vendor/autoload.php to load packages.
AI-written summary · about
chapters (17)
- 0:00Introduction and speaker intro
- 4:56What is Composer and why it matters
- 6:20Typical Composer project structure
- 8:05Installing Composer on your system
- 13:25Global vs per-project installation
- 13:45Creating a composer.json file
- 16:59Repositories and package sources
- 19:04Adding dependencies with composer require
- 21:52Understanding composer.lock and vendor directory
- 23:17Committing vendor directory best practices
- 28:16Installing dependencies with composer install
- 30:20Updating packages with composer update
- 34:35Removing packages with composer remove
- 36:19Using vendor code with autoload
- 38:06Recap of Composer commands
- 39:10Resources and further learning
- 40:14Q&A session begins
related talks
31mComposer: write a melody with your dependencies
46mComposer Best Practices
46mManaging dependencies is more than running "composer update"
01h 04mDemystifying Composer
46mComposer Best Practices 2018
16mUnder the Hood of Composer: Understanding the Tool We Use Every Day
47mIn Depth Composer
46mExploring composer in drupal 8
