1: <?php
2: namespace Peridot\WebDriverManager\Console;
3:
4: use Symfony\Component\Console\Input\ArrayInput;
5: use Symfony\Component\Console\Input\InputArgument;
6: use Symfony\Component\Console\Input\InputInterface;
7: use Symfony\Component\Console\Output\OutputInterface;
8:
9: 10: 11: 12: 13: 14:
15: class StartCommand extends AbstractManagerCommand
16: {
17: protected function configure()
18: {
19: $this
20: ->setName('start')
21: ->setDescription('Start Selenium Server')
22: ->addArgument(
23: 'port',
24: InputArgument::OPTIONAL,
25: 'The port you want to start Selenium Server on'
26: );
27: }
28:
29: 30: 31: 32: 33:
34: protected function execute(InputInterface $input, OutputInterface $output)
35: {
36: $port = $input->getArgument('port');
37: if (! $port) {
38: $port = 4444;
39: }
40:
41: $update = $this->getApplication()->find('update');
42: $update->run(new ArrayInput(['command' => 'update']), $output);
43:
44: $output->writeln('<info>Starting Selenium Server...</info>');
45: $this->manager->startInForeground($port);
46: return 0;
47: }
48: }
49: