File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -16,19 +16,19 @@ class Env
1616 public function load (?string $ configFile = null , ?string $ envKey = null ): void
1717 {
1818 if (self ::$ envLoaded === false ) {
19+ $ dotEnv = new Dotenv ();
1920 $ configFile = $ configFile ?? $ this ->projectRootAbsolutePath () . '/.env ' ;
2021 if (file_exists ($ configFile )) {
21- $ dotEnv = new Dotenv ();
2222 if (method_exists ($ dotEnv , 'loadEnv ' )) {
2323 $ dotEnv ->loadEnv ($ configFile , $ envKey );
2424 } else {
2525 $ dotEnv ->load ($ configFile );
2626 }
27- self ::$ envLoaded = true ;
2827 } else {
29- throw new RuntimeException ( ' Missing config file. Searching in: '
30- . "\n" . $ configFile , 1500717945887 );
28+ $ env = getenv ();
29+ $ dotEnv -> populate ( $ env );
3130 }
31+ self ::$ envLoaded = true ;
3232 }
3333 }
3434
You can’t perform that action at this time.
0 commit comments