shivammathur / homebrew-php

:beer: Homebrew tap for PHP 5.6 to 8.4. PHP 8.4 is built nightly.

Home Page:https://github.com/shivammathur/homebrew-php/packages

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Attach PHP version to folder

duboiss opened this issue · comments

Describe the feature
Attach a PHP installed version to a folder.
With this, when switching projects we would no longer need to change the PHP version.

I cd normally and the PHP version of the PATH changes automatically if a version is specified as attached to the project folder (project A with php 7.4 and a project B with 8.0...).

Underlying issue
Not remember brew link --overwrite --force php@VERSION command.

Additional context
We have this functionality with tools such as NVM or Volta.
I don't know what would be the best method by creating a file on the project or saving in a common config file like ~/.config/...

Are you willing to submit a PR?
Not Ruby developer

This is a great idea, but out of the scope of this project.

For easy switching, I would recommend using aliases for brew link command.
https://localheinz.com/blog/2020/05/05/switching-between-php-versions-when-using-homebrew/