From ac7d6d9379372ab62b26fbda24b3ea81530b46e1 Mon Sep 17 00:00:00 2001 From: Guillermo Dev Date: Tue, 4 Dec 2018 13:22:39 +0100 Subject: [PATCH] add more ways to get environement variables to figure out configuration file to use --- src/Utils/Configuration/Configuration.php | 15 ++++++++++-- src/Utils/WhichEnv/WhichEnv.php | 25 ++++++++++++++++++++ src/Utils/WhichEnv/WhichEnvRuleInterface.php | 19 +++++++++++++++ 3 files changed, 57 insertions(+), 2 deletions(-) create mode 100644 src/Utils/WhichEnv/WhichEnv.php create mode 100644 src/Utils/WhichEnv/WhichEnvRuleInterface.php diff --git a/src/Utils/Configuration/Configuration.php b/src/Utils/Configuration/Configuration.php index 9248c69..1838f2a 100644 --- a/src/Utils/Configuration/Configuration.php +++ b/src/Utils/Configuration/Configuration.php @@ -1,6 +1,8 @@ hasEnv($varName); + } + + static public function get(string $varName) + { + return self::$rule->getEnv($varName); + } +} diff --git a/src/Utils/WhichEnv/WhichEnvRuleInterface.php b/src/Utils/WhichEnv/WhichEnvRuleInterface.php new file mode 100644 index 0000000..82fb440 --- /dev/null +++ b/src/Utils/WhichEnv/WhichEnvRuleInterface.php @@ -0,0 +1,19 @@ +