Configurable PHP Executable Path for getCommandlineInvocation()
Background
There is a method called \sb\Controller\Command\Line::getCommandlineInvocation() which returns a string that can be handed to \sb\Linux\Process to fork off PHP subprocesses to other commandline controllers.
This is used by the enterpriseteam webrunner infrastructure. It is also used by the @triggers <cmd>
docblock tag.
If this code is run in a PHP8 project on a server on which the default php is 7.4, it will return commandline invocations that call the PHP7.4 executable.
What To Do
We can simply use PHP_BINARY instead of any hardcoded path to the exe.
Things To Consider
- This addresses a current outstanding problem.
- The problem this issue addresses is really only an issue during the interim period where not all projects on the server have been updated to php8.
Deployment Notes
Simply push to the github remote.