1 | <?php |
||
11 | trait Serve |
||
12 | { |
||
13 | /** |
||
14 | * Serve command. |
||
15 | * |
||
16 | * @param int $port |
||
17 | */ |
||
18 | protected function serve($port = 8000) |
||
35 | |||
36 | /** |
||
37 | * Check if port is in use. |
||
38 | * |
||
39 | * @param int $port |
||
40 | * @param string $host |
||
41 | * @param int $timeout |
||
42 | * |
||
43 | * @return bool |
||
44 | */ |
||
45 | protected function check_port($port = 8000, $host = '127.0.0.1', $timeout = 3) |
||
56 | } |
||
57 |