PHP code example of hunternnm / laravel-roadrunner
1. Go to this page and download the library: Download hunternnm/laravel-roadrunner library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
hunternnm / laravel-roadrunner example snippets
use Hunternnm\LaravelRoadrunner\RoadrunnerLaravelBridge;
use Illuminate\Foundation\Application;
use Illuminate\Http\Request;
use Spiral\Goridge;
use Spiral\RoadRunner;
use Symfony\Bridge\PsrHttpMessage\Factory\HttpFoundationFactory;
use Symfony\Bridge\PsrHttpMessage\Factory\PsrHttpFactory;
use Laminas\Diactoros\ResponseFactory;
use Laminas\Diactoros\ServerRequestFactory;
use Laminas\Diactoros\StreamFactory;
use Laminas\Diactoros\UploadedFileFactory;
ini_set('display_errors', 'stderr');
y {
$symfonyRequest = $httpFoundationFactory->createRequest($req);
$request = Request::createFromBase($symfonyRequest);
$response = $rr->request($request);
$psr7response = $psr7factory->createResponse($response);
$psr7->respond($psr7response);
} catch (Throwable $e) {
$psr7->getWorker()->error((string) $e);
}
}