Conditions | 2 |
Paths | 2 |
Total Lines | 15 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
36 | public function execute(InputInterface $input, OutputInterface $output) |
||
37 | { |
||
38 | $config = config()->get('database', []); |
||
39 | $connection = $input->getOption('connection'); |
||
40 | if (!isset($config[$connection])) { |
||
41 | throw new \RuntimeException(sprintf('Cannot found database "%s" config', $connection)); |
||
42 | } |
||
43 | |||
44 | $this->config = $config[$connection]; |
||
45 | $this->config['dbname'] = $this->config['name']; |
||
46 | |||
47 | $this->createConnection(); |
||
48 | |||
49 | return parent::execute($input, $output); |
||
50 | } |
||
51 | } |
||
52 |