ixbox / phambda
v0.1.2
2024-10-29 07:49 UTC
Requires
- php: ^8.1
- php-http/discovery: ^1.17
- psr/container: ^2.0
- psr/http-client: ^1.0
- psr/http-factory: ^1.0
- psr/http-server-handler: ^1.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.52
- nyholm/psr7: ^1.8
- php-http/curl-client: ^2.3
This package is auto-updated.
Last update: 2024-12-29 08:10:07 UTC
README
Feature
This package provides simple way to implement function for PHP on AWS Lambda.
Installation
composer require ixbox/phambda
Dependencies
- PHP 8.1 or later
Sample Implementation
#!/usr/bin/env php <?php require __DIR__ . '/vendor/autoload.php'; use Nyholm\Psr7\Response; use Phambda\Http\Runtime; use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequestInterface; use Psr\Http\Server\RequestHandlerInterface; $handler = new class implements RequestHandlerInterface { public function handle(ServerRequestInterface $request): ResponseInterface { return new Response(body: "Hello World!"); } }; $runtime = new Runtime($handler); $runtime->run();