composer init
– to create composer.json (not needed if you just run composer require {package}
composer dump-autoload
– to regenerate namespaces in dependencies list (if composer.json is modified)
composer dump-autoload -o
– generates optimised autoloading. Not actually needed in development.
Working with composer
Commit composer.lock but run composer update
locally, composer install
on server (ref).
- Composer version syntax – also in official docs
composer outdated
– checks if all packages are up to date
composer update
– updates (installs) all outdated packages based on packagist.org.
composer install
– installs packages based on composer.lock file
Version notation – Caret, Tilde, or Asterisk?
PHP version
mkdir -p ~/bin && ln -sf /usr/bin/php74-cli ~/bin/php
mkdir -p ~/bin && ln -sf /usr/bin/php80-cli ~/bin/php