topic-advisor/php-lambda-runtime-api-symfony-handler

Symfony handler for the topic-advisor/php-lambda-runtime-api library

0.6.0 2020-05-26 01:08 UTC

README

Symfony handler for the topic-advisor/php-lambda-runtime-api library

Installation

Use composer: composer require topic-advisor/php-lambda-runtime-api-symfony-handler

Usage

#!/opt/bin/php
<?php

require __DIR__ . '/vendor/autoload.php';

$env = getenv('APP_ENV') ?: 'dev';
$debug = getenv('APP_DEBUG') !== false ? ((bool) getenv('APP_DEBUG')) : false;

if ($debug) {
    umask(0000);
    Symfony\Component\Debug\Debug::enable();
}

$kernel = new AppKernel($env, $debug);
$kernel->boot();

$loop = new TopicAdvisor\Lambda\RuntimeApi\RuntimeApiLoop();
$loop
    ->setHandlers([
        new TopicAdvisor\Lambda\Symfony\Handler\Http\RequestHandler($kernel),
    ])
    ->run();