Skip to content

Commit

Permalink
Merge pull request #3 from koriym/wait-server-start
Browse files Browse the repository at this point in the history
Sleep 1 sec till server start (PHP 7.4 <)
  • Loading branch information
koriym authored Aug 28, 2020
2 parents d7ff567 + c8109b1 commit 170c91c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Http/BuiltinServer.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ public function __construct(string $host, string $index)
public function start() : void
{
$this->process->start();
if (version_compare(PHP_VERSION, '7.4.0', '<')) {
sleep(1);

return;
}
$this->process->waitUntil(function (string $type, string $output) : bool {
if ($type === 'err' && ! is_int(strpos($output, 'started'))) {
error_log($output);
Expand Down

0 comments on commit 170c91c

Please sign in to comment.