updg/roadrunner-symfony

0.0.4 2020-02-24 03:08 UTC

This package is auto-updated.

Last update: 2024-10-24 13:30:25 UTC


README

Simple bridge between Symfony and RoadRunner without PSR7 layer (HttpClient).

Installation

Require this library using composer

composer req updg/roadrunner-symfony

Create psr-worker.php file and add this content to it

<?php
require __DIR__ . "/vendor/autoload.php";

if (!isset($_SERVER['APP_ENV']) && !isset($_ENV['APP_ENV'])) {
    if (!class_exists(\Symfony\Component\Dotenv\Dotenv::class)) {
        throw new \RuntimeException(
            'APP_ENV environment variable is not defined. You need to define environment variables for configuration or add "symfony/dotenv" as a Composer dependency to load variables from a .env file.'
        );
    }
    (new \Symfony\Component\Dotenv\Dotenv())->load(__DIR__ . '/.env');
}


$integration = new \updg\roadrunner\symfony\SymfonyIntegration(App\Kernel::class);
$bridge = new \updg\roadrunner\easy\RoadRunner($integration);
$bridge->run();

That's it! Now just run RoadRunner server.