summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-05-05 14:59:13 +0000
committerGitHub <[email protected]>2020-05-05 14:59:13 +0000
commit4d7dff992d7aef6775744f91ce2766d164f4a5da (patch)
treede2e7c8d30e8ef7b9ac5865625ab308ff3c104d9
parent670a6de77a0aee53296ac8741853cbec1b416f8d (diff)
parent1ca2cd491bc0f70aa2893c7e39e0389345a7728b (diff)
Merge #318v1.8.0
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]>
-rw-r--r--.github/workflows/ci-build.yml6
-rw-r--r--CHANGELOG.md6
-rw-r--r--bors.toml2
-rwxr-xr-xbuild.sh2
-rw-r--r--composer.json4
-rw-r--r--src/HttpClient.php2
-rw-r--r--src/PSR7Client.php14
-rw-r--r--src/Worker.php4
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)
diff --git a/bors.toml b/bors.toml
index 51ac6357..cedaffb2 100644
--- a/bors.toml
+++ b/bors.toml
@@ -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)',
diff --git a/build.sh b/build.sh
index da6826f9..b14bcb88 100755
--- a/build.sh
+++ b/build.sh
@@ -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 */