10000 feature #25629 [Process] Make `PhpExecutableFinder` look for the `PHP… · dunglas/symfony@88ed829 · GitHub
[go: up one dir, main page]

Skip to content

Commit 88ed829

Browse files
committed
feature symfony#25629 [Process] Make PhpExecutableFinder look for the PHP_BINARY env var (nicolas-grekas)
This PR was merged into the 4.1-dev branch. Discussion ---------- [Process] Make `PhpExecutableFinder` look for the `PHP_BINARY` env var | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | symfony#22101 | License | MIT | Doc PR | - I think this is enough to fix the linked issue and thus replace symfony#23721. ping @tomasfejfar FYI Commits ------- 4bd01f2 [Process] Make `PhpExecutableFinder` look for the `PHP_BINARY` env var
2 parents 6470380 + 4bd01f2 commit 88ed829

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