This bundle provides a PHPStreamServer integration with the Symfony framework to run your application in a highly efficient event-loop based runtime.
$ composer require phpstreamserver/symfony
// config/bundles.php
return [
// ...
PHPStreamServer\Symfony\PHPStreamServerBundle::class => ['all' => true],
];
# config/phpss.config.php
use PHPStreamServer\Core\ReloadStrategy\ExceptionReloadStrategy;
use PHPStreamServer\Core\Server;
use PHPStreamServer\Symfony\Worker\SymfonyHttpServerProcess;
return static function (Server $server): void {
$server->addWorker(new SymfonyHttpServerProcess(
listen: '0.0.0.0:80',
count: 1,
reloadStrategies: [
new ExceptionReloadStrategy(),
],
));
};
# bin/phpss
use App\Kernel;
use PHPStreamServer\Symfony\PHPStreamServerRuntime;
$_SERVER['APP_RUNTIME'] = PHPStreamServerRuntime::class;
require_once \dirname(__DIR__).'/vendor/autoload_runtime.php';
return function (array $context) {
return new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);
};
$ bin/phpss start