From fd6fa81001b00db5defa392d89eac33cf45e1dc5 Mon Sep 17 00:00:00 2001 From: Samuel ROZE Date: Sat, 28 Oct 2017 13:28:48 +0100 Subject: [PATCH 1/3] 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" + } +} From 2abcbd8588678acb2e81a37c6fca69142ce3ef15 Mon Sep 17 00:00:00 2001 From: Samuel ROZE Date: Sun, 29 Oct 2017 16:15:12 +0000 Subject: [PATCH 2/3] Ignore `serverless` and `node_modules`s --- sroze/openwhisk-bundle/0.2/manifest.json | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sroze/openwhisk-bundle/0.2/manifest.json b/sroze/openwhisk-bundle/0.2/manifest.json index eae714af..cad43823 100644 --- a/sroze/openwhisk-bundle/0.2/manifest.json +++ b/sroze/openwhisk-bundle/0.2/manifest.json @@ -1,5 +1,9 @@ { "copy-from-recipe": { "index.php": "index.php" - } + }, + "gitignore": [ + "/.serverless", + "/node_modules" + ] } From cf9c6772f709dc29dce9074fb84868be7f5c34dd Mon Sep 17 00:00:00 2001 From: Samuel ROZE Date: Mon, 30 Oct 2017 09:17:11 +0000 Subject: [PATCH 3/3] Remove ignores as nothing related to openwhisk --- sroze/openwhisk-bundle/0.2/manifest.json | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/sroze/openwhisk-bundle/0.2/manifest.json b/sroze/openwhisk-bundle/0.2/manifest.json index cad43823..eae714af 100644 --- a/sroze/openwhisk-bundle/0.2/manifest.json +++ b/sroze/openwhisk-bundle/0.2/manifest.json @@ -1,9 +1,5 @@ { "copy-from-recipe": { "index.php": "index.php" - }, - "gitignore": [ - "/.serverless", - "/node_modules" - ] + } }