Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test on older Homebrew & MacOS versions #2

Open
NasirNobin opened this issue Mar 19, 2022 · 3 comments
Open

Test on older Homebrew & MacOS versions #2

NasirNobin opened this issue Mar 19, 2022 · 3 comments

Comments

@NasirNobin
Copy link
Owner

NasirNobin commented Mar 19, 2022

Currently, this package assumes PHP binary is located at/opt/homebrew/opt/php@$PHP_VERSION/bin

But older homebrew versions don't store PHP bin into /opt/homebrew/ prefix also, it doesn't store on the same location.

@NasirNobin
Copy link
Owner Author

Possible paths:

- /usr/local/opt/php@7.2/bin
- /usr/local/opt/php@7.2/bin
- /opt/homebrew/etc/php/7.0/bin
- /opt/homebrew/opt/php@7.0/bin
- /usr/local/opt/php@5.6/bin
- /usr/local/opt/php@7.3/bin
- /usr/local/Cellar/php/8.0.2/bin
- /usr/local/Cellar/php/8.1.2/bin
- 

Sources:

@NasirNobin
Copy link
Owner Author

use brew --prefix to determine homebrew prefix

@NasirNobin
Copy link
Owner Author

from valet

/**
* Typical homebrew path resolutions are like:
* "../Cellar/php@7.4/7.4.13/bin/php"
* or older styles:
* "../Cellar/php/7.4.9_2/bin/php
* "../Cellar/php55/bin/php.
*/
preg_match('~\w{3,}/(php)(@?\d\.?\d)?/(\d\.\d)?([_\d\.]*)?/?\w{3,}~', $resolvedPath, $matches);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant