Should xdebug be enabled on the CLI by default?
I ran into an issue today when I had to generate a code coverage report from a homestead install. It isn't possible due to xdebug not being available.
Perhaps an option in the configuration would be useful or an alias that would link/unlink xdebug for the cli as and when the developers need it.
I would rather leave existing behavior as is, and suggest users that need to enable xdebug on the command line to toggle it as needed: sudo phpenmod -s cli xdebug
If you want to enable xdebug on the CLI forever, just add that line to your after.sh script.
Yes, totally agree with @svpernova09
I actually submitted the current behaviour PR for this a while ago, due to xdebug causing massive slow down when using composer.
Oh! haha awesome!
Thanks for taking the time to bring up the issue.
@svpernova09 @jonnywilliamson makes sense – completely agree with not having it enabled by default, especially when it comes to using composer. I had actually resorted to appending a couple of aliases to my after.sh to make things a bit more fluent.
I'll leave them here should anyone else need them.
echo "alias xon='sudo phpenmod -s cli xdebug'" >> /home/vagrant/.profile
echo "alias xoff='sudo phpdismod -s cli xdebug'" >> /home/vagrant/.profile
@dbonner1987 You should PR those into https://github.com/laravel/homestead/blob/master/src/stubs/aliases
@svpernova09 done. Cheers.
Most helpful comment
I would rather leave existing behavior as is, and suggest users that need to enable xdebug on the command line to toggle it as needed:
sudo phpenmod -s cli xdebugIf you want to enable xdebug on the CLI forever, just add that line to your
after.shscript.