File tree Expand file tree Collapse file tree 3 files changed +4
-4
lines changed
Expand file tree Collapse file tree 3 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -330,5 +330,5 @@ function model(string $class) : Model
330330 */
331331function env (string $ key , mixed $ default = null ) : mixed
332332{
333- return $ _ENV [$ key ] ?? $ _SERVER [ $ key ] ?? $ default ;
333+ return $ _ENV [$ key ] ?? $ default ;
334334}
Original file line number Diff line number Diff line change 77 */
88if (is_file (__DIR__ . '/../.env.php ' )) {
99 require __DIR__ . '/../.env.php ' ;
10- foreach ( $ _ENV as $ key => $ value ) {
11- $ _SERVER [$ key ] = $ value ;
10+ if ( isset ( $ _ENV [ ' ENVIRONMENT ' ]) ) {
11+ $ _SERVER [' ENVIRONMENT ' ] = $ _ENV [ ' ENVIRONMENT ' ] ;
1212 }
1313}
1414
Original file line number Diff line number Diff line change @@ -264,7 +264,7 @@ public function testEnv() : void
264264 $ _SERVER ['foo ' ] = 'bar ' ;
265265 $ _SERVER ['bar ' ] = 'baz ' ;
266266 self ::assertSame ('foo ' , env ('foo ' ));
267- self ::assertSame ( ' baz ' , env ('bar ' ));
267+ self ::assertNull ( env ('bar ' ));
268268 self ::assertNull (env ('unknown ' ));
269269 }
270270}
You can’t perform that action at this time.
0 commit comments