8000 [Process] Make `PhpExecutableFinder` look for the `PHP_BINARY` env var · dunglas/symfony@4bd01f2 · GitHub
[go: up one dir, main page]

8000
Skip to content

Commit 4bd01f2

Browse files
[Process] Make PhpExecutableFinder look for the PHP_BINARY env var
1 parent cf89857 commit 4bd01f2

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

src/Symfony/Component/Process/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ CHANGELOG
55
-----
66

77
* added the `Process::isTtySupported()` method that allows to check for TTY support
8+
* made `PhpExecutableFinder` look for the `PHP_BINARY` env var when searching the php binary
89

910
4.0.0
1011
-----

src/Symfony/Component/Process/PhpExecutableFinder.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,14 @@ public function __construct()
3535
*/
3636
public function find($includeArgs = true)
3737
{
38+
if ($php = getenv('PHP_BINARY')) {
39+
if (!is_executable($php)) {
40+
return false;
41+
}
42+
43+
return $php;
44+
}
45+
3846
$args = $this->findArguments();
3947
$args = $includeArgs && $args ? ' '.implode(' ', $args) : '';
4048

0 commit comments

Comments
 (0)
0