From 4365d08a018e1c45f3af598c609ea6ccf370956b Mon Sep 17 00:00:00 2001 From: Gregory Haddow Date: Fri, 1 Nov 2024 13:15:49 +0000 Subject: [PATCH] feat: support loading secrets when only present in dotenv --- src/LazySecretsLoader.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/LazySecretsLoader.php b/src/LazySecretsLoader.php index cc3f2b42a..5e91e358e 100644 --- a/src/LazySecretsLoader.php +++ b/src/LazySecretsLoader.php @@ -19,6 +19,11 @@ final class LazySecretsLoader { public static function loadSecretEnvironmentVariables(): void { + + if (class_exists(Secrets::class)) { + Secrets::loadSecretEnvironmentVariables(); + } + if (! self::areThereSecretsToLoad()) { return; } @@ -27,7 +32,6 @@ public static function loadSecretEnvironmentVariables(): void throw new Exception('The "bref/secrets-loader" package is required to load SSM parameters via the "bref-ssm:xxx" syntax in environment variables. Please add it to your "require" section in composer.json.'); } - Secrets::loadSecretEnvironmentVariables(); } /**