Conditions | 4 |
Paths | 4 |
Total Lines | 19 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
31 | private static function setEnv($name, $value = null) |
||
32 | { |
||
33 | $env = $name; |
||
34 | if (is_string($name) && !isset($value)) { |
||
35 | $env = [ |
||
36 | $name => $value |
||
37 | ]; |
||
38 | } |
||
39 | |||
40 | foreach ($env as $key => $value) { |
||
41 | $oldSetting = $key . '=' . env($key); |
||
42 | $newSetting = $key . '=' . $value; |
||
43 | |||
44 | putenv($newSetting); |
||
45 | |||
46 | file_put_contents(app()->environmentFilePath(), str_replace( |
||
47 | $oldSetting, |
||
48 | $newSetting, |
||
49 | file_get_contents(app()->environmentFilePath()) |
||
50 | )); |
||
54 |