diff options
-rw-r--r-- | .github/workflows/ci-build.yml | 6 | ||||
-rw-r--r-- | CHANGELOG.md | 6 | ||||
-rw-r--r-- | bors.toml | 2 | ||||
-rwxr-xr-x | build.sh | 2 | ||||
-rw-r--r-- | composer.json | 4 | ||||
-rw-r--r-- | src/HttpClient.php | 2 | ||||
-rw-r--r-- | src/PSR7Client.php | 14 | ||||
-rw-r--r-- | src/Worker.php | 4 |
8 files changed, 25 insertions, 15 deletions
diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index 6045fd57..57edc624 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -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: @@ -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 diff --git a/CHANGELOG.md b/CHANGELOG.md index 229609fd..b17ad8da 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) @@ -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)', @@ -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}" diff --git a/composer.json b/composer.json index fde54fa8..c4fa8609 100644 --- a/composer.json +++ b/composer.json @@ -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", diff --git a/src/HttpClient.php b/src/HttpClient.php index 42c434a8..4ca152c8 100644 --- a/src/HttpClient.php +++ b/src/HttpClient.php @@ -34,7 +34,7 @@ final class HttpClient * @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)) { diff --git a/src/PSR7Client.php b/src/PSR7Client.php index 98897890..777dd891 100644 --- a/src/PSR7Client.php +++ b/src/PSR7Client.php @@ -10,11 +10,11 @@ declare(strict_types=1); 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. @@ -69,7 +69,7 @@ class PSR7Client /** * @return ServerRequestInterface|null */ - public function acceptRequest() + public function acceptRequest(): ?ServerRequestInterface { $rawRequest = $this->httpClient->acceptRequest(); if ($rawRequest === null) { @@ -101,11 +101,11 @@ class PSR7Client } 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; diff --git a/src/Worker.php b/src/Worker.php index 3d1888e3..2da16e86 100644 --- a/src/Worker.php +++ b/src/Worker.php @@ -11,6 +11,8 @@ namespace Spiral\RoadRunner; use Spiral\Goridge\Exceptions\GoridgeException; use Spiral\Goridge\RelayInterface as Relay; +use Spiral\Goridge\SocketRelay; +use Spiral\Goridge\StreamRelay; use Spiral\RoadRunner\Exception\RoadRunnerException; /** @@ -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 */ |