| Conditions | 3 |
| Paths | 1 |
| Total Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 11 | public function __construct($host = '127.0.0.1', $docroot = null, $router = null, $php = PHP_BINARY) |
||
| 12 | { |
||
| 13 | $port = mt_rand(49152, 65535); |
||
| 14 | $command = implode(' ', array_filter([ |
||
| 15 | escapeshellarg($php), |
||
| 16 | '-S', |
||
| 17 | escapeshellarg("$host:$port"), |
||
| 18 | $docroot !== null ? ('-t ' . escapeshellarg($docroot)) : null, |
||
| 19 | $router !== null ? escapeshellarg($router) : null, |
||
| 20 | ], 'is_string')); |
||
| 21 | parent::__construct($command, null, null, ['bypass_shell' => true]); |
||
| 22 | $this->host = $host; |
||
| 23 | $this->port = $port; |
||
| 24 | } |
||
| 25 | |||
| 35 |