PHP code example of christoph-kluge / cloudfront-edge-php-adapter

1. Go to this page and download the library: Download christoph-kluge/cloudfront-edge-php-adapter 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/ */

    

christoph-kluge / cloudfront-edge-php-adapter example snippets


#!/opt/bin/php


use Bref\Runtime\LambdaRuntime;

$appRoot = getenv('LAMBDA_TASK_ROOT');
tstrap/app.php';

/** @var CloudfrontEdgeHandler $handler */
$handler = $app->make(CloudfrontEdgeHandler::class);

$lambdaRuntime = LambdaRuntime::fromEnvironmentVariable();
while (true) {
    $lambdaRuntime->processNextEvent($handler);
}

#!/opt/bin/php


$appRoot = getenv('LAMBDA_TASK_ROOT');