| Conditions | 1 |
| Paths | 1 |
| Total Lines | 19 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php namespace Modules\Core\Console\Installers\Writers; |
||
| 47 | public function write($name, $username, $password, $host) |
||
| 48 | { |
||
| 49 | Dotenv::makeMutable(); |
||
| 50 | |||
| 51 | $environmentFile = $this->finder->get($this->template); |
||
| 52 | |||
| 53 | $replace = [ |
||
| 54 | "DB_HOST=$host", |
||
| 55 | "DB_DATABASE=$name", |
||
| 56 | "DB_USERNAME=$username", |
||
| 57 | "DB_PASSWORD=$password", |
||
| 58 | ]; |
||
| 59 | |||
| 60 | $newEnvironmentFile = str_replace($this->search, $replace, $environmentFile); |
||
| 61 | |||
| 62 | $this->finder->put($this->file, $newEnvironmentFile); |
||
| 63 | |||
| 64 | Dotenv::makeImmutable(); |
||
| 65 | } |
||
| 66 | } |
||
| 67 |