Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added the ability to set RoadRunner and FrankenPhp binary file path via config #925

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/FrankenPhp/Concerns/FindsFrankenPhpBinary.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,16 @@ trait FindsFrankenPhpBinary
*/
protected function findFrankenPhpBinary(): ?string
{
if (! is_null($frankenPhpBinary = config('octane.frankenphp.binary'))) {
if (! file_exists($frankenPhpBinary)) {
throw new \RuntimeException(
'FrankenPHP binary is not found at path: '.config('octane.frankenphp.binary')
);
}

return $frankenPhpBinary;
}

return (new ExecutableFinder())->find('frankenphp', null, [base_path()]);
}
}
10 changes: 10 additions & 0 deletions src/RoadRunner/Concerns/FindsRoadRunnerBinary.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,16 @@ trait FindsRoadRunnerBinary
*/
protected function findRoadRunnerBinary(): ?string
{
if (! is_null($roadRunnerBinary = config('octane.roadrunner.binary'))) {
if (! file_exists($roadRunnerBinary)) {
throw new \RuntimeException(
'RoadRunner binary is not found at path: '.config('octane.roadrunner.binary')
);
}

return $roadRunnerBinary;
}

if (file_exists(base_path('rr'))) {
return base_path('rr');
}
Expand Down