A runtime with guzzlehttp/psr7.
If you are new to the Symfony Runtime component, read more in the main readme.
composer require runtime/psr-guzzle
This runtime is discovered automatically. You can force your application to use
this runtime by defining the environment variable APP_RUNTIME.
APP_RUNTIME=Runtime\PsrGuzzle\Runtime
// public/index.phpusePsr\Http\Message\ServerRequestInterface;
useGuzzleHttp\Psr7;
require_oncedirname(__DIR__).'/vendor/autoload_runtime.php';
returnfunction (ServerRequestInterface$request) {
returnnewPsr7\Response(200, [], 'PSR-7');
};// public/index.phpusePsr\Http\Server\RequestHandlerInterface;
usePsr\Http\Message\ServerRequestInterface;
usePsr\Http\Message\ResponseInterface;
useGuzzleHttp\Psr7;
require_oncedirname(__DIR__).'/vendor/autoload_runtime.php';
class Application implements RequestHandlerInterface {
// ...publicfunctionhandle(ServerRequestInterface$request): ResponseInterface
{
returnnewPsr7\Response(200, [], 'PSR-15');
}
}
returnfunction (array$context) {
returnnewApplication($context['APP_ENV'] ?? 'dev');
};