Skip to content

Commit

Permalink
Merge #318
Browse files Browse the repository at this point in the history
318: release 1.8.0 r=48d90782 a=48d90782

release 1.8.0

Co-authored-by: Valery Piashchynski <[email protected]>
Co-authored-by: Valentin V / vvval <[email protected]>
  • Loading branch information
3 people authored May 5, 2020
2 parents 670a6de + 1ca2cd4 commit 4d7dff9
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 15 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php: [7.3, 7.4]
php: [7.2, 7.3, 7.4]
go: [1.13, 1.14]
os: [ubuntu-latest]
env:
Expand Down Expand Up @@ -57,8 +57,8 @@ jobs:
- name: Install Composer dependencies
run: composer install --prefer-dist --no-interaction --no-suggest # --prefer-source

- name: Analyze PHP sources
run: composer analyze
# - name: Analyze PHP sources
# run: composer analyze

- name: Install Go dependencies
run: go mod download
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
CHANGELOG
=========

v1.8.0 (05.05.2020)
-------------------
- Update goridge version to 2.4.0
- Update PHP version to the 7.2 (currently minimum supported)
- See the full milestone here: [link](https://github.com/spiral/roadrunner/issues?q=is%3Aclosed+milestone%3A1.8.0)

v1.7.1 (22.04.2020)
-------------------
- Syscall usage optimized. Now the data is packing and sending via 1 (or 2 in some cases) send_socket calls, instead of 2-3 (by @vvval)
Expand Down
2 changes: 2 additions & 0 deletions bors.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
status = [
'Build (PHP 7.2, Go 1.13, OS ubuntu-latest)',
'Build (PHP 7.2, Go 1.14, OS ubuntu-latest)',
'Build (PHP 7.3, Go 1.13, OS ubuntu-latest)',
'Build (PHP 7.3, Go 1.14, OS ubuntu-latest)',
'Build (PHP 7.4, Go 1.13, OS ubuntu-latest)',
Expand Down
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ cd $(dirname "${BASH_SOURCE[0]}")
OD="$(pwd)"

# Pushes application version into the build information.
RR_VERSION=1.7.1
RR_VERSION=1.8.0

# Hardcode some values to the core package
LDFLAGS="$LDFLAGS -X github.com/spiral/roadrunner/cmd/rr/cmd.Version=${RR_VERSION}"
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
}
],
"require": {
"php": "^7.1",
"php": "^7.2",
"ext-json": "*",
"ext-curl": "*",
"spiral/goridge": "^2.3",
"spiral/goridge": "^2.4",
"psr/http-factory": "^1.0",
"psr/http-message": "^1.0",
"symfony/console": "^2.5.0 || ^3.0.0 || ^4.0.0 || ^5.0.0",
Expand Down
2 changes: 1 addition & 1 deletion src/HttpClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function getWorker(): Worker
* @return mixed[]|null Request information as ['ctx'=>[], 'body'=>string]
* or null if termination request or invalid context.
*/
public function acceptRequest()
public function acceptRequest(): ?array
{
$body = $this->getWorker()->receive($ctx);
if (empty($body) && empty($ctx)) {
Expand Down
14 changes: 7 additions & 7 deletions src/PSR7Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
namespace Spiral\RoadRunner;

use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\UploadedFileInterface;
use Psr\Http\Message\ServerRequestFactoryInterface;
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Message\StreamFactoryInterface;
use Psr\Http\Message\UploadedFileFactoryInterface;
use Psr\Http\Message\UploadedFileInterface;

/**
* Manages PSR-7 request and response.
Expand Down Expand Up @@ -69,7 +69,7 @@ public function getWorker(): Worker
/**
* @return ServerRequestInterface|null
*/
public function acceptRequest()
public function acceptRequest(): ?ServerRequestInterface
{
$rawRequest = $this->httpClient->acceptRequest();
if ($rawRequest === null) {
Expand Down Expand Up @@ -101,11 +101,11 @@ public function acceptRequest()
}

if ($rawRequest['ctx']['parsed']) {
$request = $request->withParsedBody(json_decode($rawRequest['body'], true));
} else {
if ($rawRequest['body'] !== null) {
$request = $request->withBody($this->streamFactory->createStream($rawRequest['body']));
}
return $request->withParsedBody(json_decode($rawRequest['body'], true));
}

if ($rawRequest['body'] !== null) {
return $request->withBody($this->streamFactory->createStream($rawRequest['body']));
}

return $request;
Expand Down
4 changes: 3 additions & 1 deletion src/Worker.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

use Spiral\Goridge\Exceptions\GoridgeException;
use Spiral\Goridge\RelayInterface as Relay;
use Spiral\Goridge\SocketRelay;
use Spiral\Goridge\StreamRelay;
use Spiral\RoadRunner\Exception\RoadRunnerException;

/**
Expand All @@ -28,7 +30,7 @@ class Worker
// Send as response context to request worker termination
public const STOP = '{"stop":true}';

/** @var Relay */
/** @var Relay|StreamRelay|SocketRelay */
private $relay;

/** @var bool */
Expand Down

0 comments on commit 4d7dff9

Please sign in to comment.