Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
dunglas committed Oct 28, 2023
1 parent 531d43c commit 6c47901
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 5 deletions.
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,6 @@ trim_trailing_whitespace = false

[*.{yml,yaml}]
indent_size = 2

[Caddyfile]
indent_style = tab
2 changes: 1 addition & 1 deletion src/Commands/Concerns/InstallsFrankenPhpDependencies.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ protected function ensureFrankenPhpBinaryIsInstalled(): string
$this->downloadFrankenPhpBinary();

copy(__DIR__.'/../stubs/Caddyfile', base_path('Caddyfile'));
copy(__DIR__.'/../stubs/frankenphp-worker.php', base_path('public/frankenphp-worker.php'));
copy(__DIR__.'/../stubs/frankenphp-worker.php', public_path('frankenphp-worker.php'));
}

return base_path('frankenphp');
Expand Down
1 change: 1 addition & 0 deletions src/Commands/StartFrankenPhpCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ public function handle(ServerProcessInspector $inspector, ServerStateFile $serve
], base_path(), [
'APP_ENV' => app()->environment(),
'APP_BASE_PATH' => base_path(),
'APP_PUBLIC_PATH' => public_path(),
'LARAVEL_OCTANE' => 1,
'SERVER_NAME' => ($this->option('https') ? 'https://' : 'http://')."$host:".$this->getPort(),
'WORKER_COUNT' => $this->workerCount() ?: '',
Expand Down
7 changes: 4 additions & 3 deletions src/Commands/stubs/Caddyfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{$CADDY_GLOBAL_OPTIONS}

frankenphp {
worker public/frankenphp-worker.php {$WORKER_COUNT}
worker {$APP_PUBLIC_PATH}/frankenphp-worker.php {$WORKER_COUNT}
}
}

Expand All @@ -23,8 +23,9 @@
# Mercure config is injected here
{$CADDY_SERVER_EXTRA_DIRECTIVES}

root * public/
root * {$APP_PUBLIC_PATH}
php_server {
index frankenphp-worker.php
index frankenphp-worker.php
}
}
}
1 change: 0 additions & 1 deletion src/Commands/stubs/frankenphp-worker.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
use Laravel\Octane\RequestContext;
use Laravel\Octane\Worker;


if ((! ($_SERVER['FRANKENPHP_WORKER'] ?? false)) || ! function_exists('frankenphp_handle_request')) {
echo 'You need FrankenPHP in worker mode to use this script.';

Expand Down

0 comments on commit 6c47901

Please sign in to comment.