Replace ServerStartCommand with WorkerRunner
FrankenPHP workers are PHP files started by the frankenphp binary, not console commands. Extract the frankenphp_handle_request() loop into Http\WorkerRunner so apps can use it directly from worker.php. Remove src/Command/ as it's no longer needed. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,20 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace Pronchev\Pinecore\Command;
|
||||
namespace Pronchev\Pinecore\Http;
|
||||
|
||||
use Pronchev\Pinecore\ExceptionHandler;
|
||||
use Pronchev\Pinecore\Http\HttpApplication;
|
||||
use Pronchev\Pinecore\Console\ConsoleInput;
|
||||
use Pronchev\Pinecore\Console\ConsoleOutput;
|
||||
|
||||
final class ServerStartCommand
|
||||
final class WorkerRunner
|
||||
{
|
||||
public function __construct(
|
||||
private readonly HttpApplication $app,
|
||||
private readonly ExceptionHandler $exceptionHandler,
|
||||
) {}
|
||||
|
||||
public function __invoke(ConsoleInput $input, ConsoleOutput $output): int
|
||||
public function run(): void
|
||||
{
|
||||
$maxRequests = (int) ($_SERVER['MAX_REQUESTS'] ?? 0);
|
||||
|
||||
@@ -34,7 +31,5 @@ final class ServerStartCommand
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user