File tree Expand file tree Collapse file tree 1 file changed +21
-4
lines changed Expand file tree Collapse file tree 1 file changed +21
-4
lines changed Original file line number Diff line number Diff line change @@ -178,10 +178,27 @@ protected static function createKernel(array $options = array())
178178 static ::$ class = static ::getKernelClass ();
179179 }
180180
181- return new static::$ class (
182- isset ($ options ['environment ' ]) ? $ options ['environment ' ] : 'test ' ,
183- isset ($ options ['debug ' ]) ? $ options ['debug ' ] : true
184- );
181+ if (isset ($ options ['environment ' ])) {
182+ $ env = $ options ['environment ' ];
183+ } elseif (isset ($ _SERVER ['APP_ENV ' ])) {
184+ $ env = $ _SERVER ['APP_ENV ' ];
185+ } elseif (isset ($ _ENV ['APP_ENV ' ])) {
186+ $ env = $ _ENV ['APP_ENV ' ];
187+ } else {
188+ $ env = 'test ' ;
189+ }
190+
191+ if (isset ($ options ['debug ' ])) {
192+ $ debug = $ options ['debug ' ];
193+ } elseif (isset ($ _SERVER ['APP_DEBUG ' ])) {
194+ $ debug = $ _SERVER ['APP_DEBUG ' ];
195+ } elseif (isset ($ _ENV ['APP_DEBUG ' ])) {
196+ $ debug = $ _ENV ['APP_DEBUG ' ];
197+ } else {
198+ $ debug = true ;
199+ }
200+
201+ return new static::$ class ($ env , $ debug );
185202 }
186203
187204 /**
You can’t perform that action at this time.
0 commit comments