| Conditions | 3 |
| Paths | 4 |
| Total Lines | 13 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 10 | protected function sqliteEnv() |
||
| 11 | { |
||
| 12 | passthru('sed -i \'s/^DB_/#DB_/g\' .env ', $error); |
||
| 13 | if ($error !== 0) { |
||
| 14 | $this->output->writeln('<error>Error commenting DB_ entries in .env file </error>'); |
||
|
|
|||
| 15 | } |
||
| 16 | passthru('sed -i \'s/.*DB_HOST.*/DB_CONNECTION=sqlite\n&/\' .env', $error); |
||
| 17 | if ($error !== 0) { |
||
| 18 | $this->output->writeln('<error>Error adding DB_CONNECTION=sqlite to .env file </error>'); |
||
| 19 | } else { |
||
| 20 | $this->output->writeln('.env file updated successfully'); |
||
| 21 | } |
||
| 22 | } |
||
| 23 | } |
||
| 24 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: