From fd6fa81001b00db5defa392d89eac33cf45e1dc5 Mon Sep 17 00:00:00 2001 From: Samuel ROZE Date: Sat, 28 Oct 2017 13:28:48 +0100 Subject: [PATCH] Add the openwhisk-bundle recipe --- sroze/openwhisk-bundle/0.2/index.php | 43 ++++++++++++++++++++++++ sroze/openwhisk-bundle/0.2/manifest.json | 5 +++ 2 files changed, 48 insertions(+) create mode 100644 sroze/openwhisk-bundle/0.2/index.php create mode 100644 sroze/openwhisk-bundle/0.2/manifest.json diff --git a/sroze/openwhisk-bundle/0.2/index.php b/sroze/openwhisk-bundle/0.2/index.php new file mode 100644 index 00000000..5c439e68 --- /dev/null +++ b/sroze/openwhisk-bundle/0.2/index.php @@ -0,0 +1,43 @@ +load(__DIR__.'/.env'); + } + + if ($_SERVER['APP_DEBUG'] ?? false) { + umask(0000); + + Debug::enable(); + } + + $kernel = new Kernel($_SERVER['APP_ENV'] ?? 'dev', $_SERVER['APP_DEBUG'] ?? false); + $response = $kernel->handle($request); + + $kernel->terminate($request, $response); + + return $response; +} + +function main(array $args) : array +{ + try { + $request = RequestFactory::fromArgs($args); + $response = handle_request($request); + + return ResponseFactory::fromHttpFoundationResponse($response); + } catch (\Throwable $e) { + return ResponseFactory::fromException($e); + } +} diff --git a/sroze/openwhisk-bundle/0.2/manifest.json b/sroze/openwhisk-bundle/0.2/manifest.json new file mode 100644 index 00000000..eae714af --- /dev/null +++ b/sroze/openwhisk-bundle/0.2/manifest.json @@ -0,0 +1,5 @@ +{ + "copy-from-recipe": { + "index.php": "index.php" + } +}