8000 feature #58258 [Process] Add Laravel Herd php detection path (mpociot) · symfony/symfony@0487a08 · GitHub
[go: up one dir, main page]

Skip to content

Commit 0487a08

Browse files
feature #58258 [Process] Add Laravel Herd php detection path (mpociot)
This PR was submitted for the 7.1 branch but it was squashed and merged into the 7.2 branch instead. Discussion ---------- [Process] Add Laravel Herd php detection path | Q | A | ------------- | --- | Branch? | 7.2 | Bug fix? | no | New feature? |yes | Deprecations? |no | Issues | – | License | MIT As of right now, using the `PhpExecutableFinder` in combination with Laravel Herd, results in an empty string, which is what this PR fixes. As the PhpExecutableFinder is already aware of XAMPP, it might be a good idea to also add support for Laravel Herd, which is widely used - not only in the Laravel ecosystem. Laravel Herd uses statically compiled PHP binaries, which is why the `PHP_BINDIR` folder always points to `/bin` instead of a user-specific folder. As Laravel Herd adds a `HERD_HOME` environment variable, we can check for the existence of this variable and then add the bin subdirectory to the list of directories to search. I couldn't find any tests for XAMPP, which is why I haven't included any for this addition. Commits ------- 93ca4e9 [Process] Add Laravel Herd php detection path
2 parents 0ce31a5 + 93ca4e9 commit 0487a08

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Symfony/Component/Process/PhpExecutableFinder.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,10 @@ public function find(bool $includeArgs = true): string|false
8686
$dirs[] = 'C:\xampp\php\\';
8787
}
8888

89+
if ($herdPath = getenv('HERD_HOME')) {
90+
$dirs[] = $herdPath.\DIRECTORY_SEPARATOR.'bin';
91+
}
92+
8993
return $this->executableFinder->find('php', false, $dirs);
9094
}
9195

0 commit comments

Comments
 (0)
0