Open jesseleite opened 2 years ago
Oh I see in https://github.com/laravel/valet/pull/1216 that you are proposing valet which-php
😮 ...If that gets merged, maybe zsh-valet can use valet which-php
to automatically determine the correct php version without the neeed for .valetphprc
? 🙏
Thanks for the kind words @jesseleite!
This idea sounds great. Love it. I'll dig and see if we can make it work! Though valet which-php
would be a bit expensive to run on each zsh directory change hook. I think we need to find a more performant way to handle this.
@NasirNobin Was thinking about that too...
Maybe laravel/valet could cache a single flat file somewhere, with the global php version, as well as site paths that are on isolated versions. This way tools like zsh-valet would only have to read a single file that already has all the paths/versions resolved. Thoughts?
That could work. I'll see if can draft something like that once valet which-php
PR is merged.
btw, I had another idea. Instead of relying on which-php
we can utilize valet isolated
command and create a site:version
map in real-time from our zsh plugin and probably cache it somewhere locally.
That sounds awesome! 💪
Also what about for detecting the global php version in valet? Would be nice to do away with this, so that users don't have to keep this exported var in sync...
export VALETPHPRC_DEFAULT_PHP=php@8.1
That's on my todo as well 🙌
Works great! Thank you for your work on this! ❤️
Curious also... Is it possible for zsh-valet to automatically read php versions from valet (the global default version, as well as isolated versions), rather than having to set a matching .valetphprc files and default version in our zshrc?