Skip to content

Commit

Permalink
Added the ability to set RoadRunner and FrankenPhp binary file path v…
Browse files Browse the repository at this point in the history
…ia config
  • Loading branch information
mingalevme committed Jul 10, 2024
1 parent e5126e7 commit 45ea4a7
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/FrankenPhp/Concerns/FindsFrankenPhpBinary.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,15 @@ 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()]);
}
}
9 changes: 9 additions & 0 deletions src/RoadRunner/Concerns/FindsRoadRunnerBinary.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,15 @@ 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

0 comments on commit 45ea4a7

Please sign in to comment.