w00fz / xdebug-osx

Simple bash script to toggle xdebug on/off in OSX
MIT License
274 stars 23 forks source link

Update script to support new homebrew php packages #16

Closed endelwar closed 6 years ago

endelwar commented 6 years ago

Tested with fresh install of php 5.6, 7.1 and 7.2

w00fz commented 6 years ago

Thanks!

I wish the 7.2 current stable php wasn't so hardcoded but I'm not sure how this could be pulled from brew. Any idea?

endelwar commented 6 years ago

Maybe parsing output of brew list php | grep -E "/bin/php$"?

/usr/local/Cellar/php/7.2.4_1/bin/php

A simple regex can take out 7.2 from path

endelwar commented 6 years ago

It was simpler to check for /usr/local/opt/php/bin/php and get PHP_VERSION out of it, what do you think?

w00fz commented 6 years ago

Awesome