Composer Best Practices
summary
Composer usage separates into two steps: composer update (composer.json → composer.lock) and composer install (composer.lock → vendor), so never deploy without a lock file and build a release artifact ahead of time. Use --prefer-dist and cache CI to speed downloads, run composer install --optimize-autoloader (or --classmap-authoritative on PHP 7) for production, and use platform config plus composer check-platform-reqs to validate targets. For libraries run update, update with --prefer-lowest --prefer-stable, follow semantic versioning (bump major on BC breaks) and consider private packages for mirrors.
AI-written summary · about
