Conditions | 4 |
Paths | 3 |
Total Lines | 17 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
18 | protected function serve($port = 8000) |
||
19 | { |
||
20 | $continue = true; |
||
21 | do { |
||
22 | if ($this->check_port($port)) { |
||
23 | $this->output->writeln('<info>Running php artisan serve --port='.$port.'</info>'); |
||
24 | exec('php artisan serve --port='.$port.' > /dev/null 2>&1 &'); |
||
25 | sleep(1); |
||
26 | if (file_exists('/usr/bin/sensible-browser')) { |
||
27 | $this->output->writeln('<info>Opening http://localhost:'.$port.' with default browser</info>'); |
||
28 | passthru('/usr/bin/sensible-browser http://localhost:'.$port); |
||
29 | } |
||
30 | $continue = false; |
||
31 | } |
||
32 | ++$port; |
||
33 | } while ($continue); |
||
34 | } |
||
35 | |||
57 |