# Usage: use php <version>
#
# Loads the specified php version into the environent
#
use_php() {
brew link php@$1 --force
}
# Usage: use composer <version>
#
# Loads the specified composer version into the environent
#
use_composer() {
composer --version | grep -q "version $1" || composer self-update --$1
}
usage
after allowing through direnv allow the project will switch to the correctly installed php 7.4 / composer version 2, if installed.
setup
brew install direnv
~/.direnvrc:
usage
after allowing through
direnv allow
the project will switch to the correctly installed php 7.4 / composer version 2, if installed.