Conditions | 2 |
Paths | 2 |
Total Lines | 17 |
Code Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
13 | public function run() |
||
14 | { |
||
15 | $config = []; |
||
16 | echo 'Enter database adapter (default: sqlite): '; |
||
17 | $this->getFromStdin($config['adapter'], 'sqlite'); |
||
18 | if ('sqlite' !== $config['adapter']) { |
||
19 | echo 'Enter database host (default: localhost): '; |
||
20 | $this->getFromStdin($config['host'], 'localhost'); |
||
21 | echo 'Enter username (default: root): '; |
||
22 | $this->getFromStdin($config['username'], 'root'); |
||
23 | echo 'Enter password (default: root): '; |
||
24 | $this->getFromStdin($config['password'], 'root'); |
||
25 | } |
||
26 | echo 'Enter database name (default: phalcon): '; |
||
27 | $this->getFromStdin($config['dbname'], 'phalcon'); |
||
28 | file_put_contents(PathProvider::getConfig(), '<?php return ' . var_export($config, true) . ';'); |
||
29 | echo 'Config generated in ' . PathProvider::getConfig() . PHP_EOL; |
||
30 | } |
||
43 | } |