| Conditions | 2 |
| Paths | 2 |
| Total Lines | 16 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 24 | protected function execute(InputInterface $input, OutputInterface $output) |
||
| 25 | { |
||
| 26 | /** @var FileSystem $fileSystem */ |
||
| 27 | $fileSystem = $this->getContainer()->make('filesystem'); |
||
| 28 | |||
| 29 | $sourceFile = __DIR__ . '/../../../' . Application::APP_DEFAULT_CONFIG . '.dist'; |
||
| 30 | $destinationFile = getcwd() . '/' . Application::APP_DEFAULT_CONFIG; |
||
| 31 | |||
| 32 | if ($fileSystem->exists($destinationFile)) { |
||
| 33 | throw new \Exception('Config file has already been initialized.'); |
||
| 34 | } |
||
| 35 | |||
| 36 | $fileSystem->copy($sourceFile, $destinationFile); |
||
| 37 | |||
| 38 | $output->writeln('<comment>Config file generated at:</comment> ' . $destinationFile); |
||
| 39 | } |
||
| 40 | } |
||
| 41 |