From e7f22984ef97809663bcdf557819136e898c13be Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Mon, 26 Aug 2024 22:37:42 -0700 Subject: [PATCH 1/2] allow deployments in sub directory --- src/HandlerResolver.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/HandlerResolver.php b/src/HandlerResolver.php index 5e00372..42d81da 100644 --- a/src/HandlerResolver.php +++ b/src/HandlerResolver.php @@ -107,12 +107,10 @@ private function symfonyContainer(?string $bootstrapFile = null): ContainerInter )); } - $projectDir = getenv('LAMBDA_TASK_ROOT') ?: null; - // Use the Symfony Runtime component to resolve the closure and get the PSR-11 container $options = $_SERVER['APP_RUNTIME_OPTIONS'] ?? []; - if ($projectDir) { - $options['project_dir'] = $projectDir; + if (!isset($options['project_dir'])) { + $options['project_dir'] = dirname(__DIR__, 4); } $runtime = new BrefRuntime($options); From b2eb2f5f01e4fc27375c59e56902f42bec8dcd9a Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Tue, 27 Aug 2024 05:37:38 -0700 Subject: [PATCH 2/2] fix cs --- src/HandlerResolver.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/HandlerResolver.php b/src/HandlerResolver.php index 42d81da..60e7521 100644 --- a/src/HandlerResolver.php +++ b/src/HandlerResolver.php @@ -109,7 +109,7 @@ private function symfonyContainer(?string $bootstrapFile = null): ContainerInter // Use the Symfony Runtime component to resolve the closure and get the PSR-11 container $options = $_SERVER['APP_RUNTIME_OPTIONS'] ?? []; - if (!isset($options['project_dir'])) { + if (! isset($options['project_dir'])) { $options['project_dir'] = dirname(__DIR__, 4); } $runtime = new BrefRuntime($options);