Conditions | 3 |
Paths | 2 |
Total Lines | 19 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 12 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
42 | protected function execute(InputInterface $input, OutputInterface $output) |
||
43 | { |
||
44 | $file = $input->getArgument('config-file'); |
||
45 | |||
46 | // Test if config file exists |
||
47 | if (!file_exists($file) || !is_readable($file)) { |
||
48 | $msg = "Configuration file '$file' does not exists or is not readable'"; |
||
49 | throw new \InvalidArgumentException($msg); |
||
50 | } |
||
51 | $params = include($file); |
||
52 | $port = $params['port']; |
||
53 | |||
54 | $config = new StandaloneServer\Config($params); |
||
55 | |||
56 | $this->server = new StandaloneServer($config); |
||
57 | $this->server->start(); |
||
58 | |||
59 | $output->write("Server successfully started on port $port" . PHP_EOL); |
||
60 | } |
||
61 | } |
||
62 |