Composer Summary
Composer manages PHP dependencies with semantic versioning, PSR-4 autoloading, lock files for reproducibility, and scripts for automation. Always commit composer.lock and run composer audit in CI.
Composer manages PHP dependencies with semantic versioning, PSR-4 autoloading, lock files for reproducibility, and scripts for automation. Always commit composer.lock and run composer audit in CI.
# The essential Composer workflow
composer init # create composer.json
composer require vendor/pkg # add dependency
composer install --no-dev -o # production install
composer update # update dependencies
composer dump-autoload -o # optimise autoloader
composer audit # check security
Composer is to PHP what npm is to Node — master it early and save hours of manual dependency work.