Skip to content

0.2.0

Compare
Choose a tag to compare
@mnapoli mnapoli released this 09 Feb 10:21
· 30 commits to master since this release
4485405

BC breaks over v0.1

  • Requires Symfony 5.2 or greater

Improvements

Symfony 6 compatibility by @amacrobert in #47 and @mnapoli in #50

The package now provides a Symfony Runtime (by @mnapoli in #45) that lets users:

  • Handle requests with the Kernel directly, without PHP-FPM

Extract of the documentation:

# serverless.yml

functions:
    app:
-        handler: public/index.php
+        handler: App\Kernel
        layers:
            # Switch from PHP-FPM to the "function" runtime:
-            - ${bref:layer.php-80-fpm}
+            - ${bref:layer.php-80}
        environment:
            # The Symfony process will restart every 100 requests
            BREF_LOOP_MAX: 100

The App\Kernel will be retrieved via Symfony Runtime from public/index.php.

  • Handle events with Symfony services

Extract of the documentation:

To handle other events (e.g. SQS messages with Symfony Messenger) via a class name:

# serverless.yml

functions:
    sqsHandler:
-        handler: bin/consumer.php
+        handler: App\Service\MyService
        layers:
            - ${bref:layer.php-80}

The service will be retrieved via Symfony Runtime from the Symfony Kernel returned by public/index.php.

Note: the service must be configured as public (public: true) in the Symfony configuration.

Full Changelog: 0.1.3...0.2.0