Skip to content

Commit

Permalink
Adds support for RoadRunner v2.6.x (#449)
Browse files Browse the repository at this point in the history
  • Loading branch information
nunomaduro authored Dec 20, 2021
1 parent 21bf8b3 commit 1fcbf98
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Commands/Concerns/InstallsRoadRunnerDependencies.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ trait InstallsRoadRunnerDependencies
*
* @var string
*/
protected $requiredVersion = '2.1.1';
protected $requiredVersion = '2.6.6';

/**
* Determine if RoadRunner is installed.
Expand Down
2 changes: 2 additions & 0 deletions src/Commands/Concerns/InteractsWithIO.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@ trait InteractsWithIO
'scan command',
'stop signal received, grace timeout is: ',
'exit forced',
'worker allocated',
'worker constructed',
'worker destructed',
'[INFO] RoadRunner server started; version:',
];

/**
Expand Down
14 changes: 11 additions & 3 deletions src/Commands/StartRoadRunnerCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -200,14 +200,22 @@ protected function writeServerOutput($server)
return $this->raw($debug['msg']);
}

if ($debug['level'] == 'debug' && isset($debug['remote'])) {
[$statusCode, $method, $url] = explode(' ', $debug['msg']);
if ($debug['level'] == 'info'
&& isset($debug['remote_address'])
&& isset($debug['msg'])
&& $debug['msg'] == 'http log') {
[
'elapsed' => $elapsed,
'method' => $method,
'status' => $statusCode,
'URI' => $url,
] = $debug;

return $this->requestInfo([
'method' => $method,
'url' => $url,
'statusCode' => $statusCode,
'duration' => $this->calculateElapsedTime($debug['elapsed']),
'duration' => $this->calculateElapsedTime($elapsed),
]);
}
});
Expand Down

0 comments on commit 1fcbf98

Please sign in to comment.