if (file_exists($working_path . DIRECTORY_SEPARATOR . '.ht.router.php'
)) { $server[] =
$working_path . DIRECTORY_SEPARATOR . '.ht.router.php';
} $ps =
new Process($server,
$working_path);
$ps->
setIdleTimeout(30
) ->
setTimeout(30
) ->
start();
// Wait until the web server has started. It is started if the port is no
// longer available.
for ($i = 0;
$i < 50;
$i++
) { usleep(100000
);
if (!
$this->
checkPortIsAvailable($port)) { return $ps;
} } throw new \
RuntimeException(sprintf("Unable to start the web server.\nCMD: %s \nCODE: %d\nSTATUS: %s\nOUTPUT:\n%s\n\nERROR OUTPUT:\n%s",
$ps->
getCommandLine(),
$ps->
getExitCode(),
$ps->
getStatus(),
$ps->
getOutput(),
$ps->
getErrorOutput()));
} /**
* Stop the HTTP server, zero out all necessary variables.
*/
protected function stopServer() {